ARTICLE AD BOX
I'm trying to revive an old blender add-on for personal use, all fixes were successful so far, but I stumbled upon this error:
for prop in o.id_data.keys(): RuntimeError:IDPropertyGroup changed size during iterationand I don't understand what happens here. The code is supposed to clear a selected mesh from all properties/keys, but it stops since for got shorter and I can't substitute it for anything that works. I can't find what id_data.keys() is or does.
class SIMGEOM_OT_make_morph(bpy.types.Operator): """Give the selected objects data for a Morph GEOM""" bl_idname = "simgeom.make_morph" bl_label = "Make Morph" def execute(self, context): # Selected mesh objects selected = [ o for o in bpy.context.scene.objects if o.select_get() and o.type == 'MESH' ] # Must have 2 or more meshes selected of which one must be the active object if len(selected) == 0: self.report({'ERROR'}, "You must select 1 or more meshes to turn into morphs.") return {'CANCELLED'} n_copied = 0 for o in selected: if o.get('__GEOM_MORPH__') != None: continue # Clear old properties for prop in o.id_data.keys(): del o[prop] o['__GEOM_MORPH__'] = 1 n_copied += 1 self.report({'INFO'}, f"Turned {n_copied} objects into morphs.") return {'FINISHED'}What do I need to change to make it work again?
New contributor
larvacode is a new contributor to this site. Take care in asking for clarification, commenting, and answering. Check out our Code of Conduct.
Explore related questions
See similar questions with these tags.
