I have defined a custom EnumProperty
for objects. I want to be able to change the property for all selected objects simultaneously. I tried this:
def set_collider(self, context):
selected_objs = context.selected_objects
collider = context.active_object.ECollider
for obj in selected_objs:
if obj != context.active_object:
obj.ECollider = collider
bpy.types.Object.ECollider = EnumProperty(
items=[('NC', 'None', ''), ('BC', 'Box Collider', ''), ('SC', 'Sphere Collider', '' ), ('CC', 'Capsule Collider', '')], name="Collider", update=set_collider
)
but for some reason blender crashes every time I select multiple objects and change the ECollider
property through the UI panel.
Of course I can always right click on the property and select Copy to Selected but it would be more convenient if I could change the property for all selected objects at once.