PDA

View Full Version : Deleting a caDef from a material


Mathieson
10-15-2009, 03:21 PM
I am having trouble deleting caDefs from materials in the scene. I can use the exact same code to remove the same def from a node's baseobject, but when trying on a material it just doesn't work. Has anybody run into this before and can anybody offer advice for a workaround? Thanks!

Mathieson
10-15-2009, 03:54 PM
Just figured it out. For anyone who is wondering, it seems you cannot delete it through the custAttributes.delete method, but you can do it through the material's attribute virtual array.

deleteItem theMaterial.custAttributes #defName

.. should do the trick.

JHN
10-15-2009, 08:20 PM
:) had the same problem last week, http://forums.cgsociety.org/showthread.php?f=98&t=813892

It probably makes sense to do it like that, but not for me :)

-Johan

CGTalk Moderation
10-15-2009, 08:20 PM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.