Message 1 of 3
Python: apply material from materiallibrary to node

Not applicable
06-23-2016
11:11 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi all !
I'm trying to apply a material loaded from a material library to a node
The steps:
1. MaxPlus.MaterialEditor.LoadMaterialLibrary
2. matlib = MaxPlus.MaterialLibrary.GetCurrentLibrary()
3. loop through matlib to get specific material
4. node.SetMaterial(mat)
I get the following error on step 4 : TypeError: in method 'INode_SetMaterial', argument 2 of type 'Autodesk::Max::Mtl'
MaterialLibrary seems to return MtBase class (node.GetMaterial returns a Mtl class) so I pressume this is the problem ?
Anyone knows how I can fix this ?
Thanks !
Johan