diff --git a/doc/python_api/sphinx_doc_gen.py b/doc/python_api/sphinx_doc_gen.py index 24e1726cbca..395beff21bb 100644 --- a/doc/python_api/sphinx_doc_gen.py +++ b/doc/python_api/sphinx_doc_gen.py @@ -85,7 +85,7 @@ USE_SHARED_RNA_ENUM_ITEMS_STATIC = True if USE_SHARED_RNA_ENUM_ITEMS_STATIC: from _bpy import rna_enum_items_static rna_enum_dict = rna_enum_items_static() - for key in ("DummyRNA_DEFAULT_items", "DummyRNA_NULL_items"): + for key in ("rna_enum_dummy_NULL_items", "rna_enum_dummy_DEFAULT_items"): del rna_enum_dict[key] del key, rna_enum_items_static @@ -2255,18 +2255,13 @@ def write_rst_enum_items_and_index(basepath): fw(".. toctree::\n") fw("\n") for key, enum_items in rna_enum_dict.items(): - valid_prefix = key.startswith("rna_enum_") or key.startswith("rna_node_") - if not valid_prefix: - raise Exception( - "Found RNA enum identifier that doesn't use the 'rna_enum_' or 'rna_node_' prefix, found %r!" % - key) + if not key.startswith("rna_enum_"): + raise Exception("Found RNA enum identifier that doesn't use the 'rna_enum_' prefix, found %r!" % key) key_no_prefix = key.removeprefix("rna_enum_") - key_no_prefix = key.removeprefix("rna_node_") fw(" %s\n" % key_no_prefix) for key, enum_items in rna_enum_dict.items(): key_no_prefix = key.removeprefix("rna_enum_") - key_no_prefix = key.removeprefix("rna_node_") write_rst_enum_items(basepath_bpy_types_rna_enum, key, key_no_prefix, enum_items) fw("\n") diff --git a/source/blender/editors/animation/anim_markers.cc b/source/blender/editors/animation/anim_markers.cc index 95e4316b5f2..f7db245970e 100644 --- a/source/blender/editors/animation/anim_markers.cc +++ b/source/blender/editors/animation/anim_markers.cc @@ -1802,7 +1802,7 @@ static void MARKER_OT_make_links_scene(wmOperatorType *ot) ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO; /* properties */ - prop = RNA_def_enum(ot->srna, "scene", DummyRNA_NULL_items, 0, "Scene", ""); + prop = RNA_def_enum(ot->srna, "scene", rna_enum_dummy_NULL_items, 0, "Scene", ""); RNA_def_enum_funcs(prop, RNA_scene_itemf); RNA_def_property_flag(prop, PROP_ENUM_NO_TRANSLATE); ot->prop = prop; diff --git a/source/blender/editors/animation/keyframes_general.cc b/source/blender/editors/animation/keyframes_general.cc index d695ec6374e..4af31ba67b3 100644 --- a/source/blender/editors/animation/keyframes_general.cc +++ b/source/blender/editors/animation/keyframes_general.cc @@ -1621,7 +1621,7 @@ const EnumPropertyItem rna_enum_keyframe_paste_offset_items[] = { {0, nullptr, 0, nullptr, nullptr}, }; -const EnumPropertyItem rna_enum_keyframe_paste_offset_value[] = { +const EnumPropertyItem rna_enum_keyframe_paste_offset_value_items[] = { {KEYFRAME_PASTE_VALUE_OFFSET_LEFT_KEY, "LEFT_KEY", 0, diff --git a/source/blender/editors/animation/keyframing.cc b/source/blender/editors/animation/keyframing.cc index 1612fec755a..19c4d7b32d4 100644 --- a/source/blender/editors/animation/keyframing.cc +++ b/source/blender/editors/animation/keyframing.cc @@ -2066,7 +2066,7 @@ void ANIM_OT_keyframe_insert(wmOperatorType *ot) /* keyingset to use (dynamic enum) */ prop = RNA_def_enum( - ot->srna, "type", DummyRNA_DEFAULT_items, 0, "Keying Set", "The Keying Set to use"); + ot->srna, "type", rna_enum_dummy_DEFAULT_items, 0, "Keying Set", "The Keying Set to use"); RNA_def_enum_funcs(prop, ANIM_keying_sets_enum_itemf); RNA_def_property_flag(prop, PROP_HIDDEN); ot->prop = prop; @@ -2180,7 +2180,7 @@ void ANIM_OT_keyframe_insert_menu(wmOperatorType *ot) /* keyingset to use (dynamic enum) */ prop = RNA_def_enum( - ot->srna, "type", DummyRNA_DEFAULT_items, 0, "Keying Set", "The Keying Set to use"); + ot->srna, "type", rna_enum_dummy_DEFAULT_items, 0, "Keying Set", "The Keying Set to use"); RNA_def_enum_funcs(prop, ANIM_keying_sets_enum_itemf); RNA_def_property_flag(prop, PROP_HIDDEN); ot->prop = prop; @@ -2265,7 +2265,7 @@ void ANIM_OT_keyframe_delete(wmOperatorType *ot) /* keyingset to use (dynamic enum) */ prop = RNA_def_enum( - ot->srna, "type", DummyRNA_DEFAULT_items, 0, "Keying Set", "The Keying Set to use"); + ot->srna, "type", rna_enum_dummy_DEFAULT_items, 0, "Keying Set", "The Keying Set to use"); RNA_def_enum_funcs(prop, ANIM_keying_sets_enum_itemf); RNA_def_property_flag(prop, PROP_HIDDEN); ot->prop = prop; diff --git a/source/blender/editors/animation/keyingsets.cc b/source/blender/editors/animation/keyingsets.cc index 45503acf2a6..0e1d6de0354 100644 --- a/source/blender/editors/animation/keyingsets.cc +++ b/source/blender/editors/animation/keyingsets.cc @@ -503,7 +503,7 @@ void ANIM_OT_keying_set_active_set(wmOperatorType *ot) /* keyingset to use (dynamic enum) */ prop = RNA_def_enum( - ot->srna, "type", DummyRNA_DEFAULT_items, 0, "Keying Set", "The Keying Set to use"); + ot->srna, "type", rna_enum_dummy_DEFAULT_items, 0, "Keying Set", "The Keying Set to use"); RNA_def_enum_funcs(prop, ANIM_keying_sets_enum_itemf); // RNA_def_property_flag(prop, PROP_HIDDEN); } @@ -792,7 +792,7 @@ const EnumPropertyItem *ANIM_keying_sets_enum_itemf(bContext *C, int i = 0; if (C == nullptr) { - return DummyRNA_DEFAULT_items; + return rna_enum_dummy_DEFAULT_items; } /* active Keying Set diff --git a/source/blender/editors/curve/editcurve.cc b/source/blender/editors/curve/editcurve.cc index 14368b2ef2c..d59a7d1259c 100644 --- a/source/blender/editors/curve/editcurve.cc +++ b/source/blender/editors/curve/editcurve.cc @@ -5796,7 +5796,7 @@ void CURVE_OT_extrude(wmOperatorType *ot) ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO; /* to give to transform */ - RNA_def_enum(ot->srna, "mode", rna_enum_transform_mode_types, TFM_TRANSLATION, "Mode", ""); + RNA_def_enum(ot->srna, "mode", rna_enum_transform_mode_type_items, TFM_TRANSLATION, "Mode", ""); } /** \} */ diff --git a/source/blender/editors/geometry/geometry_attributes.cc b/source/blender/editors/geometry/geometry_attributes.cc index eec1fb24719..6770c80edda 100644 --- a/source/blender/editors/geometry/geometry_attributes.cc +++ b/source/blender/editors/geometry/geometry_attributes.cc @@ -74,12 +74,12 @@ static const EnumPropertyItem *geometry_attribute_domain_itemf(bContext *C, bool *r_free) { if (C == nullptr) { - return DummyRNA_NULL_items; + return rna_enum_dummy_NULL_items; } Object *ob = ED_object_context(C); if (ob == nullptr) { - return DummyRNA_NULL_items; + return rna_enum_dummy_NULL_items; } return rna_enum_attribute_domain_itemf(static_cast(ob->data), false, r_free); diff --git a/source/blender/editors/gpencil_legacy/gpencil_armature.cc b/source/blender/editors/gpencil_legacy/gpencil_armature.cc index 6a64626a90a..cece5b34e70 100644 --- a/source/blender/editors/gpencil_legacy/gpencil_armature.cc +++ b/source/blender/editors/gpencil_legacy/gpencil_armature.cc @@ -631,7 +631,7 @@ static const EnumPropertyItem *gpencil_armatures_enum_itemf(bContext *C, int i = 0; if (C == nullptr) { - return DummyRNA_DEFAULT_items; + return rna_enum_dummy_DEFAULT_items; } /* add default */ @@ -682,7 +682,7 @@ void GPENCIL_OT_generate_weights(wmOperatorType *ot) ot->prop = RNA_def_enum(ot->srna, "mode", mode_type, 0, "Mode", ""); prop = RNA_def_enum( - ot->srna, "armature", DummyRNA_DEFAULT_items, 0, "Armature", "Armature to use"); + ot->srna, "armature", rna_enum_dummy_DEFAULT_items, 0, "Armature", "Armature to use"); RNA_def_enum_funcs(prop, gpencil_armatures_enum_itemf); RNA_def_float(ot->srna, diff --git a/source/blender/editors/gpencil_legacy/gpencil_data.cc b/source/blender/editors/gpencil_legacy/gpencil_data.cc index 292e25b7b14..03315b4611e 100644 --- a/source/blender/editors/gpencil_legacy/gpencil_data.cc +++ b/source/blender/editors/gpencil_legacy/gpencil_data.cc @@ -1532,7 +1532,8 @@ void GPENCIL_OT_layer_change(wmOperatorType *ot) ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO; /* gp layer to use (dynamic enum) */ - ot->prop = RNA_def_enum(ot->srna, "layer", DummyRNA_DEFAULT_items, 0, "Grease Pencil Layer", ""); + ot->prop = RNA_def_enum( + ot->srna, "layer", rna_enum_dummy_DEFAULT_items, 0, "Grease Pencil Layer", ""); RNA_def_enum_funcs(ot->prop, ED_gpencil_layers_with_new_enum_itemf); } @@ -3618,7 +3619,7 @@ void GPENCIL_OT_material_set(wmOperatorType *ot) ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO; /* Material to use (dynamic enum) */ - ot->prop = RNA_def_enum(ot->srna, "slot", DummyRNA_DEFAULT_items, 0, "Material Slot", ""); + ot->prop = RNA_def_enum(ot->srna, "slot", rna_enum_dummy_DEFAULT_items, 0, "Material Slot", ""); RNA_def_enum_funcs(ot->prop, ED_gpencil_material_enum_itemf); } diff --git a/source/blender/editors/gpencil_legacy/gpencil_utils.cc b/source/blender/editors/gpencil_legacy/gpencil_utils.cc index 9ec53aede13..6b71e498631 100644 --- a/source/blender/editors/gpencil_legacy/gpencil_utils.cc +++ b/source/blender/editors/gpencil_legacy/gpencil_utils.cc @@ -350,7 +350,7 @@ const EnumPropertyItem *ED_gpencil_layers_enum_itemf(bContext *C, int i = 0; if (ELEM(nullptr, C, gpd)) { - return DummyRNA_DEFAULT_items; + return rna_enum_dummy_DEFAULT_items; } /* Existing layers */ @@ -387,7 +387,7 @@ const EnumPropertyItem *ED_gpencil_layers_with_new_enum_itemf(bContext *C, int i = 0; if (ELEM(nullptr, C, gpd)) { - return DummyRNA_DEFAULT_items; + return rna_enum_dummy_DEFAULT_items; } /* Create new layer */ @@ -438,7 +438,7 @@ const EnumPropertyItem *ED_gpencil_material_enum_itemf(bContext *C, int i = 0; if (ELEM(nullptr, C, ob)) { - return DummyRNA_DEFAULT_items; + return rna_enum_dummy_DEFAULT_items; } /* Existing materials */ diff --git a/source/blender/editors/mesh/editmesh_tools.cc b/source/blender/editors/mesh/editmesh_tools.cc index fd80e7678eb..261860d2695 100644 --- a/source/blender/editors/mesh/editmesh_tools.cc +++ b/source/blender/editors/mesh/editmesh_tools.cc @@ -4000,7 +4000,7 @@ void MESH_OT_blend_from_shape(wmOperatorType *ot) /* properties */ prop = RNA_def_enum( - ot->srna, "shape", DummyRNA_NULL_items, 0, "Shape", "Shape key to use for blending"); + ot->srna, "shape", rna_enum_dummy_NULL_items, 0, "Shape", "Shape key to use for blending"); RNA_def_enum_funcs(prop, shape_itemf); RNA_def_property_flag(prop, PropertyFlag(PROP_ENUM_NO_TRANSLATE | PROP_NEVER_UNLINK)); RNA_def_float(ot->srna, "blend", 1.0f, -1e3f, 1e3f, "Blend", "Blending factor", -2.0f, 2.0f); diff --git a/source/blender/editors/object/object_add.cc b/source/blender/editors/object/object_add.cc index c861062b069..565187d3dff 100644 --- a/source/blender/editors/object/object_add.cc +++ b/source/blender/editors/object/object_add.cc @@ -1903,7 +1903,7 @@ void OBJECT_OT_collection_instance_add(wmOperatorType *ot) /* properties */ RNA_def_string( ot->srna, "name", "Collection", MAX_ID_NAME - 2, "Name", "Collection name to add"); - prop = RNA_def_enum(ot->srna, "collection", DummyRNA_NULL_items, 0, "Collection", ""); + prop = RNA_def_enum(ot->srna, "collection", rna_enum_dummy_NULL_items, 0, "Collection", ""); RNA_def_enum_funcs(prop, RNA_collection_itemf); RNA_def_property_flag(prop, PROP_ENUM_NO_TRANSLATE); ot->prop = prop; @@ -2020,7 +2020,7 @@ void OBJECT_OT_collection_external_asset_drop(wmOperatorType *ot) object_add_drop_xy_props(ot); - prop = RNA_def_enum(ot->srna, "collection", DummyRNA_NULL_items, 0, "Collection", ""); + prop = RNA_def_enum(ot->srna, "collection", rna_enum_dummy_NULL_items, 0, "Collection", ""); RNA_def_enum_funcs(prop, RNA_collection_itemf); RNA_def_property_flag(prop, (PropertyFlag)(PROP_SKIP_SAVE | PROP_HIDDEN | PROP_ENUM_NO_TRANSLATE)); @@ -4030,7 +4030,7 @@ void OBJECT_OT_duplicate(wmOperatorType *ot) RNA_def_property_flag(prop, PROP_SKIP_SAVE); prop = RNA_def_enum( - ot->srna, "mode", rna_enum_transform_mode_types, TFM_TRANSLATION, "Mode", ""); + ot->srna, "mode", rna_enum_transform_mode_type_items, TFM_TRANSLATION, "Mode", ""); RNA_def_property_flag(prop, PROP_HIDDEN); } diff --git a/source/blender/editors/object/object_collection.cc b/source/blender/editors/object/object_collection.cc index 6cba146fcba..6e207785999 100644 --- a/source/blender/editors/object/object_collection.cc +++ b/source/blender/editors/object/object_collection.cc @@ -56,7 +56,7 @@ static const EnumPropertyItem *collection_object_active_itemf(bContext *C, int totitem = 0; if (C == nullptr) { - return DummyRNA_NULL_items; + return rna_enum_dummy_NULL_items; } ob = ED_object_context(C); @@ -190,7 +190,7 @@ void COLLECTION_OT_objects_add_active(wmOperatorType *ot) /* properties */ prop = RNA_def_enum(ot->srna, "collection", - DummyRNA_NULL_items, + rna_enum_dummy_NULL_items, 0, "Collection", "The collection to add other selected objects to"); @@ -264,7 +264,7 @@ void COLLECTION_OT_objects_remove_active(wmOperatorType *ot) /* properties */ prop = RNA_def_enum(ot->srna, "collection", - DummyRNA_NULL_items, + rna_enum_dummy_NULL_items, 0, "Collection", "The collection to remove other selected objects from"); @@ -366,7 +366,7 @@ void COLLECTION_OT_objects_remove(wmOperatorType *ot) /* properties */ prop = RNA_def_enum(ot->srna, "collection", - DummyRNA_NULL_items, + rna_enum_dummy_NULL_items, 0, "Collection", "The collection to remove this object from"); @@ -524,7 +524,7 @@ void OBJECT_OT_collection_link(wmOperatorType *ot) ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO; /* properties */ - prop = RNA_def_enum(ot->srna, "collection", DummyRNA_NULL_items, 0, "Collection", ""); + prop = RNA_def_enum(ot->srna, "collection", rna_enum_dummy_NULL_items, 0, "Collection", ""); RNA_def_enum_funcs(prop, RNA_collection_local_itemf); RNA_def_property_flag(prop, PROP_ENUM_NO_TRANSLATE); ot->prop = prop; diff --git a/source/blender/editors/object/object_constraint.cc b/source/blender/editors/object/object_constraint.cc index 63fee35343b..8617f13d226 100644 --- a/source/blender/editors/object/object_constraint.cc +++ b/source/blender/editors/object/object_constraint.cc @@ -2546,7 +2546,7 @@ void OBJECT_OT_constraint_add(wmOperatorType *ot) ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO; /* properties */ - prop = RNA_def_enum(ot->srna, "type", DummyRNA_NULL_items, 0, "Type", ""); + prop = RNA_def_enum(ot->srna, "type", rna_enum_dummy_NULL_items, 0, "Type", ""); RNA_def_enum_funcs(prop, object_constraint_add_itemf); ot->prop = prop; } @@ -2577,7 +2577,7 @@ void OBJECT_OT_constraint_add_with_targets(wmOperatorType *ot) ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO; /* properties */ - prop = RNA_def_enum(ot->srna, "type", DummyRNA_NULL_items, 0, "Type", ""); + prop = RNA_def_enum(ot->srna, "type", rna_enum_dummy_NULL_items, 0, "Type", ""); RNA_def_enum_funcs(prop, object_constraint_add_itemf); ot->prop = prop; } diff --git a/source/blender/editors/object/object_hook.cc b/source/blender/editors/object/object_hook.cc index 3f22217e61a..34b08155f6a 100644 --- a/source/blender/editors/object/object_hook.cc +++ b/source/blender/editors/object/object_hook.cc @@ -733,7 +733,7 @@ static const EnumPropertyItem *hook_mod_itemf(bContext *C, int a, totitem = 0; if (!ob) { - return DummyRNA_NULL_items; + return rna_enum_dummy_NULL_items; } for (a = 0, md = static_cast(ob->modifiers.first); md; md = md->next, a++) { @@ -773,7 +773,7 @@ void OBJECT_OT_hook_remove(wmOperatorType *ot) /* properties */ prop = RNA_def_enum( - ot->srna, "modifier", DummyRNA_NULL_items, 0, "Modifier", "Modifier number to remove"); + ot->srna, "modifier", rna_enum_dummy_NULL_items, 0, "Modifier", "Modifier number to remove"); RNA_def_enum_funcs(prop, hook_mod_itemf); RNA_def_property_flag(prop, PROP_ENUM_NO_TRANSLATE); ot->prop = prop; @@ -817,8 +817,12 @@ void OBJECT_OT_hook_reset(wmOperatorType *ot) ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO; /* properties */ - prop = RNA_def_enum( - ot->srna, "modifier", DummyRNA_NULL_items, 0, "Modifier", "Modifier number to assign to"); + prop = RNA_def_enum(ot->srna, + "modifier", + rna_enum_dummy_NULL_items, + 0, + "Modifier", + "Modifier number to assign to"); RNA_def_enum_funcs(prop, hook_mod_itemf); RNA_def_property_flag(prop, PROP_ENUM_NO_TRANSLATE); } @@ -868,8 +872,12 @@ void OBJECT_OT_hook_recenter(wmOperatorType *ot) ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO; /* properties */ - prop = RNA_def_enum( - ot->srna, "modifier", DummyRNA_NULL_items, 0, "Modifier", "Modifier number to assign to"); + prop = RNA_def_enum(ot->srna, + "modifier", + rna_enum_dummy_NULL_items, + 0, + "Modifier", + "Modifier number to assign to"); RNA_def_enum_funcs(prop, hook_mod_itemf); RNA_def_property_flag(prop, PROP_ENUM_NO_TRANSLATE); } @@ -931,8 +939,12 @@ void OBJECT_OT_hook_assign(wmOperatorType *ot) ot->flag = /*OPTYPE_REGISTER|*/ OPTYPE_UNDO; /* properties */ - prop = RNA_def_enum( - ot->srna, "modifier", DummyRNA_NULL_items, 0, "Modifier", "Modifier number to assign to"); + prop = RNA_def_enum(ot->srna, + "modifier", + rna_enum_dummy_NULL_items, + 0, + "Modifier", + "Modifier number to assign to"); RNA_def_enum_funcs(prop, hook_mod_itemf); RNA_def_property_flag(prop, PROP_ENUM_NO_TRANSLATE); } @@ -977,7 +989,7 @@ void OBJECT_OT_hook_select(wmOperatorType *ot) /* properties */ prop = RNA_def_enum( - ot->srna, "modifier", DummyRNA_NULL_items, 0, "Modifier", "Modifier number to remove"); + ot->srna, "modifier", rna_enum_dummy_NULL_items, 0, "Modifier", "Modifier number to remove"); RNA_def_enum_funcs(prop, hook_mod_itemf); RNA_def_property_flag(prop, PROP_ENUM_NO_TRANSLATE); } diff --git a/source/blender/editors/object/object_relations.cc b/source/blender/editors/object/object_relations.cc index 24732409c7f..92fe5a661ac 100644 --- a/source/blender/editors/object/object_relations.cc +++ b/source/blender/editors/object/object_relations.cc @@ -1655,7 +1655,7 @@ void OBJECT_OT_make_links_scene(wmOperatorType *ot) ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO; /* properties */ - prop = RNA_def_enum(ot->srna, "scene", DummyRNA_NULL_items, 0, "Scene", ""); + prop = RNA_def_enum(ot->srna, "scene", rna_enum_dummy_NULL_items, 0, "Scene", ""); RNA_def_enum_funcs(prop, RNA_scene_local_itemf); RNA_def_property_flag(prop, PROP_ENUM_NO_TRANSLATE); ot->prop = prop; diff --git a/source/blender/editors/object/object_vgroup.cc b/source/blender/editors/object/object_vgroup.cc index a13de47b151..e31e5a3d8fd 100644 --- a/source/blender/editors/object/object_vgroup.cc +++ b/source/blender/editors/object/object_vgroup.cc @@ -789,7 +789,7 @@ static void vgroup_operator_subset_select_props(wmOperatorType *ot, bool use_act prop = RNA_def_enum(ot->srna, "group_select_mode", - DummyRNA_NULL_items, + rna_enum_dummy_NULL_items, use_active ? WT_VGROUP_ACTIVE : WT_VGROUP_ALL, "Subset", "Define which subset of groups shall be used"); @@ -3500,7 +3500,7 @@ static const EnumPropertyItem *vgroup_itemf(bContext *C, bool *r_free) { if (C == nullptr) { - return DummyRNA_NULL_items; + return rna_enum_dummy_NULL_items; } Object *ob = ED_object_context(C); @@ -3510,7 +3510,7 @@ static const EnumPropertyItem *vgroup_itemf(bContext *C, int a, totitem = 0; if (!ob) { - return DummyRNA_NULL_items; + return rna_enum_dummy_NULL_items; } const ListBase *defbase = BKE_object_defgroup_list(ob); @@ -3547,7 +3547,7 @@ void OBJECT_OT_vertex_group_set_active(wmOperatorType *ot) /* properties */ prop = RNA_def_enum( - ot->srna, "group", DummyRNA_NULL_items, 0, "Group", "Vertex group to set as active"); + ot->srna, "group", rna_enum_dummy_NULL_items, 0, "Group", "Vertex group to set as active"); RNA_def_enum_funcs(prop, vgroup_itemf); RNA_def_property_flag(prop, PROP_ENUM_NO_TRANSLATE); ot->prop = prop; diff --git a/source/blender/editors/physics/rigidbody_object.cc b/source/blender/editors/physics/rigidbody_object.cc index 39924ef380b..df74c8728c5 100644 --- a/source/blender/editors/physics/rigidbody_object.cc +++ b/source/blender/editors/physics/rigidbody_object.cc @@ -556,7 +556,7 @@ void RIGIDBODY_OT_mass_calculate(wmOperatorType *ot) ot->prop = prop = RNA_def_enum( ot->srna, "material", - DummyRNA_DEFAULT_items, + rna_enum_dummy_DEFAULT_items, 0, "Material Preset", "Type of material that objects are made of (determines material density)"); diff --git a/source/blender/editors/sculpt_paint/paint_image_proj.cc b/source/blender/editors/sculpt_paint/paint_image_proj.cc index ff5f635e1e5..7dd6f55b86b 100644 --- a/source/blender/editors/sculpt_paint/paint_image_proj.cc +++ b/source/blender/editors/sculpt_paint/paint_image_proj.cc @@ -6238,7 +6238,7 @@ void PAINT_OT_project_image(wmOperatorType *ot) /* flags */ ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO; - prop = RNA_def_enum(ot->srna, "image", DummyRNA_NULL_items, 0, "Image", ""); + prop = RNA_def_enum(ot->srna, "image", rna_enum_dummy_NULL_items, 0, "Image", ""); RNA_def_enum_funcs(prop, RNA_image_itemf); RNA_def_property_flag(prop, PROP_ENUM_NO_TRANSLATE); ot->prop = prop; diff --git a/source/blender/editors/space_graph/graph_edit.cc b/source/blender/editors/space_graph/graph_edit.cc index 9c818b44f2a..c7ba391b9c3 100644 --- a/source/blender/editors/space_graph/graph_edit.cc +++ b/source/blender/editors/space_graph/graph_edit.cc @@ -647,7 +647,7 @@ void GRAPH_OT_paste(wmOperatorType *ot) "Paste time offset of keys"); RNA_def_enum(ot->srna, "value_offset", - rna_enum_keyframe_paste_offset_value, + rna_enum_keyframe_paste_offset_value_items, KEYFRAME_PASTE_VALUE_OFFSET_NONE, "Value Offset", "Paste keys with a value offset"); @@ -730,7 +730,7 @@ void GRAPH_OT_duplicate(wmOperatorType *ot) ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO; /* To give to transform. */ - RNA_def_enum(ot->srna, "mode", rna_enum_transform_mode_types, TFM_TRANSLATION, "Mode", ""); + RNA_def_enum(ot->srna, "mode", rna_enum_transform_mode_type_items, TFM_TRANSLATION, "Mode", ""); } /** \} */ diff --git a/source/blender/editors/space_nla/nla_edit.cc b/source/blender/editors/space_nla/nla_edit.cc index 3acd558b16c..3da110504ca 100644 --- a/source/blender/editors/space_nla/nla_edit.cc +++ b/source/blender/editors/space_nla/nla_edit.cc @@ -752,7 +752,7 @@ void NLA_OT_actionclip_add(wmOperatorType *ot) /* props */ /* TODO: this would be nicer as an ID-pointer. */ - prop = RNA_def_enum(ot->srna, "action", DummyRNA_NULL_items, 0, "Action", ""); + prop = RNA_def_enum(ot->srna, "action", rna_enum_dummy_NULL_items, 0, "Action", ""); RNA_def_enum_funcs(prop, RNA_action_itemf); RNA_def_property_flag(prop, PROP_ENUM_NO_TRANSLATE); ot->prop = prop; diff --git a/source/blender/editors/space_node/node_add.cc b/source/blender/editors/space_node/node_add.cc index 5c7be0cffdc..019b7368f5e 100644 --- a/source/blender/editors/space_node/node_add.cc +++ b/source/blender/editors/space_node/node_add.cc @@ -931,7 +931,7 @@ void NODE_OT_new_node_tree(wmOperatorType *ot) /* flags */ ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO; - prop = RNA_def_enum(ot->srna, "type", DummyRNA_NULL_items, 0, "Tree Type", ""); + prop = RNA_def_enum(ot->srna, "type", rna_enum_dummy_NULL_items, 0, "Tree Type", ""); RNA_def_enum_funcs(prop, new_node_tree_type_itemf); RNA_def_string(ot->srna, "name", "NodeTree", MAX_ID_NAME - 2, "Name", ""); } diff --git a/source/blender/editors/space_node/node_edit.cc b/source/blender/editors/space_node/node_edit.cc index 456b40e31ee..7d18fc288ea 100644 --- a/source/blender/editors/space_node/node_edit.cc +++ b/source/blender/editors/space_node/node_edit.cc @@ -2409,12 +2409,12 @@ static const EnumPropertyItem *socket_change_type_itemf(bContext *C, bool *r_free) { if (!C) { - return DummyRNA_NULL_items; + return rna_enum_dummy_NULL_items; } SpaceNode *snode = CTX_wm_space_node(C); if (!snode || !snode->edittree) { - return DummyRNA_NULL_items; + return rna_enum_dummy_NULL_items; } return rna_node_socket_type_itemf(snode->edittree->typeinfo, socket_change_poll_type, r_free); @@ -2438,7 +2438,7 @@ void NODE_OT_tree_socket_change_type(wmOperatorType *ot) ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO; RNA_def_enum(ot->srna, "in_out", rna_enum_node_socket_in_out_items, SOCK_IN, "Socket Type", ""); - prop = RNA_def_enum(ot->srna, "socket_type", DummyRNA_DEFAULT_items, 0, "Socket Type", ""); + prop = RNA_def_enum(ot->srna, "socket_type", rna_enum_dummy_DEFAULT_items, 0, "Socket Type", ""); RNA_def_enum_funcs(prop, socket_change_type_itemf); ot->prop = prop; } @@ -2524,23 +2524,23 @@ static const EnumPropertyItem *socket_change_subtype_itemf(bContext *C, bool *r_free) { if (!C) { - return DummyRNA_NULL_items; + return rna_enum_dummy_NULL_items; } SpaceNode *snode = CTX_wm_space_node(C); if (!snode || !snode->edittree) { - return DummyRNA_NULL_items; + return rna_enum_dummy_NULL_items; } PointerRNA active_socket_ptr = CTX_data_pointer_get_type( C, "interface_socket", &RNA_NodeSocketInterface); const bNodeSocket *active_socket = static_cast(active_socket_ptr.data); if (!active_socket) { - return DummyRNA_NULL_items; + return rna_enum_dummy_NULL_items; } const Set subtypes = socket_type_get_subtypes(eNodeSocketDatatype(active_socket->type)); if (subtypes.is_empty()) { - return DummyRNA_NULL_items; + return rna_enum_dummy_NULL_items; } EnumPropertyItem *items = nullptr; @@ -2553,7 +2553,7 @@ static const EnumPropertyItem *socket_change_subtype_itemf(bContext *C, } if (items_count == 0) { - return DummyRNA_NULL_items; + return rna_enum_dummy_NULL_items; } RNA_enum_item_end(&items, &items_count); @@ -2588,7 +2588,7 @@ void NODE_OT_tree_socket_change_subtype(wmOperatorType *ot) ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO; ot->prop = RNA_def_enum( - ot->srna, "socket_subtype", DummyRNA_DEFAULT_items, 0, "Socket Subtype", ""); + ot->srna, "socket_subtype", rna_enum_dummy_DEFAULT_items, 0, "Socket Subtype", ""); RNA_def_enum_funcs(ot->prop, socket_change_subtype_itemf); } diff --git a/source/blender/editors/space_outliner/outliner_edit.cc b/source/blender/editors/space_outliner/outliner_edit.cc index a9e91eeff0e..a5c8c378a0a 100644 --- a/source/blender/editors/space_outliner/outliner_edit.cc +++ b/source/blender/editors/space_outliner/outliner_edit.cc @@ -701,7 +701,7 @@ static const EnumPropertyItem *outliner_id_itemf(bContext *C, bool *r_free) { if (C == nullptr) { - return DummyRNA_NULL_items; + return rna_enum_dummy_NULL_items; } EnumPropertyItem item_tmp = {0}, *item = nullptr; @@ -745,13 +745,14 @@ void OUTLINER_OT_id_remap(wmOperatorType *ot) */ RNA_def_property_flag(prop, PROP_HIDDEN); - prop = RNA_def_enum(ot->srna, "old_id", DummyRNA_NULL_items, 0, "Old ID", "Old ID to replace"); + prop = RNA_def_enum( + ot->srna, "old_id", rna_enum_dummy_NULL_items, 0, "Old ID", "Old ID to replace"); RNA_def_property_enum_funcs_runtime(prop, nullptr, nullptr, outliner_id_itemf); RNA_def_property_flag(prop, (PropertyFlag)(PROP_ENUM_NO_TRANSLATE | PROP_HIDDEN)); ot->prop = RNA_def_enum(ot->srna, "new_id", - DummyRNA_NULL_items, + rna_enum_dummy_NULL_items, 0, "New ID", "New ID to remap all selected IDs' users to"); diff --git a/source/blender/editors/space_outliner/outliner_tools.cc b/source/blender/editors/space_outliner/outliner_tools.cc index 56db6b44ecc..4897d1741d7 100644 --- a/source/blender/editors/space_outliner/outliner_tools.cc +++ b/source/blender/editors/space_outliner/outliner_tools.cc @@ -3268,7 +3268,7 @@ void OUTLINER_OT_action_set(wmOperatorType *ot) /* props */ /* TODO: this would be nicer as an ID-pointer... */ - prop = RNA_def_enum(ot->srna, "action", DummyRNA_NULL_items, 0, "Action", ""); + prop = RNA_def_enum(ot->srna, "action", rna_enum_dummy_NULL_items, 0, "Action", ""); RNA_def_enum_funcs(prop, RNA_action_itemf); RNA_def_property_flag(prop, PROP_ENUM_NO_TRANSLATE); ot->prop = prop; @@ -3581,17 +3581,17 @@ static const EnumPropertyItem *outliner_data_op_sets_enum_item_fn(bContext *C, { /* Check for invalid states. */ if (C == nullptr) { - return DummyRNA_DEFAULT_items; + return rna_enum_dummy_DEFAULT_items; } SpaceOutliner *space_outliner = CTX_wm_space_outliner(C); if (space_outliner == nullptr) { - return DummyRNA_DEFAULT_items; + return rna_enum_dummy_DEFAULT_items; } TreeElement *te = get_target_element(space_outliner); if (te == nullptr) { - return DummyRNA_NULL_items; + return rna_enum_dummy_NULL_items; } TreeStoreElem *tselem = TREESTORE(te); @@ -3627,7 +3627,7 @@ void OUTLINER_OT_data_operation(wmOperatorType *ot) ot->flag = 0; - ot->prop = RNA_def_enum(ot->srna, "type", DummyRNA_DEFAULT_items, 0, "Data Operation", ""); + ot->prop = RNA_def_enum(ot->srna, "type", rna_enum_dummy_DEFAULT_items, 0, "Data Operation", ""); RNA_def_enum_funcs(ot->prop, outliner_data_op_sets_enum_item_fn); } diff --git a/source/blender/editors/space_sequencer/sequencer_add.cc b/source/blender/editors/space_sequencer/sequencer_add.cc index 2eee94a85d0..513e84329f7 100644 --- a/source/blender/editors/space_sequencer/sequencer_add.cc +++ b/source/blender/editors/space_sequencer/sequencer_add.cc @@ -484,7 +484,7 @@ void SEQUENCER_OT_scene_strip_add(wmOperatorType *ot) ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO; sequencer_generic_props__internal(ot, SEQPROP_STARTFRAME); - prop = RNA_def_enum(ot->srna, "scene", DummyRNA_NULL_items, 0, "Scene", ""); + prop = RNA_def_enum(ot->srna, "scene", rna_enum_dummy_NULL_items, 0, "Scene", ""); RNA_def_enum_funcs(prop, RNA_scene_without_active_itemf); RNA_def_property_flag(prop, PROP_ENUM_NO_TRANSLATE); ot->prop = prop; @@ -667,7 +667,7 @@ void SEQUENCER_OT_movieclip_strip_add(wmOperatorType *ot) ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO; sequencer_generic_props__internal(ot, SEQPROP_STARTFRAME); - prop = RNA_def_enum(ot->srna, "clip", DummyRNA_NULL_items, 0, "Clip", ""); + prop = RNA_def_enum(ot->srna, "clip", rna_enum_dummy_NULL_items, 0, "Clip", ""); RNA_def_enum_funcs(prop, RNA_movieclip_itemf); RNA_def_property_translation_context(prop, BLT_I18NCONTEXT_ID_MOVIECLIP); RNA_def_property_flag(prop, PROP_ENUM_NO_TRANSLATE); @@ -731,7 +731,7 @@ void SEQUENCER_OT_mask_strip_add(wmOperatorType *ot) ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO; sequencer_generic_props__internal(ot, SEQPROP_STARTFRAME); - prop = RNA_def_enum(ot->srna, "mask", DummyRNA_NULL_items, 0, "Mask", ""); + prop = RNA_def_enum(ot->srna, "mask", rna_enum_dummy_NULL_items, 0, "Mask", ""); RNA_def_enum_funcs(prop, RNA_mask_itemf); RNA_def_property_flag(prop, PROP_ENUM_NO_TRANSLATE); ot->prop = prop; diff --git a/source/blender/editors/space_sequencer/sequencer_edit.cc b/source/blender/editors/space_sequencer/sequencer_edit.cc index 1d8146bc91d..3427c865ed1 100644 --- a/source/blender/editors/space_sequencer/sequencer_edit.cc +++ b/source/blender/editors/space_sequencer/sequencer_edit.cc @@ -3122,7 +3122,7 @@ void SEQUENCER_OT_change_scene(wmOperatorType *ot) ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO; /* Properties. */ - prop = RNA_def_enum(ot->srna, "scene", DummyRNA_NULL_items, 0, "Scene", ""); + prop = RNA_def_enum(ot->srna, "scene", rna_enum_dummy_NULL_items, 0, "Scene", ""); RNA_def_enum_funcs(prop, RNA_scene_without_active_itemf); RNA_def_property_flag(prop, PROP_ENUM_NO_TRANSLATE); ot->prop = prop; diff --git a/source/blender/editors/space_view3d/view3d_select.cc b/source/blender/editors/space_view3d/view3d_select.cc index 6b1a8253c41..98c3199c3b8 100644 --- a/source/blender/editors/space_view3d/view3d_select.cc +++ b/source/blender/editors/space_view3d/view3d_select.cc @@ -1532,7 +1532,7 @@ static const EnumPropertyItem *object_select_menu_enum_itemf(bContext *C, /* Don't need context but avoid API doc-generation using this. */ if (C == nullptr || object_mouse_select_menu_data[i].idname[0] == '\0') { - return DummyRNA_NULL_items; + return rna_enum_dummy_NULL_items; } for (; i < SEL_MENU_SIZE && object_mouse_select_menu_data[i].idname[0] != '\0'; i++) { @@ -1644,7 +1644,7 @@ void VIEW3D_OT_select_menu(wmOperatorType *ot) ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO; /* #Object.id.name to select (dynamic enum). */ - prop = RNA_def_enum(ot->srna, "name", DummyRNA_NULL_items, 0, "Object Name", ""); + prop = RNA_def_enum(ot->srna, "name", rna_enum_dummy_NULL_items, 0, "Object Name", ""); RNA_def_enum_funcs(prop, object_select_menu_enum_itemf); RNA_def_property_flag(prop, (PropertyFlag)(PROP_HIDDEN | PROP_ENUM_NO_TRANSLATE)); ot->prop = prop; @@ -1859,7 +1859,7 @@ void VIEW3D_OT_bone_select_menu(wmOperatorType *ot) ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO; /* #Object.id.name to select (dynamic enum). */ - prop = RNA_def_enum(ot->srna, "name", DummyRNA_NULL_items, 0, "Bone Name", ""); + prop = RNA_def_enum(ot->srna, "name", rna_enum_dummy_NULL_items, 0, "Bone Name", ""); RNA_def_enum_funcs(prop, object_select_menu_enum_itemf); RNA_def_property_flag(prop, (PropertyFlag)(PROP_HIDDEN | PROP_ENUM_NO_TRANSLATE)); ot->prop = prop; diff --git a/source/blender/editors/transform/transform_ops.cc b/source/blender/editors/transform/transform_ops.cc index fbcdd484903..4aba381d77a 100644 --- a/source/blender/editors/transform/transform_ops.cc +++ b/source/blender/editors/transform/transform_ops.cc @@ -118,7 +118,7 @@ static TransformModeItem transform_modes[] = { {nullptr, 0}, }; -const EnumPropertyItem rna_enum_transform_mode_types[] = { +const EnumPropertyItem rna_enum_transform_mode_type_items[] = { {TFM_INIT, "INIT", 0, "Init", ""}, {TFM_DUMMY, "DUMMY", 0, "Dummy", ""}, {TFM_TRANSLATION, "TRANSLATION", 0, "Translation", ""}, @@ -1375,7 +1375,7 @@ static void TRANSFORM_OT_transform(wmOperatorType *ot) ot->poll_property = transform_poll_property; prop = RNA_def_enum( - ot->srna, "mode", rna_enum_transform_mode_types, TFM_TRANSLATION, "Mode", ""); + ot->srna, "mode", rna_enum_transform_mode_type_items, TFM_TRANSLATION, "Mode", ""); RNA_def_property_flag(prop, PROP_HIDDEN); RNA_def_float_vector( diff --git a/source/blender/io/usd/intern/usd_writer_curves.cc b/source/blender/io/usd/intern/usd_writer_curves.cc index 8aca386b421..77f5e07ba08 100644 --- a/source/blender/io/usd/intern/usd_writer_curves.cc +++ b/source/blender/io/usd/intern/usd_writer_curves.cc @@ -435,10 +435,11 @@ void USDCurvesWriter::do_write(HierarchyContext &context) else if (first_frame_curve_type != curve_type) { const char *first_frame_curve_type_name = nullptr; RNA_enum_name_from_value( - rna_enum_curves_types, int(first_frame_curve_type), &first_frame_curve_type_name); + rna_enum_curves_type_items, int(first_frame_curve_type), &first_frame_curve_type_name); const char *current_curve_type_name = nullptr; - RNA_enum_name_from_value(rna_enum_curves_types, int(curve_type), ¤t_curve_type_name); + RNA_enum_name_from_value( + rna_enum_curves_type_items, int(curve_type), ¤t_curve_type_name); WM_reportf(RPT_WARNING, "USD does not support animating curve types. The curve type changes from %s to " diff --git a/source/blender/makesrna/RNA_enum_items.hh b/source/blender/makesrna/RNA_enum_items.hh index 2eb0c1c5553..3932d6e47c5 100644 --- a/source/blender/makesrna/RNA_enum_items.hh +++ b/source/blender/makesrna/RNA_enum_items.hh @@ -4,15 +4,16 @@ /** \file * \ingroup RNA + * + * Notes: + * - This is included multiple times with different #defines for DEF_ENUM. + * - As these are global identifiers, all must confirm to `rna_enum_*_items` convention. */ -/* NOTE: this is included multiple times with different #defines for DEF_ENUM. */ +/* Use in cases where only dynamic types are used. */ +DEF_ENUM(rna_enum_dummy_NULL_items) +DEF_ENUM(rna_enum_dummy_DEFAULT_items) -/* use in cases where only dynamic types are used */ -DEF_ENUM(DummyRNA_NULL_items) -DEF_ENUM(DummyRNA_DEFAULT_items) - -/* all others should follow 'rna_enum_*_items' naming */ DEF_ENUM(rna_enum_id_type_items) DEF_ENUM(rna_enum_object_mode_items) @@ -85,7 +86,7 @@ DEF_ENUM(rna_enum_driver_target_rotation_mode_items) DEF_ENUM(rna_enum_keyingset_path_grouping_items) DEF_ENUM(rna_enum_keying_flag_items) -DEF_ENUM(rna_enum_keying_flag_items_api) +DEF_ENUM(rna_enum_keying_flag_api_items) DEF_ENUM(rna_enum_fmodifier_type_items) @@ -101,7 +102,7 @@ DEF_ENUM(rna_enum_event_type_mask_items) DEF_ENUM(rna_enum_operator_type_flag_items) DEF_ENUM(rna_enum_operator_return_items) -DEF_ENUM(rna_enum_operator_property_tags) +DEF_ENUM(rna_enum_operator_property_tag_items) DEF_ENUM(rna_enum_brush_automasking_flag_items) DEF_ENUM(rna_enum_brush_sculpt_tool_items) @@ -226,11 +227,11 @@ DEF_ENUM(rna_enum_color_attribute_domain_items) DEF_ENUM(rna_enum_attribute_domain_without_corner_items) DEF_ENUM(rna_enum_attribute_domain_with_auto_items) DEF_ENUM(rna_enum_geometry_component_type_items) -DEF_ENUM(rna_node_combsep_color_items) -DEF_ENUM(rna_node_socket_data_type_items) +DEF_ENUM(rna_enum_node_combsep_color_items) +DEF_ENUM(rna_enum_node_socket_data_type_items) -DEF_ENUM(rna_node_geometry_curve_handle_side_items) -DEF_ENUM(rna_node_geometry_mesh_circle_fill_type_items) +DEF_ENUM(rna_enum_node_geometry_curve_handle_side_items) +DEF_ENUM(rna_enum_node_geometry_mesh_circle_fill_type_items) DEF_ENUM(rna_enum_volume_grid_data_type_items) @@ -244,8 +245,8 @@ DEF_ENUM(rna_enum_transform_orientation_items) DEF_ENUM(rna_enum_velocity_unit_items) -DEF_ENUM(rna_enum_curves_types) -DEF_ENUM(rna_enum_curve_normal_modes) +DEF_ENUM(rna_enum_curves_type_items) +DEF_ENUM(rna_enum_curve_normal_mode_items) /* Not available to RNA pre-processing (`makesrna`). * Defined in editors for example. */ @@ -255,11 +256,11 @@ DEF_ENUM(rna_enum_particle_edit_hair_brush_items) DEF_ENUM(rna_enum_particle_edit_disconnected_hair_brush_items) DEF_ENUM(rna_enum_keyframe_paste_offset_items) -DEF_ENUM(rna_enum_keyframe_paste_offset_value) +DEF_ENUM(rna_enum_keyframe_paste_offset_value_items) DEF_ENUM(rna_enum_keyframe_paste_merge_items) -DEF_ENUM(rna_enum_transform_pivot_items_full) -DEF_ENUM(rna_enum_transform_mode_types) +DEF_ENUM(rna_enum_transform_pivot_full_items) +DEF_ENUM(rna_enum_transform_mode_type_items) /* In the runtime part of RNA, could be removed from this section. */ DEF_ENUM(rna_enum_nla_mode_extend_items) diff --git a/source/blender/makesrna/intern/makesrna.cc b/source/blender/makesrna/intern/makesrna.cc index 75aec77e0bc..fee7a7a7250 100644 --- a/source/blender/makesrna/intern/makesrna.cc +++ b/source/blender/makesrna/intern/makesrna.cc @@ -3387,6 +3387,27 @@ static void rna_def_function_funcs(FILE *f, StructDefRNA *dsrna, FunctionDefRNA dfunc->gencall = funcname; } +static void rna_sanity_checks() +{ + /* Ensure RNA enum definitions follow naming convention. */ + { +#define DEF_ENUM(id) #id, + const char *rna_enum_id_array[] = { +#include "RNA_enum_items.hh" + }; + for (int i = 0; i < ARRAY_SIZE(rna_enum_id_array); i++) { + if (!(BLI_str_startswith(rna_enum_id_array[i], "rna_enum_") && + BLI_str_endswith(rna_enum_id_array[i], "_items"))) + { + fprintf(stderr, + "Error: enum defined in \"RNA_enum_items.hh\" " + "doesn't confirm to \"rna_enum_*_items\" convention!\n"); + DefRNA.error = true; + } + } + } +} + static void rna_auto_types() { StructDefRNA *ds; @@ -4084,7 +4105,7 @@ static void rna_generate_property(FILE *f, StructRNA *srna, const char *nest, Pr } } else { - if (!defaultfound && !(eprop->item_fn && eprop->item == DummyRNA_NULL_items)) { + if (!defaultfound && !(eprop->item_fn && eprop->item == rna_enum_dummy_NULL_items)) { CLOG_ERROR(&LOG, "%s%s.%s, enum default is not in items.", srna->identifier, @@ -5537,6 +5558,11 @@ static int rna_preprocess(const char *outfile, const char *public_header_outfile } } + rna_sanity_checks(); + if (DefRNA.error) { + status = EXIT_FAILURE; + } + rna_auto_types(); if (DefRNA.error) { status = EXIT_FAILURE; diff --git a/source/blender/makesrna/intern/rna_animation.cc b/source/blender/makesrna/intern/rna_animation.cc index 7053bc3ec2d..b4e068ff2aa 100644 --- a/source/blender/makesrna/intern/rna_animation.cc +++ b/source/blender/makesrna/intern/rna_animation.cc @@ -61,7 +61,7 @@ const EnumPropertyItem rna_enum_keying_flag_items[] = { }; /* Contains additional flags suitable for use in Python API functions. */ -const EnumPropertyItem rna_enum_keying_flag_items_api[] = { +const EnumPropertyItem rna_enum_keying_flag_api_items[] = { {INSERTKEY_NEEDED, "INSERTKEY_NEEDED", 0, diff --git a/source/blender/makesrna/intern/rna_asset.cc b/source/blender/makesrna/intern/rna_asset.cc index 24a03d42248..03a4e364368 100644 --- a/source/blender/makesrna/intern/rna_asset.cc +++ b/source/blender/makesrna/intern/rna_asset.cc @@ -611,7 +611,7 @@ PropertyRNA *rna_def_asset_library_reference_common(StructRNA *srna, const char *set) { PropertyRNA *prop = RNA_def_property(srna, "asset_library_ref", PROP_ENUM, PROP_NONE); - RNA_def_property_enum_items(prop, DummyRNA_NULL_items); + RNA_def_property_enum_items(prop, rna_enum_dummy_NULL_items); RNA_def_property_enum_funcs(prop, get, set, "rna_asset_library_reference_itemf"); return prop; diff --git a/source/blender/makesrna/intern/rna_brush.cc b/source/blender/makesrna/intern/rna_brush.cc index 67a1c1ff000..3e735eeb61e 100644 --- a/source/blender/makesrna/intern/rna_brush.cc +++ b/source/blender/makesrna/intern/rna_brush.cc @@ -956,10 +956,10 @@ static const EnumPropertyItem *rna_Brush_direction_itemf(bContext *C, return prop_direction_items; case BRUSH_MASK_SMOOTH: - return DummyRNA_DEFAULT_items; + return rna_enum_dummy_DEFAULT_items; default: - return DummyRNA_DEFAULT_items; + return rna_enum_dummy_DEFAULT_items; } case SCULPT_TOOL_FLATTEN: @@ -978,7 +978,7 @@ static const EnumPropertyItem *rna_Brush_direction_itemf(bContext *C, return prop_inflate_deflate_items; default: - return DummyRNA_DEFAULT_items; + return rna_enum_dummy_DEFAULT_items; } case PAINT_MODE_TEXTURE_2D: @@ -988,7 +988,7 @@ static const EnumPropertyItem *rna_Brush_direction_itemf(bContext *C, return prop_soften_sharpen_items; default: - return DummyRNA_DEFAULT_items; + return rna_enum_dummy_DEFAULT_items; } case PAINT_MODE_SCULPT_CURVES: switch (me->curves_sculpt_tool) { @@ -997,10 +997,10 @@ static const EnumPropertyItem *rna_Brush_direction_itemf(bContext *C, case CURVES_SCULPT_TOOL_PINCH: return prop_direction_items; default: - return DummyRNA_DEFAULT_items; + return rna_enum_dummy_DEFAULT_items; } default: - return DummyRNA_DEFAULT_items; + return rna_enum_dummy_DEFAULT_items; } } diff --git a/source/blender/makesrna/intern/rna_curves.cc b/source/blender/makesrna/intern/rna_curves.cc index 2a32114df04..df74053ab5b 100644 --- a/source/blender/makesrna/intern/rna_curves.cc +++ b/source/blender/makesrna/intern/rna_curves.cc @@ -17,7 +17,7 @@ #include "WM_types.hh" -const EnumPropertyItem rna_enum_curves_types[] = { +const EnumPropertyItem rna_enum_curves_type_items[] = { {CURVE_TYPE_CATMULL_ROM, "CATMULL_ROM", 0, "Catmull Rom", ""}, {CURVE_TYPE_POLY, "POLY", 0, "Poly", ""}, {CURVE_TYPE_BEZIER, "BEZIER", 0, "Bezier", ""}, @@ -25,7 +25,7 @@ const EnumPropertyItem rna_enum_curves_types[] = { {0, nullptr, 0, nullptr, nullptr}, }; -const EnumPropertyItem rna_enum_curve_normal_modes[] = { +const EnumPropertyItem rna_enum_curve_normal_mode_items[] = { {NORMAL_MODE_MINIMUM_TWIST, "MINIMUM_TWIST", ICON_NONE, diff --git a/source/blender/makesrna/intern/rna_gpencil_legacy.cc b/source/blender/makesrna/intern/rna_gpencil_legacy.cc index 0537513be2d..41b86f2f5ea 100644 --- a/source/blender/makesrna/intern/rna_gpencil_legacy.cc +++ b/source/blender/makesrna/intern/rna_gpencil_legacy.cc @@ -577,7 +577,7 @@ static const EnumPropertyItem *rna_GPencil_active_layer_itemf(bContext *C, int i = 0; if (ELEM(nullptr, C, gpd)) { - return DummyRNA_NULL_items; + return rna_enum_dummy_NULL_items; } /* Existing layers */ @@ -2385,7 +2385,7 @@ static void rna_def_gpencil_layers_api(BlenderRNA *brna, PropertyRNA *cprop) "rna_GPencil_active_layer_index_set", "rna_GPencil_active_layer_itemf"); RNA_def_property_enum_items( - prop, DummyRNA_DEFAULT_items); /* purely dynamic, as it maps to user-data */ + prop, rna_enum_dummy_DEFAULT_items); /* purely dynamic, as it maps to user-data */ RNA_def_property_ui_text(prop, "Active Note", "Note/Layer to add annotation strokes to"); RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, "rna_GPencil_update"); } diff --git a/source/blender/makesrna/intern/rna_node_tree_interface.cc b/source/blender/makesrna/intern/rna_node_tree_interface.cc index b08dc80861c..5c31cc1f1a3 100644 --- a/source/blender/makesrna/intern/rna_node_tree_interface.cc +++ b/source/blender/makesrna/intern/rna_node_tree_interface.cc @@ -366,7 +366,7 @@ static const EnumPropertyItem *rna_NodeTreeInterfaceSocket_socket_type_itemf( bNodeTree *ntree = reinterpret_cast(ptr->owner_id); if (!ntree) { - return DummyRNA_NULL_items; + return rna_enum_dummy_NULL_items; } return rna_node_socket_type_itemf( @@ -784,7 +784,7 @@ static void rna_def_node_interface_socket(BlenderRNA *brna) RNA_def_property_update(prop, NC_NODE | NA_EDITED, "rna_NodeTreeInterfaceItem_update"); prop = RNA_def_property(srna, "socket_type", PROP_ENUM, PROP_NONE); - RNA_def_property_enum_items(prop, DummyRNA_DEFAULT_items); + RNA_def_property_enum_items(prop, rna_enum_dummy_DEFAULT_items); RNA_def_property_enum_funcs(prop, "rna_NodeTreeInterfaceSocket_socket_type_get", "rna_NodeTreeInterfaceSocket_socket_type_set", @@ -926,7 +926,7 @@ static void rna_def_node_tree_interface_items_api(StructRNA *srna) RNA_def_boolean(func, "is_output", false, "Is Output", "Create an output socket"); parm = RNA_def_enum(func, "socket_type", - DummyRNA_DEFAULT_items, + rna_enum_dummy_DEFAULT_items, 0, "Socket Type", "Type of socket generated on nodes"); diff --git a/source/blender/makesrna/intern/rna_nodetree.cc b/source/blender/makesrna/intern/rna_nodetree.cc index 521e33d8220..db3f5da7c7c 100644 --- a/source/blender/makesrna/intern/rna_nodetree.cc +++ b/source/blender/makesrna/intern/rna_nodetree.cc @@ -69,7 +69,7 @@ const EnumPropertyItem rna_enum_node_socket_in_out_items[] = {{SOCK_IN, "IN", 0, {SOCK_OUT, "OUT", 0, "Output", ""}, {0, nullptr, 0, nullptr, nullptr}}; -const EnumPropertyItem rna_node_socket_data_type_items[] = { +const EnumPropertyItem rna_enum_node_socket_data_type_items[] = { {SOCK_FLOAT, "FLOAT", 0, "Float", ""}, {SOCK_INT, "INT", 0, "Integer", ""}, {SOCK_BOOLEAN, "BOOLEAN", 0, "Boolean", ""}, @@ -511,12 +511,12 @@ static const EnumPropertyItem rna_node_geometry_curve_handle_type_items[] = { "The location is constrained to point in the opposite direction as the other handle"}, {0, nullptr, 0, nullptr, nullptr}}; -const EnumPropertyItem rna_node_geometry_curve_handle_side_items[] = { +const EnumPropertyItem rna_enum_node_geometry_curve_handle_side_items[] = { {GEO_NODE_CURVE_HANDLE_LEFT, "LEFT", ICON_NONE, "Left", "Use the left handles"}, {GEO_NODE_CURVE_HANDLE_RIGHT, "RIGHT", ICON_NONE, "Right", "Use the right handles"}, {0, nullptr, 0, nullptr, nullptr}}; -const EnumPropertyItem rna_node_combsep_color_items[] = { +const EnumPropertyItem rna_enum_node_combsep_color_items[] = { {NODE_COMBSEP_COLOR_RGB, "RGB", ICON_NONE, "RGB", "Use RGB color processing"}, {NODE_COMBSEP_COLOR_HSV, "HSV", ICON_NONE, "HSV", "Use HSV color processing"}, {NODE_COMBSEP_COLOR_HSL, "HSL", ICON_NONE, "HSL", "Use HSL color processing"}, @@ -531,7 +531,7 @@ static const EnumPropertyItem rna_enum_mix_data_type_items[] = { {0, nullptr, 0, nullptr, nullptr}, }; -const EnumPropertyItem rna_node_geometry_mesh_circle_fill_type_items[] = { +const EnumPropertyItem rna_enum_node_geometry_mesh_circle_fill_type_items[] = { {GEO_NODE_MESH_CIRCLE_FILL_NONE, "NONE", 0, "None", ""}, {GEO_NODE_MESH_CIRCLE_FILL_NGON, "NGON", 0, "N-Gon", ""}, {GEO_NODE_MESH_CIRCLE_FILL_TRIANGLE_FAN, "TRIANGLE_FAN", 0, "Triangles", ""}, @@ -678,7 +678,7 @@ const EnumPropertyItem *rna_node_tree_type_itemf(void *data, if (totitem == 0) { *r_free = false; - return DummyRNA_NULL_items; + return rna_enum_dummy_NULL_items; } RNA_enum_item_end(&item, &totitem); @@ -746,7 +746,7 @@ const EnumPropertyItem *rna_node_socket_type_itemf(void *data, if (totitem == 0) { *r_free = false; - return DummyRNA_NULL_items; + return rna_enum_dummy_NULL_items; } RNA_enum_item_end(&item, &totitem); @@ -1953,7 +1953,7 @@ static const EnumPropertyItem *rna_GeometryNodeSwitch_type_itemf(bContext * /*C* bool *r_free) { *r_free = true; - return itemf_function_check(rna_node_socket_data_type_items, switch_type_supported); + return itemf_function_check(rna_enum_node_socket_data_type_items, switch_type_supported); } static bool geometry_node_asset_trait_flag_get(PointerRNA *ptr, @@ -2975,12 +2975,12 @@ static const EnumPropertyItem *rna_Node_image_layer_itemf(bContext * /*C*/, RenderLayer *rl; if (node->type == CMP_NODE_CRYPTOMATTE && node->custom1 != CMP_CRYPTOMATTE_SRC_IMAGE) { - return DummyRNA_NULL_items; + return rna_enum_dummy_NULL_items; } if (ima == nullptr || ima->rr == nullptr) { *r_free = false; - return DummyRNA_NULL_items; + return rna_enum_dummy_NULL_items; } rl = static_cast(ima->rr->layers.first); @@ -3063,12 +3063,12 @@ static const EnumPropertyItem *rna_Node_image_view_itemf(bContext * /*C*/, RenderView *rv; if (node->type == CMP_NODE_CRYPTOMATTE && node->custom1 != CMP_CRYPTOMATTE_SRC_IMAGE) { - return DummyRNA_NULL_items; + return rna_enum_dummy_NULL_items; } if (ima == nullptr || ima->rr == nullptr) { *r_free = false; - return DummyRNA_NULL_items; + return rna_enum_dummy_NULL_items; } rv = static_cast(ima->rr->views.first); @@ -3091,7 +3091,7 @@ static const EnumPropertyItem *rna_Node_view_layer_itemf(bContext * /*C*/, if (sce == nullptr) { *r_free = false; - return DummyRNA_NULL_items; + return rna_enum_dummy_NULL_items; } rl = static_cast(sce->view_layers.first); @@ -3178,7 +3178,7 @@ static const EnumPropertyItem *rna_Node_channel_itemf(bContext * /*C*/, RNA_enum_item_add(&item, &totitem, &tmp); break; default: - return DummyRNA_NULL_items; + return rna_enum_dummy_NULL_items; } RNA_enum_item_end(&item, &totitem); @@ -3418,7 +3418,7 @@ static const EnumPropertyItem *rna_SimulationStateItem_socket_type_itemf(bContex bool *r_free) { *r_free = true; - return itemf_function_check(rna_node_socket_data_type_items, + return itemf_function_check(rna_enum_node_socket_data_type_items, rna_SimulationStateItem_socket_type_supported); } @@ -3433,7 +3433,7 @@ static const EnumPropertyItem *rna_RepeatItem_socket_type_itemf(bContext * /*C*/ bool *r_free) { *r_free = true; - return itemf_function_check(rna_node_socket_data_type_items, + return itemf_function_check(rna_enum_node_socket_data_type_items, rna_RepeatItem_socket_type_supported); } @@ -5103,7 +5103,7 @@ static void def_tex_combsep_color(StructRNA *srna) prop = RNA_def_property(srna, "mode", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, nullptr, "custom1"); - RNA_def_property_enum_items(prop, rna_node_combsep_color_items); + RNA_def_property_enum_items(prop, rna_enum_node_combsep_color_items); RNA_def_property_ui_text(prop, "Mode", "Mode of color processing"); RNA_def_property_update(prop, NC_NODE | NA_EDITED, "rna_Node_socket_update"); } @@ -9152,7 +9152,7 @@ static void def_geo_curve_set_handle_type(StructRNA *srna) RNA_def_property_update(prop, NC_NODE | NA_EDITED, "rna_Node_socket_update"); prop = RNA_def_property(srna, "mode", PROP_ENUM, PROP_NONE); - RNA_def_property_enum_items(prop, rna_node_geometry_curve_handle_side_items); + RNA_def_property_enum_items(prop, rna_enum_node_geometry_curve_handle_side_items); RNA_def_property_ui_text(prop, "Mode", "Whether to update left and right handles"); RNA_def_property_flag(prop, PROP_ENUM_FLAG); RNA_def_property_update(prop, NC_NODE | NA_EDITED, "rna_Node_socket_update"); @@ -9231,7 +9231,7 @@ static void rna_def_simulation_state_item(BlenderRNA *brna) RNA_def_property_update(prop, NC_NODE | NA_EDITED, "rna_SimulationStateItem_update"); prop = RNA_def_property(srna, "socket_type", PROP_ENUM, PROP_NONE); - RNA_def_property_enum_items(prop, rna_node_socket_data_type_items); + RNA_def_property_enum_items(prop, rna_enum_node_socket_data_type_items); RNA_def_property_enum_funcs(prop, nullptr, nullptr, "rna_SimulationStateItem_socket_type_itemf"); RNA_def_property_ui_text(prop, "Socket Type", ""); RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); @@ -9269,7 +9269,7 @@ static void rna_def_geo_simulation_output_items(BlenderRNA *brna) RNA_def_function_flag(func, FUNC_USE_SELF_ID | FUNC_USE_MAIN | FUNC_USE_REPORTS); parm = RNA_def_enum(func, "socket_type", - rna_node_socket_data_type_items, + rna_enum_node_socket_data_type_items, SOCK_GEOMETRY, "Socket Type", "Socket type of the item"); @@ -9346,7 +9346,7 @@ static void rna_def_repeat_item(BlenderRNA *brna) RNA_def_property_update(prop, NC_NODE | NA_EDITED, "rna_RepeatItem_update"); prop = RNA_def_property(srna, "socket_type", PROP_ENUM, PROP_NONE); - RNA_def_property_enum_items(prop, rna_node_socket_data_type_items); + RNA_def_property_enum_items(prop, rna_enum_node_socket_data_type_items); RNA_def_property_enum_funcs(prop, nullptr, nullptr, "rna_RepeatItem_socket_type_itemf"); RNA_def_property_ui_text(prop, "Socket Type", ""); RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); @@ -9375,7 +9375,7 @@ static void rna_def_geo_repeat_output_items(BlenderRNA *brna) RNA_def_function_flag(func, FUNC_USE_SELF_ID | FUNC_USE_MAIN | FUNC_USE_REPORTS); parm = RNA_def_enum(func, "socket_type", - rna_node_socket_data_type_items, + rna_enum_node_socket_data_type_items, SOCK_GEOMETRY, "Socket Type", "Socket type of the item"); @@ -9449,7 +9449,7 @@ static void def_geo_curve_handle_type_selection(StructRNA *srna) RNA_def_property_update(prop, NC_NODE | NA_EDITED, "rna_Node_socket_update"); prop = RNA_def_property(srna, "mode", PROP_ENUM, PROP_NONE); - RNA_def_property_enum_items(prop, rna_node_geometry_curve_handle_side_items); + RNA_def_property_enum_items(prop, rna_enum_node_geometry_curve_handle_side_items); RNA_def_property_ui_text(prop, "Mode", "Whether to check the type of left and right handles"); RNA_def_property_flag(prop, PROP_ENUM_FLAG); RNA_def_property_update(prop, NC_NODE | NA_EDITED, "rna_Node_socket_update"); @@ -9507,7 +9507,7 @@ static void def_geo_switch(StructRNA *srna) RNA_def_struct_sdna_from(srna, "NodeSwitch", "storage"); prop = RNA_def_property(srna, "input_type", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, nullptr, "input_type"); - RNA_def_property_enum_items(prop, rna_node_socket_data_type_items); + RNA_def_property_enum_items(prop, rna_enum_node_socket_data_type_items); RNA_def_property_enum_funcs(prop, nullptr, nullptr, "rna_GeometryNodeSwitch_type_itemf"); RNA_def_property_ui_text(prop, "Input Type", ""); RNA_def_property_update(prop, NC_NODE | NA_EDITED, "rna_Node_socket_update"); diff --git a/source/blender/makesrna/intern/rna_rna.cc b/source/blender/makesrna/intern/rna_rna.cc index 78e4b9ad5db..37bb235f33f 100644 --- a/source/blender/makesrna/intern/rna_rna.cc +++ b/source/blender/makesrna/intern/rna_rna.cc @@ -26,13 +26,13 @@ /* Reuse for dynamic types. */ -const EnumPropertyItem DummyRNA_NULL_items[] = { +const EnumPropertyItem rna_enum_dummy_NULL_items[] = { {0, nullptr, 0, nullptr, nullptr}, }; /* Reuse for dynamic types with default value. */ -const EnumPropertyItem DummyRNA_DEFAULT_items[] = { +const EnumPropertyItem rna_enum_dummy_DEFAULT_items[] = { {0, "DEFAULT", 0, "Default", ""}, {0, nullptr, 0, nullptr, nullptr}, }; @@ -993,7 +993,7 @@ static const EnumPropertyItem *rna_EnumProperty_default_itemf(bContext *C, /* incompatible default attributes */ if ((prop_parent->flag & PROP_ENUM_FLAG) != (prop->flag & PROP_ENUM_FLAG)) { - return DummyRNA_NULL_items; + return rna_enum_dummy_NULL_items; } if ((eprop->item_fn == nullptr) || (eprop->item_fn == rna_EnumProperty_default_itemf) || diff --git a/source/blender/makesrna/intern/rna_scene.cc b/source/blender/makesrna/intern/rna_scene.cc index ca2ee59658f..932fd277264 100644 --- a/source/blender/makesrna/intern/rna_scene.cc +++ b/source/blender/makesrna/intern/rna_scene.cc @@ -578,7 +578,7 @@ static const EnumPropertyItem rna_enum_view_layer_aov_type_items[] = { {0, nullptr, 0, nullptr, nullptr}, }; -const EnumPropertyItem rna_enum_transform_pivot_items_full[] = { +const EnumPropertyItem rna_enum_transform_pivot_full_items[] = { {V3D_AROUND_CENTER_BOUNDS, "BOUNDING_BOX_CENTER", ICON_PIVOT_BOUNDBOX, @@ -3307,7 +3307,7 @@ static void rna_def_tool_settings(BlenderRNA *brna) /* Pivot Point */ prop = RNA_def_property(srna, "transform_pivot_point", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, nullptr, "transform_pivot_point"); - RNA_def_property_enum_items(prop, rna_enum_transform_pivot_items_full); + RNA_def_property_enum_items(prop, rna_enum_transform_pivot_full_items); RNA_def_property_ui_text(prop, "Transform Pivot Point", "Pivot center for rotation/scaling"); RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, nullptr); @@ -4334,25 +4334,25 @@ static void rna_def_unit_settings(BlenderRNA *brna) RNA_def_property_update(prop, NC_WINDOW, nullptr); prop = RNA_def_property(srna, "length_unit", PROP_ENUM, PROP_NONE); - RNA_def_property_enum_items(prop, DummyRNA_DEFAULT_items); + RNA_def_property_enum_items(prop, rna_enum_dummy_DEFAULT_items); RNA_def_property_enum_funcs(prop, nullptr, nullptr, "rna_UnitSettings_length_unit_itemf"); RNA_def_property_ui_text(prop, "Length Unit", "Unit that will be used to display length values"); RNA_def_property_update(prop, NC_WINDOW, nullptr); prop = RNA_def_property(srna, "mass_unit", PROP_ENUM, PROP_NONE); - RNA_def_property_enum_items(prop, DummyRNA_DEFAULT_items); + RNA_def_property_enum_items(prop, rna_enum_dummy_DEFAULT_items); RNA_def_property_enum_funcs(prop, nullptr, nullptr, "rna_UnitSettings_mass_unit_itemf"); RNA_def_property_ui_text(prop, "Mass Unit", "Unit that will be used to display mass values"); RNA_def_property_update(prop, NC_WINDOW, nullptr); prop = RNA_def_property(srna, "time_unit", PROP_ENUM, PROP_NONE); - RNA_def_property_enum_items(prop, DummyRNA_DEFAULT_items); + RNA_def_property_enum_items(prop, rna_enum_dummy_DEFAULT_items); RNA_def_property_enum_funcs(prop, nullptr, nullptr, "rna_UnitSettings_time_unit_itemf"); RNA_def_property_ui_text(prop, "Time Unit", "Unit that will be used to display time values"); RNA_def_property_update(prop, NC_WINDOW, nullptr); prop = RNA_def_property(srna, "temperature_unit", PROP_ENUM, PROP_NONE); - RNA_def_property_enum_items(prop, DummyRNA_DEFAULT_items); + RNA_def_property_enum_items(prop, rna_enum_dummy_DEFAULT_items); RNA_def_property_enum_funcs(prop, nullptr, nullptr, "rna_UnitSettings_temperature_unit_itemf"); RNA_def_property_ui_text( prop, "Temperature Unit", "Unit that will be used to display temperature values"); diff --git a/source/blender/makesrna/intern/rna_screen.cc b/source/blender/makesrna/intern/rna_screen.cc index a2ef11d374c..19b7261135b 100644 --- a/source/blender/makesrna/intern/rna_screen.cc +++ b/source/blender/makesrna/intern/rna_screen.cc @@ -390,7 +390,7 @@ static void rna_def_area(BlenderRNA *brna) RNA_def_property_update(prop, 0, "rna_Area_type_update"); prop = RNA_def_property(srna, "ui_type", PROP_ENUM, PROP_NONE); - RNA_def_property_enum_items(prop, DummyRNA_NULL_items); /* in fact dummy */ + RNA_def_property_enum_items(prop, rna_enum_dummy_NULL_items); /* in fact dummy */ RNA_def_property_enum_default(prop, SPACE_VIEW3D << 16); RNA_def_property_enum_funcs( prop, "rna_Area_ui_type_get", "rna_Area_ui_type_set", "rna_Area_ui_type_itemf"); diff --git a/source/blender/makesrna/intern/rna_space.cc b/source/blender/makesrna/intern/rna_space.cc index 30092bc800c..f29bea7da2b 100644 --- a/source/blender/makesrna/intern/rna_space.cc +++ b/source/blender/makesrna/intern/rna_space.cc @@ -1916,7 +1916,7 @@ static const EnumPropertyItem *rna_SpaceImageEditor_pivot_itemf(bContext * /*C*/ SpaceImage *sima = (SpaceImage *)ptr->data; if (sima->mode == SI_MODE_PAINT) { - return rna_enum_transform_pivot_items_full; + return rna_enum_transform_pivot_full_items; } else { return pivot_items; @@ -5646,7 +5646,7 @@ static void rna_def_space_image(BlenderRNA *brna) prop = RNA_def_property(srna, "pivot_point", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, nullptr, "around"); - RNA_def_property_enum_items(prop, rna_enum_transform_pivot_items_full); + RNA_def_property_enum_items(prop, rna_enum_transform_pivot_full_items); RNA_def_property_enum_funcs(prop, nullptr, nullptr, "rna_SpaceImageEditor_pivot_itemf"); RNA_def_property_ui_text(prop, "Pivot", "Rotation/Scaling Pivot"); RNA_def_property_update(prop, NC_SPACE | ND_SPACE_IMAGE, nullptr); diff --git a/source/blender/makesrna/intern/rna_ui_api.cc b/source/blender/makesrna/intern/rna_ui_api.cc index 472b4ac5dc0..45c12ccf87a 100644 --- a/source/blender/makesrna/intern/rna_ui_api.cc +++ b/source/blender/makesrna/intern/rna_ui_api.cc @@ -2034,7 +2034,7 @@ void RNA_api_ui_layout(StructRNA *srna) "Identifier of the integer property in active_data, index of the active item"); RNA_def_parameter_flags(parm, PropertyFlag(0), PARM_REQUIRED); parm = RNA_def_property(func, "filter_id_types", PROP_ENUM, PROP_NONE); - RNA_def_property_enum_items(parm, DummyRNA_NULL_items); + RNA_def_property_enum_items(parm, rna_enum_dummy_NULL_items); RNA_def_property_enum_funcs( parm, nullptr, nullptr, "rna_uiTemplateAssetView_filter_id_types_itemf"); RNA_def_property_flag(parm, PROP_ENUM_FLAG); diff --git a/source/blender/makesrna/intern/rna_wm.cc b/source/blender/makesrna/intern/rna_wm.cc index b86b20311e1..66e7daf710f 100644 --- a/source/blender/makesrna/intern/rna_wm.cc +++ b/source/blender/makesrna/intern/rna_wm.cc @@ -518,7 +518,7 @@ const EnumPropertyItem rna_enum_operator_return_items[] = { {0, nullptr, 0, nullptr, nullptr}, }; -const EnumPropertyItem rna_enum_operator_property_tags[] = { +const EnumPropertyItem rna_enum_operator_property_tag_items[] = { {OP_PROP_TAG_ADVANCED, "ADVANCED", 0, @@ -1606,7 +1606,7 @@ static StructRNA *rna_Operator_register(Main *bmain, /* Operator properties are registered separately. */ RNA_def_struct_flag(dummy_ot.rna_ext.srna, STRUCT_NO_IDPROPERTIES); - RNA_def_struct_property_tags(dummy_ot.rna_ext.srna, rna_enum_operator_property_tags); + RNA_def_struct_property_tags(dummy_ot.rna_ext.srna, rna_enum_operator_property_tag_items); RNA_def_struct_translation_context(dummy_ot.rna_ext.srna, dummy_ot.translation_context); dummy_ot.rna_ext.data = data; dummy_ot.rna_ext.call = call; @@ -2034,7 +2034,7 @@ static void rna_def_operator(BlenderRNA *brna) RNA_def_struct_ui_text(srna, "Operator Properties", "Input properties of an operator"); RNA_def_struct_refine_func(srna, "rna_OperatorProperties_refine"); RNA_def_struct_idprops_func(srna, "rna_OperatorProperties_idprops"); - RNA_def_struct_property_tags(srna, rna_enum_operator_property_tags); + RNA_def_struct_property_tags(srna, rna_enum_operator_property_tag_items); RNA_def_struct_flag(srna, STRUCT_NO_DATABLOCK_IDPROPERTIES | STRUCT_NO_CONTEXT_WITHOUT_OWNER_ID); RNA_def_struct_clear_flag(srna, STRUCT_UNDO); } diff --git a/source/blender/makesrna/intern/rna_workspace.cc b/source/blender/makesrna/intern/rna_workspace.cc index ead0a61fcc9..163e873aa35 100644 --- a/source/blender/makesrna/intern/rna_workspace.cc +++ b/source/blender/makesrna/intern/rna_workspace.cc @@ -170,7 +170,7 @@ const EnumPropertyItem *rna_WorkSpace_tools_mode_itemf(bContext * /*C*/, case SPACE_SEQ: return rna_enum_space_sequencer_view_type_items; } - return DummyRNA_DEFAULT_items; + return rna_enum_dummy_DEFAULT_items; } static bool rna_WorkSpaceTool_use_paint_canvas_get(PointerRNA *ptr) @@ -285,7 +285,7 @@ static void rna_def_workspace_tool(BlenderRNA *brna) prop = RNA_def_property(srna, "mode", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, nullptr, "mode"); - RNA_def_property_enum_items(prop, DummyRNA_DEFAULT_items); + RNA_def_property_enum_items(prop, rna_enum_dummy_DEFAULT_items); RNA_def_property_enum_funcs(prop, nullptr, nullptr, "rna_WorkSpace_tools_mode_itemf"); RNA_def_property_ui_text(prop, "Tool Mode", ""); RNA_def_property_clear_flag(prop, PROP_EDITABLE); diff --git a/source/blender/nodes/function/nodes/node_fn_combine_color.cc b/source/blender/nodes/function/nodes/node_fn_combine_color.cc index a86a5d0b195..7c9acb0fbe5 100644 --- a/source/blender/nodes/function/nodes/node_fn_combine_color.cc +++ b/source/blender/nodes/function/nodes/node_fn_combine_color.cc @@ -89,7 +89,7 @@ static void node_rna(StructRNA *srna) "mode", "Mode", "Mode of color processing", - rna_node_combsep_color_items, + rna_enum_node_combsep_color_items, NOD_storage_enum_accessors(mode)); } diff --git a/source/blender/nodes/function/nodes/node_fn_compare.cc b/source/blender/nodes/function/nodes/node_fn_compare.cc index 6036f421324..71d03ac22fd 100644 --- a/source/blender/nodes/function/nodes/node_fn_compare.cc +++ b/source/blender/nodes/function/nodes/node_fn_compare.cc @@ -709,13 +709,13 @@ static void node_rna(StructRNA *srna) "data_type", "Input Type", "", - rna_node_socket_data_type_items, + rna_enum_node_socket_data_type_items, NOD_storage_enum_accessors(data_type), std::nullopt, [](bContext * /*C*/, PointerRNA * /*ptr*/, PropertyRNA * /*prop*/, bool *r_free) { *r_free = true; return enum_items_filter( - rna_node_socket_data_type_items, [](const EnumPropertyItem &item) { + rna_enum_node_socket_data_type_items, [](const EnumPropertyItem &item) { return ELEM(item.value, SOCK_FLOAT, SOCK_INT, SOCK_VECTOR, SOCK_STRING, SOCK_RGBA); }); }); diff --git a/source/blender/nodes/function/nodes/node_fn_separate_color.cc b/source/blender/nodes/function/nodes/node_fn_separate_color.cc index bdc9707f3d1..3ae8125ef6c 100644 --- a/source/blender/nodes/function/nodes/node_fn_separate_color.cc +++ b/source/blender/nodes/function/nodes/node_fn_separate_color.cc @@ -207,7 +207,7 @@ static void node_rna(StructRNA *srna) "mode", "Mode", "Mode of color processing", - rna_node_combsep_color_items, + rna_enum_node_combsep_color_items, NOD_storage_enum_accessors(mode)); } diff --git a/source/blender/nodes/geometry/nodes/node_geo_curve_spline_type.cc b/source/blender/nodes/geometry/nodes/node_geo_curve_spline_type.cc index 76f58414718..4b4ae437ce0 100644 --- a/source/blender/nodes/geometry/nodes/node_geo_curve_spline_type.cc +++ b/source/blender/nodes/geometry/nodes/node_geo_curve_spline_type.cc @@ -91,7 +91,7 @@ static void node_rna(StructRNA *srna) "spline_type", "Type", "The curve type to change the selected curves to", - rna_enum_curves_types, + rna_enum_curves_type_items, NOD_storage_enum_accessors(spline_type), CURVE_TYPE_POLY); } diff --git a/source/blender/nodes/geometry/nodes/node_geo_mesh_primitive_circle.cc b/source/blender/nodes/geometry/nodes/node_geo_mesh_primitive_circle.cc index cad2082384c..03a7ed80a34 100644 --- a/source/blender/nodes/geometry/nodes/node_geo_mesh_primitive_circle.cc +++ b/source/blender/nodes/geometry/nodes/node_geo_mesh_primitive_circle.cc @@ -208,7 +208,7 @@ static void node_rna(StructRNA *srna) "fill_type", "Fill Type", "", - rna_node_geometry_mesh_circle_fill_type_items, + rna_enum_node_geometry_mesh_circle_fill_type_items, NOD_storage_enum_accessors(fill_type), GEO_NODE_MESH_CIRCLE_FILL_NONE); } diff --git a/source/blender/nodes/geometry/nodes/node_geo_mesh_primitive_cone.cc b/source/blender/nodes/geometry/nodes/node_geo_mesh_primitive_cone.cc index 2c8696c2191..0b888d3e036 100644 --- a/source/blender/nodes/geometry/nodes/node_geo_mesh_primitive_cone.cc +++ b/source/blender/nodes/geometry/nodes/node_geo_mesh_primitive_cone.cc @@ -866,7 +866,7 @@ static void node_rna(StructRNA *srna) "fill_type", "Fill Type", "", - rna_node_geometry_mesh_circle_fill_type_items, + rna_enum_node_geometry_mesh_circle_fill_type_items, NOD_storage_enum_accessors(fill_type), GEO_NODE_MESH_CIRCLE_FILL_NGON); } diff --git a/source/blender/nodes/geometry/nodes/node_geo_mesh_primitive_cylinder.cc b/source/blender/nodes/geometry/nodes/node_geo_mesh_primitive_cylinder.cc index 0bf3ba0877b..7a827f5228e 100644 --- a/source/blender/nodes/geometry/nodes/node_geo_mesh_primitive_cylinder.cc +++ b/source/blender/nodes/geometry/nodes/node_geo_mesh_primitive_cylinder.cc @@ -137,7 +137,7 @@ static void node_rna(StructRNA *srna) "fill_type", "Fill Type", "", - rna_node_geometry_mesh_circle_fill_type_items, + rna_enum_node_geometry_mesh_circle_fill_type_items, NOD_storage_enum_accessors(fill_type), GEO_NODE_MESH_CIRCLE_FILL_NGON); } diff --git a/source/blender/nodes/geometry/nodes/node_geo_set_curve_handles.cc b/source/blender/nodes/geometry/nodes/node_geo_set_curve_handles.cc index b9e17efa458..60f1f8c0b31 100644 --- a/source/blender/nodes/geometry/nodes/node_geo_set_curve_handles.cc +++ b/source/blender/nodes/geometry/nodes/node_geo_set_curve_handles.cc @@ -174,7 +174,7 @@ static void node_rna(StructRNA *srna) "mode", "Mode", "Whether to update left and right handles", - rna_node_geometry_curve_handle_side_items, + rna_enum_node_geometry_curve_handle_side_items, NOD_storage_enum_accessors(mode), GEO_NODE_CURVE_HANDLE_LEFT); } diff --git a/source/blender/nodes/geometry/nodes/node_geo_set_curve_normal.cc b/source/blender/nodes/geometry/nodes/node_geo_set_curve_normal.cc index 1a4d76bf007..9a7dd6ccae6 100644 --- a/source/blender/nodes/geometry/nodes/node_geo_set_curve_normal.cc +++ b/source/blender/nodes/geometry/nodes/node_geo_set_curve_normal.cc @@ -68,7 +68,7 @@ static void node_rna(StructRNA *srna) "mode", "Mode", "Mode for curve normal evaluation", - rna_enum_curve_normal_modes, + rna_enum_curve_normal_mode_items, NOD_inline_enum_accessors(custom1)); } diff --git a/source/blender/python/intern/bpy_props.cc b/source/blender/python/intern/bpy_props.cc index 75202297ef5..7cff99ec1f2 100644 --- a/source/blender/python/intern/bpy_props.cc +++ b/source/blender/python/intern/bpy_props.cc @@ -2217,7 +2217,7 @@ static const EnumPropertyItem *bpy_prop_enum_itemf_fn(bContext *C, else { PyC_Err_PrintWithFunc(py_func); - eitems = DummyRNA_NULL_items; + eitems = rna_enum_dummy_NULL_items; } if (C) { @@ -4231,7 +4231,7 @@ static PyObject *BPy_EnumProperty(PyObject *self, PyObject *args, PyObject *kw) } is_itemf = true; - eitems = DummyRNA_NULL_items; + eitems = rna_enum_dummy_NULL_items; } else { if (!(items_fast = PySequence_Fast( diff --git a/source/blender/python/intern/bpy_rna.cc b/source/blender/python/intern/bpy_rna.cc index 4e5b1196f02..809dc933e77 100644 --- a/source/blender/python/intern/bpy_rna.cc +++ b/source/blender/python/intern/bpy_rna.cc @@ -1333,9 +1333,9 @@ static PyObject *pyrna_enum_to_py(PointerRNA *ptr, PropertyRNA *prop, int val) RNA_property_enum_items_ex(nullptr, ptr, prop, true, &enum_item, nullptr, &free_dummy); BLI_assert(!free_dummy); - /* Do not print warning in case of DummyRNA_NULL_items, + /* Do not print warning in case of #rna_enum_dummy_NULL_items, * this one will never match any value... */ - if (enum_item != DummyRNA_NULL_items) { + if (enum_item != rna_enum_dummy_NULL_items) { const char *ptr_name = RNA_struct_name_get_alloc(ptr, nullptr, 0, nullptr); /* Prefer not to fail silently in case of API errors, maybe disable it later. */ diff --git a/source/blender/python/intern/bpy_rna_anim.cc b/source/blender/python/intern/bpy_rna_anim.cc index ac8240feeaa..afa3edb0a86 100644 --- a/source/blender/python/intern/bpy_rna_anim.cc +++ b/source/blender/python/intern/bpy_rna_anim.cc @@ -260,7 +260,7 @@ static int pyrna_struct_keyframe_parse(PointerRNA *ptr, if (r_options) { if (pyoptions && (pyrna_enum_bitfield_from_set( - rna_enum_keying_flag_items_api, pyoptions, r_options, error_prefix) == -1)) + rna_enum_keying_flag_api_items, pyoptions, r_options, error_prefix) == -1)) { return -1; } diff --git a/source/blender/windowmanager/intern/wm_operator_props.cc b/source/blender/windowmanager/intern/wm_operator_props.cc index b4f8141ed7e..00aae436e05 100644 --- a/source/blender/windowmanager/intern/wm_operator_props.cc +++ b/source/blender/windowmanager/intern/wm_operator_props.cc @@ -220,7 +220,8 @@ void WM_operator_properties_filesel(wmOperatorType *ot, prop = RNA_def_enum(ot->srna, "display_type", file_display_items, display, "Display Type", ""); RNA_def_property_flag(prop, PROP_HIDDEN | PROP_SKIP_SAVE); - prop = RNA_def_enum(ot->srna, "sort_method", DummyRNA_NULL_items, sort, "File sorting mode", ""); + prop = RNA_def_enum( + ot->srna, "sort_method", rna_enum_dummy_NULL_items, sort, "File sorting mode", ""); RNA_def_enum_funcs(prop, wm_operator_properties_filesel_sort_items_itemf); RNA_def_property_flag(prop, PROP_HIDDEN | PROP_SKIP_SAVE); } diff --git a/source/blender/windowmanager/intern/wm_operator_type.cc b/source/blender/windowmanager/intern/wm_operator_type.cc index e20d09e206a..63ec922aed4 100644 --- a/source/blender/windowmanager/intern/wm_operator_type.cc +++ b/source/blender/windowmanager/intern/wm_operator_type.cc @@ -95,7 +95,7 @@ static wmOperatorType *wm_operatortype_append__begin() BLI_assert(ot_prop_basic_count == -1); ot->srna = RNA_def_struct_ptr(&BLENDER_RNA, "", &RNA_OperatorProperties); - RNA_def_struct_property_tags(ot->srna, rna_enum_operator_property_tags); + RNA_def_struct_property_tags(ot->srna, rna_enum_operator_property_tag_items); /* Set the default i18n context now, so that opfunc can redefine it if needed! */ RNA_def_struct_translation_context(ot->srna, BLT_I18NCONTEXT_OPERATOR_DEFAULT); ot->translation_context = BLT_I18NCONTEXT_OPERATOR_DEFAULT;