I'm making a panel with buttons to do different actions for modeling. One one of my button I want to merge vertex by distance when I click on it, but merge to center when I CTRL + Click.
I got this working just fine except that I would like my regular click to show the context panel that shows up when you call with from Vertex -> Merge Vertices -> By Distance where you can adjust the threshold and what not.
I mean this window:
I noticed that when I call the function with
row.operator("mesh.remove_doubles")
the context panel does show up, but when I call it inside invoke to get the event.CTRL it does not show up.
def invoke(self, context, event):
if event.ctrl:
bpy.ops.mesh.merge(type='CENTER')
else:
bpy.ops.mesh.remove_doubles()
return {'FINISHED'}
Any way to run the same method in the invoke ? Thanks!