diff --git a/source/blender/makesrna/intern/rna_main_api.cc b/source/blender/makesrna/intern/rna_main_api.cc index 456302c8879..c66cc999cbe 100644 --- a/source/blender/makesrna/intern/rna_main_api.cc +++ b/source/blender/makesrna/intern/rna_main_api.cc @@ -1045,11 +1045,6 @@ void RNA_def_main_node_groups(BlenderRNA *brna, PropertyRNA *cprop) FunctionRNA *func; PropertyRNA *parm; - static const EnumPropertyItem dummy_items[] = { - {0, "DUMMY", 0, "", ""}, - {0, nullptr, 0, nullptr, nullptr}, - }; - RNA_def_property_srna(cprop, "BlendDataNodeTrees"); srna = RNA_def_struct(brna, "BlendDataNodeTrees", nullptr); RNA_def_struct_sdna(srna, "Main"); @@ -1059,9 +1054,10 @@ void RNA_def_main_node_groups(BlenderRNA *brna, PropertyRNA *cprop) RNA_def_function_ui_description(func, "Add a new node tree to the main database"); parm = RNA_def_string(func, "name", "NodeGroup", 0, "", "New name for the data-block"); RNA_def_parameter_flags(parm, PropertyFlag(0), PARM_REQUIRED); - parm = RNA_def_enum(func, "type", dummy_items, 0, "Type", "The type of node_group to add"); + parm = RNA_def_enum( + func, "type", rna_enum_dummy_DEFAULT_items, 0, "Type", "The type of node_group to add"); RNA_def_property_enum_funcs(parm, nullptr, nullptr, "rna_Main_nodetree_type_itemf"); - RNA_def_parameter_flags(parm, PropertyFlag(0), PARM_REQUIRED); + RNA_def_parameter_flags(parm, PROP_ENUM_NO_CONTEXT, PARM_REQUIRED); /* return type */ parm = RNA_def_pointer(func, "tree", "NodeTree", "", "New node tree data-block"); RNA_def_function_return(func, parm); diff --git a/source/blender/makesrna/intern/rna_space.cc b/source/blender/makesrna/intern/rna_space.cc index c69f981a833..f4c1a0b288f 100644 --- a/source/blender/makesrna/intern/rna_space.cc +++ b/source/blender/makesrna/intern/rna_space.cc @@ -2735,7 +2735,7 @@ static void rna_SpaceNodeEditor_cursor_location_set(PointerRNA *ptr, const float const EnumPropertyItem *RNA_enum_node_tree_types_itemf_impl(bContext *C, bool *r_free) { - return rna_node_tree_type_itemf(C, rna_SpaceNodeEditor_tree_type_poll, r_free); + return rna_node_tree_type_itemf(C, C ? rna_SpaceNodeEditor_tree_type_poll : nullptr, r_free); } static const EnumPropertyItem *rna_SpaceNodeEditor_tree_type_itemf(bContext *C, @@ -7912,11 +7912,6 @@ static void rna_def_space_node(BlenderRNA *brna) {0, nullptr, 0, nullptr, nullptr}, }; - static const EnumPropertyItem dummy_items[] = { - {0, "DUMMY", 0, "", ""}, - {0, nullptr, 0, nullptr, nullptr}, - }; - srna = RNA_def_struct(brna, "SpaceNodeEditor", "Space"); RNA_def_struct_sdna(srna, "SpaceNode"); RNA_def_struct_ui_text(srna, "Space Node Editor", "Node editor space data"); @@ -7924,11 +7919,12 @@ static void rna_def_space_node(BlenderRNA *brna) rna_def_space_generic_show_region_toggles(srna, (1 << RGN_TYPE_TOOLS) | (1 << RGN_TYPE_UI)); prop = RNA_def_property(srna, "tree_type", PROP_ENUM, PROP_NONE); - RNA_def_property_enum_items(prop, dummy_items); + RNA_def_property_enum_items(prop, rna_enum_dummy_DEFAULT_items); RNA_def_property_enum_funcs(prop, "rna_SpaceNodeEditor_tree_type_get", "rna_SpaceNodeEditor_tree_type_set", "rna_SpaceNodeEditor_tree_type_itemf"); + RNA_def_property_flag(prop, PROP_ENUM_NO_CONTEXT); RNA_def_property_ui_text(prop, "Tree Type", "Node tree type to display and edit"); RNA_def_property_update(prop, NC_SPACE | ND_SPACE_NODE, nullptr);