v4.0
Assigns a material on the SceneItem. The material will replace the material currently used.
oReturn = SceneItem.SetMaterial( Material ); |
Parameter | Type | Description |
---|---|---|
Material | VariantThe material to assign to this object | This material is an existing material and will be used on the object after the assignment |
set oRoot = application.activeproject.activescene.root set oCube = oRoot.AddGeometry("Cube","MeshSurface") set oMaterial = oCube.AddMaterial("Phong", siBranch) set oCylinder = oRoot.AddGeometry("Cylinder","MeshSurface") oCylinder.SetMaterial oMaterial LogMessage "Cylinder's material name: " & oCylinder.Material.FullName 'This example should log something like: 'INFO : "Cylinder's material name: cylinder.Material" |