SceneItem.SetMaterial

Introduced

v4.0

Description

Assigns a material on the SceneItem. The material will replace the material currently used.

Scripting Syntax

oReturn = SceneItem.SetMaterial( Material );

Return Value

Material

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

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"