Monday, October 18, 2010

Name Surface shader in Slim

This is example code from my old "SLO_Inspector" utility.



1. Getting Id of Ensemble Object on geometryShape (pSphereShape1 as example):
string $Id[] = `getAttr pSphereShape1.slimEns`;
// Result: 2000_fsgyo400000 //

2 Getting handle of appearence ( the our Ensemble):
string $app_handle = `slimcmd slim GetAppearances -id $Id[0]`;
// Result: func1 //

2.1. Checking shading object name by handle:
string $Name_Shader = `slimcmd $app_handle GetName`;
// Result: Ens_1 // (yes - it name "Ens_1")

3. Getting handle a Surface Shader connected in "Surface" slot:
string $GetSurface_Handle = `slimcmd $app_handle GetProperties -type "surface"`;
// Result: parm26 //

3.1. We can check the right surface handle:
string $Name_Shader1 = `slimcmd $GetSurface_Handle GetName`;
// Result: Surface // - it's really "Surface" handle

4. Getting Id number of connected Surface shader:
string $Id_Surface_Shader = `slimcmd $GetSurface_Handle GetConnection`;
// Result: 2000_rEBbZ400000 //

5. Getting handle of Surface shader:
string $Surface = `slimcmd slim GetAppearances -id $Id_Surface_Shader`;
// Result: func0 //

6. Getting name of Surface Shader
string $NameSurface = `slimcmd $Surface GetName`;
// Result: Blinn //

No comments:

Post a Comment