uiItemMenuEnumO: operator missing srna '(None)

Suddenly my python (…) stopped working and I have no idea why… :eek: Please help.

The error:

uiItemMenuEnumO: operator missing srna ‘(None)’
P.S. Why is s.c.r.i.p.t. a forbidden word on this forum??? could only post this message without it… :ba:

import bpy

COMBOS = {'compositing' : [('none',         'None'),
                           ('blend',        'Blended'),
                           ('test',         'Threshold'),
                           ('additive',     'Additive')],
          'interaction' : [('static',       'Static (won''t move)'),
                           ('none',         'None (ghost)'),
                           ('move',         'Movable by player')],
          'shape'       : [('box',          'Box'),
                           ('sphere',       'Sphere'),
                           ('coneX',        'ConeX'),
                           ('coneY',        'ConeY'),
                           ('coneZ',        'ConeZ'),
                           ('cylinderX',    'CylinderX'),
                           ('cylinderY',    'CylinderY'),
                           ('cylinderZ',    'CylinderZ')],
          'sky_type'    : [('dome',         'Dome'),
                           ('box',          'Box'),
                           ('simple',       'Simple')],
          'graphical_effect':[('none',      'No Effect'),
                              ('water',     'Water')], 
          'condition'   : [('skid',         'When Skidding'),
                           ('drive',        'When Driving')],
          'weather'     : [('none', 'Normal (Sunny)'),
                           ('rain', 'Rainy'),
                           ('snow', 'Snowy')],
          'type'     :  [('',               '(None)'),
                             ('banana',         'Banana'),
                             ('billboard',      'Billboard'),
                             ('check',          'Check'),
                             ('driveline',      'Driveline'),
                             ('ignore',         'Ignore'),
                             ('item',           'Item'),
                             ('lap',            'Lap'),
                             ('maindriveline',  'Main Driveline'),
                             ('nitro_big',      'Nitro (Big)'),
                             ('nitro_small',    'Nitro (Small)'),
                             ('object',         'Object'),
                             ('particle_emitter', 'Particle Emitter'),
                             ('water',          'Water')]
         }


# ==== OPERATORS ====

# == COMBOS ==

for param in COMBOS.keys():
    default_val = PROP_SETTINGS[param][1]
    items_val = []
    for i in COMBOS[param]:
        items_val.append((i[0],i[1],i[1]))
    
    class STK_SetType(bpy.types.Operator):
        bl_idname = ("combo.stk_set_"+param)
        bl_label  = ("STK Object :: set "+param)
        
        value = bpy.props.EnumProperty(attr="values", name="values", default=default_val,
                                       items=items_val)
        
        m_param = param
        m_items_val = items_val
        
        def execute(self, context):
            
            # Set the property
            object = context.object
            object[self.m_param] = self.value
            
            return {'FINISHED'}


        
# ==== PANELS ====

# == Object Panel

class STK_PANEL_Object(bpy.types.Panel):
    bl_label = "SuperTuxKart Properties"
    bl_space_type = "PROPERTIES"
    bl_region_type = "WINDOW"
    bl_context = "object"
    
    def draw(self, context):
        layout = self.layout
 
        obj = context.object

        # ==== Types group ====
        row = layout.row()
        row.label(text="Type")
        
        if "type" in obj:
            objtype = obj["type"]
            row.operator_menu_enum("combo.stk_set_type", property="value", text=objtype)
        else:
            objtype = ""
            row.operator_menu_enum("combo.stk_set_type", property="value", text="(None)")  
        

By a lot of trial and error I isolated the problem: Setting bl_idname :eek: :spin: :eek:

Can somebody how a string addition does not yield a string??? :confused:

This works:

for param in COMBOS.keys():
    
    class STK_SetType(bpy.types.Operator):
        bl_idname = ("combo.stk_set_type")
        bl_label  = ("STK Object :: set %s" % param)

This doesn’t work:

for param in COMBOS.keys():
    
    class STK_SetType(bpy.types.Operator):
        bl_idname = ("combo.stk_set_"<b>+param</b>)
        bl_label  = ("STK Object :: set "+param)

nor does

 aname = "combo.stk_set_%s" % param