1
$\begingroup$

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...)

$\endgroup$
  • 1
    $\begingroup$ can't you do del bpy.types.Scene.PN781673099840471551 ? $\endgroup$ – zeffii May 28 '15 at 15:03
  • $\begingroup$ what is the value of bpy.data.scenes["Scene"].PN781673099840471551 $\endgroup$ – zeffii May 28 '15 at 15:09
  • $\begingroup$ it worked with del bpy.types.Scene.PN781673099840471551 $\endgroup$ – Gabriel May 28 '15 at 15:13
  • $\begingroup$ what are such values? does blender generate these names automatically under certain circumstances? $\endgroup$ – Gabriel May 28 '15 at 15:13
  • $\begingroup$ I've never seen them before, but addons can store working data in all kinds of ways. (adding explanation to answer below) $\endgroup$ – zeffii May 28 '15 at 15:18
1
$\begingroup$

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.

$\endgroup$
  • $\begingroup$ 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 :-) $\endgroup$ – Gabriel May 29 '15 at 2:27

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.