How can I change the items of an EnumProperty dynamically through draw? I have those two EnumProperty:
fu3dm_model_gender : bpy.props.EnumProperty(name=&quot;Gender&quot;, description=&quot;Choose model's gender.&quot;, items= [('OP1', &quot;Male&quot;, &quot;&quot;), ('OP2', &quot;Female&quot;, &quot;&quot;)])    
fu3dm_model_head : bpy.props.EnumProperty(name=&quot;Head&quot;, description=&quot;Choose model's head.&quot;, items= [('OP1', &quot;Generic Male&quot;, &quot;&quot;), ('OP2', &quot;Something&quot;, &quot;&quot;)])

And I want to do this:
If fu3dm_model_gender is OP1 then fu3dm_model_head items to be like this items= [('OP1', &quot;Generic Male&quot;, &quot;&quot;), ('OP2', &quot;Something&quot;, &quot;&quot;)]. Else if fu3dm_model_gender is OP2 then fu3dm_model_head items to be like this items= [('OP1', &quot;Generic Female&quot;, &quot;&quot;), ('OP2', &quot;Something Else&quot;, &quot;&quot;)].
Here is my code:
class fu3dm_WM_OT_Model_Prefs_Operator(bpy.types.Operator):
    bl_idname = &quot;wm.fu3dm_model_prefs&quot;
    bl_label = &quot;Model Preferences&quot;
    bl_description = &quot;Sets model's preferences&quot;

    fu3dm_model_gender : bpy.props.EnumProperty(name=&quot;Gender&quot;, description=&quot;Choose model's gender.&quot;, items= [('OP1', &quot;Male&quot;, &quot;&quot;), ('OP2', &quot;Female&quot;, &quot;&quot;)])
    fu3dm_model_head : bpy.props.EnumProperty(name=&quot;Head&quot;, description=&quot;Choose model's head.&quot;, items= [('OP1', &quot;Generic Male&quot;, &quot;&quot;), ('OP2', &quot;Something&quot;, &quot;&quot;)])

    def invoke(self, context, event):
        return context.window_manager.invoke_props_dialog(self)
        bpy.ops.wm.fu3dm_model_prefs('INVOKE_DEFAULT')

    def draw(self, context):
        layout = self.layout
        layout.prop(self, &quot;fu3dm_model_gender&quot;)
        if self.fu3dm_model_gender == 'OP1':
            # Change &quot;fu3dm_model_head&quot; to &quot;Generic Male&quot; and &quot;Something&quot;
        elif self.fu3dm_model_gender == 'OP2':
            # Change &quot;fu3dm_model_head&quot; to &quot;Generic Female&quot; and &quot;Something Else&quot;
        layout.prop(self, &quot;fu3dm_model_head&quot;)

    def execute(self, context):
        pass
        return {&quot;FINISHED&quot;}
Use EnumProperty callback:
Property Definitions (bpy.props) — Blender Python API
Basically blender will call the function in following way:
list_tuple_callback(scene, context)

The return of your function should look similar with the original item List[(identifier, name, description, icon, number), ...].