PYTHON how create a switch material

PYTHON how create a switch material

Anonymous
Not applicable
975 Views
2 Replies
Message 1 of 3

PYTHON how create a switch material

Anonymous
Not applicable

Hello all,

 

how create an switch material with python ?

switchMtl.PNG

documentation says :

createMaterial(type)

Creates a MaterialPtr of a specific type.

Parameters: type - The name of the material type.
           (type=string - names are like 'U'+like in the MaterialEditor without space e.g. 'UPlasticMaterial') Returns: The material.
           (type=vrMaterialPtr)

 

 

I tried how documentation says : 

createMaterial('USwitchMaterial')

but don't work 😞

0 Likes
Accepted solutions (1)
976 Views
2 Replies
Replies (2)
Message 2 of 3

sinje_thiedemann
Autodesk
Autodesk
Accepted solution

In this case it is just "SwitchMaterial" without the "U".

 

s = createMaterial("SwitchMaterial")

Find out any material type by dropping a material with that type into the Node Editor.

 

SwitchMaterial_Type.PNG

 

Kind regards

Sinje

 

 

Message 3 of 3

Anonymous
Not applicable

thank you Siege, it works fine. Cat Very Happy

0 Likes