Unable to repeat my addon's operator, not sure why. Need help

Hi, I have created an addon which allows you to insert an Edge Loop (or multiple Edge loops) and then automatically apply edge curve to the selected edge loops.

The hotkey is ALT+SHIFT+E.

You select the edge(s) you would like to loop cut, then press the hotkey to run my addon’s main operator.

However, whenever I press “G” to “repeat last” (industry standard keymap preset), it simply does nothing.

I tried adding this to the bottom of my main operator:

bpy.ops.ed.undo_push(message="Edge Curve Plus")

And this seems to insert a history item for my addon, which is nice… but it doesn’t allow me to repeat my addon’s operator. I’m not sure what’s wrong, or where to begin.

Here is a link to my addon for testing:

Here is a link to the github where you can view the python code quickly and also download if you want: https://github.com/Neltulz/Neltulz_Edge_Curve_Plus

Any help would be greatly appreciated! :slight_smile:
Thanks,
-Neil

I’m not an expert, but did you make sure to add the line “bl_options = {‘REGISTER’, ‘UNDO’}” in the class definition of the operator?

Example:

class stlToKitOps(bpy.types.Operator):
	"""batch stl to kitops pro"""
	bl_idname = "object.stltokitops"
	bl_label = "STL to kitops"
	bl_options = {'REGISTER', 'UNDO'}
	def execute(self, context):
		...

That did the trick, thank you! :slight_smile:

1 Like