SceneItem.Properties.1.vbs Example

Applies To

SceneItem.Properties property

Description

Apply a Material on a cylinder

Code

set root = Application.Activeproject.ActiveScene.Root
set Cyl = root.AddGeometry("Cylinder","MeshSurface")
Cyl.AddMaterial "Phong",,"PhongInNode"
set mat1 = Cyl.Material
mat1.Parameters("name").Value = "MatOnCyl"
mat1.Shaders("PhongInNode").Parameters("diffuse").blue = 0.453
' Create a group containing the Cylinder, apply a material on it.
set aGroup = root.AddGroup( Cyl )
aGroup.AddMaterial "Phong"
set mat2 = aGroup.Material
mat2.Parameters("name").Value = "MatOnGroup"
mat2.Shaders("Phong").Parameters("diffuse").red = 0.031
' Display the applied properties of the cylinder
'   the Group material "MatOnGroup" should be there, but not "MatOnCyl"
set CylPropColl = Cyl.Properties
logmessage "Applied Properties for : " & Cyl
for each aCylProp in CylPropColl
logmessage " > Branch : " & aCylProp.branch & " - " & aCylProp
next

Keywords

SceneItem Properties


Autodesk Softimage 2011