SetMaterial (SceneItem)
Introduced
4.0
Description
Assigns a material on the SceneItem. The material will replace the material currently used.
Scripting Syntax
SceneItem.SetMaterial( Material )
C# Syntax
SceneItem.SetMaterial( Object in_pMaterial );Parameters
|
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 |
Return Value
Examples
VBScript Example
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"Autodesk Softimage v7.5