Why does my button not show up in the N-Panel UI?

Ive been trying to learn a bit of python with the help of chatgpt. I have written a simple addon where I have one operator mapped to a button and another mapped to a second button on the “N-panel interface.”

The first button appears fine and works as expected however the second does not appear at all. I cannot seem to figure out why…

If someone would be so kind as to inspect the code and give me some insight on whats going on that would be greatly appreciated.
test.py (4.3 KB)

Thanks!

Loading your file into blender’s text editor and executing it gives me the following error message in blender’s console window:

\test.py:80
rna_uiItemO: operator missing srna 'curve.separate_curves'

line 80 of your script:

  op = layout.operator('curve.separate_curves', text="Separate Curves")

line 41 of your script:

class CurveSeparateOperator(bpy.types.Operator):
    """Separate active curve object by loose parts"""
    bl_idname = "curve.separate_curve"
    bl_label = "Separate Curves"
    bl_options = {'REGISTER', 'UNDO'}

See the problem?

bl_idname = “curve.separate_curve”

removing the ‘s’ from ‘curve.separate_curves’ in line 80 fixes the problem

Randy

1 Like

Thanks so much for taking a look. That did the trick!
For whatever reason I wasnt getting that error when I executed the code in blenders script editor.