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

Campbell Barton ideasman42 at gmail.com
Sun Jun 12 22:51:21 CEST 2011


Sounds like rna update functions may do what you want:
http://lists.blender.org/pipermail/bf-blender-cvs/2011-June/036463.html

On changing the property an update function can be called in a
non-restricted state.

On Sun, Jun 12, 2011 at 8:50 AM, Hart's Antler <bhartsho at yahoo.com> wrote:
> 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
> _______________________________________________
> Bf-committers mailing list
> Bf-committers at blender.org
> http://lists.blender.org/mailman/listinfo/bf-committers
>



-- 
- Campbell


More information about the Bf-committers mailing list