Python: apply material from materiallibrary to node
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
So here is the thing. I am trying to set up a value of undefined,
Just a simple test with materials.
I run the following code
if the object has a material will print
Animatable(VRayMtl)
if the object doesn´t have a material will print None
but if I try to run the following code (when the object has a material).
I will run in the following error
>> MAXScript MacroScript Error Exception:
-- Runtime error: Line 6487 SetMaterial()
<type 'exceptions.ValueError'> invalid null reference in method 'INode_SetMaterial', argument 2 of type 'Autodesk::Max::Mtl' <<
So the question is how come the value of the material is None when it doesn't have the material assigned, but if i try to assign this value directly I get an error. what am I missing? any help here will be appreciated.