[Bf-committers] AttributeError: Writing to ID classes in this context is not allowed

Hart's Antler bhartsho at yahoo.com
Sun Jun 12 10:50:12 CEST 2011


I understand not allowing properties on an object to be changed when in the "draw" method of a bpy.types.Panel forces good coding practices for addon developers.  I think its a good idea to have this rule.

I wish there was a way to bend this rule sometimes.  There are a few cases where it would really come in handy, and doing some other way using Operators can make the code boated and clumsy.  Here is my example:  in the blender2ogre exporter, i have a tool panel for managing collisions that makes a duplicate object with a decimate modifier.  When the user enables or disables the collision, the collision object should be hidden or shown, but right now its not allowed to change the hide property on the collision object throwing the error: AttributeError: Writing to ID classes in this context is not allowed

Any way we can bend this rule?
-brett


More information about the Bf-committers mailing list