1

I am trying to delete properties which some plugin messed up.

I wanted to delete a property PN781673099840471551 with

del bpy.data.scenes["Scene"].PN781673099840471551

but that does not work, (type : bpy_struct)

are these strange properties blender related, they got somehow generated from loading and unloading a plugin. And I am stuck with some values inside my blender file which crash the plugin when loading. Is there anykind of tool to remove unwanted properties?

(What I did: I added somewhere in an plugin (RIB Mosaic) related panel an illegal value, and saved the blend file, and now the value is somehow stuck inside my blend file, so when trying to use the plugin again the plugin raises an exception...)

Gabriel
  • 253
  • 2
  • 7

1 Answers1

1

You can delete that property, the error you get is probably (here recreated):

>>> bpy.types.Scene.ragamuffin = bpy.props.IntProperty(default=1)

>>> bpy.types.Scene.ragamuffin
(<built-in function IntProperty>, {'default': 1, 'attr': 'ragamuffin'})

>>> bpy.data.scenes['Scene'].ragamuffin
1

>>> del bpy.data.scenes['Scene'].ragamuffin
Traceback (most recent call last):
  File "<blender_console>", line 1, in <module>
AttributeError: bpy_struct: del not supported

But there's no guarantee that will make the scene work again.. removal anyway:

>>> del bpy.types.Scene.ragamuffin    # success!
>>> bpy.types.Scene.ragamuffin
Traceback (most recent call last):
  File "<blender_console>", line 1, in <module>
AttributeError: type object 'Scene' has no attribute 'ragamuffin'

I can't for certain say what produced those properties, but it's worth having a look at the source of the plugin. For instance here RIBMosaic implements some unusual (not bad...just not standard bpy style) property registration techniques using exec. meaning you can't easily tell in advance exactly what the properties will be called.

zeffii
  • 39,634
  • 9
  • 103
  • 186
  • Thanks a lot! I am actually improving RIBMoasaic. I found the error: So far the standard hash() function was used to generate some properties for loaded shaders and so on. Becaus hash() is not consistent it turned out to get a real mess in my blender file. This bug and the deletion of all the properties via dir(...) and a regex search for "ribmosaic_*" are now solved :-) – Gabriel May 29 '15 at 02:27