[Bf-committers] Removing properties with Python API?

whiterabbit at dreamscapearts.com whiterabbit at dreamscapearts.com
Sun May 9 07:05:36 CEST 2010


On 05/08/2010 07:36 PM, Campbell Barton wrote:
> On Sat, May 8, 2010 at 11:10 PM, whiterabbit at dreamscapearts.com
> <whiterabbit at dreamscapearts.com>  wrote:
>    
>> Hi everyone,
>>
>> Hopefully this isn't too far out of context for this mailing list.
>> My render engine script dynamically creates Blender panels and button
>> properties from XML data (assembles classes as text and exec() them).
>> I'm providing an interface to load and unload these XML files which in
>> turn register and unregister panel classes, however I can't seem to
>> figure out a way to remove the properties created for the panels. I
>> considered using dynamic and ID properties but static is the only way to
>> do what I need. My concern is if the user loads and unloads lots of
>> XML's during a single session that this will act like a memory leak (as
>> more unused properties are added).
>> Is there a way to do this or should I just not worry about it?
>>
>> Cheers,
>> Eric Back (WHiTeRaBBiT)
>> _______________________________________________
>> Bf-committers mailing list
>> Bf-committers at blender.org
>> http://lists.blender.org/mailman/listinfo/bf-committers
>>      
> just committed a function to remove a property, this should eventually
> be done automatically with class bpy.types.unregister()
>
> info on how to use in the commit log.
>
>    
Thanks :)

That looks simple enough. Do you think I should integrate 
RemoveProperty() or wait anticipating Blender will do it for me with 
unregister? Also I'm confused as to how unregister() will know which 
properties belong to a particular panel? Does this mean property 
creation will change at some point so unregister() can behave this way? 
Sorry for all the questions :-/

Thanks again,
Eric Back (WHiTeRaBBiT)


More information about the Bf-committers mailing list