so imagine you have two objects but they are linked so it is one mesh data block

The following command should make the cubes single users so that the mesh data blocks are not shared but it doesnt do it.


So I am curious how one has to add the value for the object + data:


or how one could call this menu:

enter image description here


1 Answer 1


The default options for bpy.ops.object.make_single_user() are all false so you need to specify at least one True option when you call the operator. When calling an operator directly you can just include the optional values in the call -

bpy.ops.object.make_single_user(type='SELECTED_OBJECTS', object=True, obdata=True)

When using layout.operator() in a panel or menu, you can't pass options this way but there are two methods you can use. When you only have one option to set you can add the property to the operator line -

layout.operator("object.make_single_user", text="Object").object = True

When you need to define multiple options you need to keep the operator item that is created and then adjust it's properties. As shown from the make single user menu -

props = layout.operator("object.make_single_user", text="Object")
props.object = True
props.obdata = props.material = props.texture = props.animation = False

props = layout.operator("object.make_single_user", text="Object & Data")
props.object = props.obdata = True
props.material = props.texture = props.animation = False

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .