From 6420d67623157d0ab03d20713980d3ab325b955c Mon Sep 17 00:00:00 2001 From: Hoshinova Date: Wed, 4 Oct 2023 15:03:46 +0200 Subject: [PATCH 1/3] -- Add option "Auto Add Fake User" to user preferences. --- scripts/startup/bl_operators/geometry_nodes.py | 1 + scripts/startup/bl_ui/space_userpref.py | 2 ++ source/blender/blenkernel/intern/lib_id.cc | 6 +++++- source/blender/blenkernel/intern/material.cc | 4 ++++ source/blender/blenloader/intern/versioning_userdef.cc | 2 +- source/blender/editors/render/render_shading.cc | 4 ++++ source/blender/makesdna/DNA_userdef_types.h | 2 +- source/blender/makesrna/intern/rna_userdef.cc | 5 +++++ 8 files changed, 23 insertions(+), 3 deletions(-) diff --git a/scripts/startup/bl_operators/geometry_nodes.py b/scripts/startup/bl_operators/geometry_nodes.py index ec3e8c3e900..c13738fa5f3 100644 --- a/scripts/startup/bl_operators/geometry_nodes.py +++ b/scripts/startup/bl_operators/geometry_nodes.py @@ -37,6 +37,7 @@ def geometry_node_group_empty_new(name): def geometry_node_group_empty_modifier_new(name): group = geometry_node_group_empty_new(data_("Geometry Nodes")) + group.use_fake_user = bpy.context.preferences.edit.node_auto_add_fake_user group.is_modifier = True return group diff --git a/scripts/startup/bl_ui/space_userpref.py b/scripts/startup/bl_ui/space_userpref.py index c4c5c91a983..6386ccaaf8e 100644 --- a/scripts/startup/bl_ui/space_userpref.py +++ b/scripts/startup/bl_ui/space_userpref.py @@ -518,6 +518,8 @@ class USERPREF_PT_edit_node_editor(EditingPanel, CenterAlignMixIn, Panel): prefs = context.preferences edit = prefs.edit + layout.prop(edit, "node_auto_add_fake_user") + col = layout.column(heading="Auto-Offset") row = col.row() row.prop(edit, "node_use_insert_offset", text="") diff --git a/source/blender/blenkernel/intern/lib_id.cc b/source/blender/blenkernel/intern/lib_id.cc index b181847e61c..b3341a97b53 100644 --- a/source/blender/blenkernel/intern/lib_id.cc +++ b/source/blender/blenkernel/intern/lib_id.cc @@ -70,7 +70,7 @@ #include "lib_intern.h" -//#define DEBUG_TIME +// #define DEBUG_TIME #ifdef DEBUG_TIME # include "PIL_time_utildefines.h" @@ -948,6 +948,10 @@ bool id_single_user(bContext *C, ID *id, PointerRNA *ptr, PropertyRNA *prop) * will also increment it, decrement it here. */ id_us_min(newid); + if (U.uiflag & USER_NODE_AUTO_FAKE_USER) { + id_fake_user_set(newid); + } + /* assign copy */ PointerRNA idptr = RNA_id_pointer_create(newid); RNA_property_pointer_set(ptr, prop, idptr, nullptr); diff --git a/source/blender/blenkernel/intern/material.cc b/source/blender/blenkernel/intern/material.cc index e0a4ab83477..08b6004696c 100644 --- a/source/blender/blenkernel/intern/material.cc +++ b/source/blender/blenkernel/intern/material.cc @@ -304,6 +304,10 @@ Material *BKE_material_add(Main *bmain, const char *name) ma = static_cast(BKE_id_new(bmain, ID_MA, name)); + if (U.uiflag & USER_NODE_AUTO_FAKE_USER) { + id_fake_user_set(&(ma->id)); + } + return ma; } diff --git a/source/blender/blenloader/intern/versioning_userdef.cc b/source/blender/blenloader/intern/versioning_userdef.cc index 7e785184212..dc472b2ea30 100644 --- a/source/blender/blenloader/intern/versioning_userdef.cc +++ b/source/blender/blenloader/intern/versioning_userdef.cc @@ -712,7 +712,7 @@ void blo_do_versions_userdef(UserDef *userdef) userdef->pixelsize = 1.0f; } /* Clear old userdef flag for "Camera Parent Lock". */ - userdef->uiflag &= ~USER_UIFLAG_UNUSED_3; + userdef->uiflag &= ~USER_NODE_AUTO_FAKE_USER; } if (!USER_VERSION_ATLEAST(292, 9)) { diff --git a/source/blender/editors/render/render_shading.cc b/source/blender/editors/render/render_shading.cc index 8191d91664e..8f82835f0cd 100644 --- a/source/blender/editors/render/render_shading.cc +++ b/source/blender/editors/render/render_shading.cc @@ -770,6 +770,10 @@ static int new_material_exec(bContext *C, wmOperator * /*op*/) Material *new_ma = (Material *)BKE_id_copy_ex( bmain, &ma->id, nullptr, LIB_ID_COPY_DEFAULT | LIB_ID_COPY_ACTIONS); ma = new_ma; + + if (U.uiflag & USER_NODE_AUTO_FAKE_USER) { + id_fake_user_set(&(ma->id)); + } } else { const char *name = DATA_("Material"); diff --git a/source/blender/makesdna/DNA_userdef_types.h b/source/blender/makesdna/DNA_userdef_types.h index 416e6168132..be6ae3d923b 100644 --- a/source/blender/makesdna/DNA_userdef_types.h +++ b/source/blender/makesdna/DNA_userdef_types.h @@ -1188,7 +1188,7 @@ typedef enum eUserpref_UI_Flag { USER_HIDE_DOT = (1 << 16), USER_SHOW_GIZMO_NAVIGATE = (1 << 17), USER_SHOW_VIEWPORTNAME = (1 << 18), - USER_UIFLAG_UNUSED_3 = (1 << 19), /* Cleared. */ + USER_NODE_AUTO_FAKE_USER = (1 << 19), /* Cleared. */ USER_ZOOM_TO_MOUSEPOS = (1 << 20), USER_SHOW_FPS = (1 << 21), USER_REGISTER_ALL_USERS = (1 << 22), diff --git a/source/blender/makesrna/intern/rna_userdef.cc b/source/blender/makesrna/intern/rna_userdef.cc index 032449edca7..2ef960dc300 100644 --- a/source/blender/makesrna/intern/rna_userdef.cc +++ b/source/blender/makesrna/intern/rna_userdef.cc @@ -5630,6 +5630,11 @@ static void rna_def_userdef_edit(BlenderRNA *brna) "Duplicate Node Tree", "Make copies of node groups when duplicating nodes in the node editor"); + prop = RNA_def_property(srna, "node_auto_add_fake_user", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, nullptr, "uiflag", USER_NODE_AUTO_FAKE_USER); + RNA_def_property_ui_text( + prop, "Auto Add Fake User", "Automatically add a fake user when creating new node groups"); + prop = RNA_def_property(srna, "node_use_insert_offset", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, nullptr, "uiflag", USER_NODE_AUTO_OFFSET); RNA_def_property_ui_text(prop, -- 2.30.2 From b8082d91ce92ec0477ba4db4dc5993fb6a5d2efb Mon Sep 17 00:00:00 2001 From: Hoshinova Date: Wed, 4 Oct 2023 16:06:01 +0200 Subject: [PATCH 2/3] -- Add World, Texture, Line Style. --- source/blender/blenkernel/intern/freestyle.cc | 6 ++++++ source/blender/blenkernel/intern/material.cc | 4 ---- .../blender/editors/render/render_shading.cc | 21 +++++++++++++++---- 3 files changed, 23 insertions(+), 8 deletions(-) diff --git a/source/blender/blenkernel/intern/freestyle.cc b/source/blender/blenkernel/intern/freestyle.cc index f93143d58fc..9c3662342ab 100644 --- a/source/blender/blenkernel/intern/freestyle.cc +++ b/source/blender/blenkernel/intern/freestyle.cc @@ -10,6 +10,7 @@ #include "DNA_collection_types.h" #include "DNA_freestyle_types.h" +#include "DNA_userdef_types.h" #include "BLI_blenlib.h" #include "BLI_math_rotation.h" @@ -169,6 +170,11 @@ FreestyleLineSet *BKE_freestyle_lineset_add(Main *bmain, FreestyleConfig *config BKE_freestyle_lineset_set_active_index(config, lineset_index); lineset->linestyle = BKE_linestyle_new(bmain, DATA_("LineStyle")); + + if (U.uiflag & USER_NODE_AUTO_FAKE_USER) { + id_fake_user_set(&(lineset->linestyle->id)); + } + lineset->flags |= FREESTYLE_LINESET_ENABLED; lineset->selection = FREESTYLE_SEL_VISIBILITY | FREESTYLE_SEL_EDGE_TYPES | FREESTYLE_SEL_IMAGE_BORDER; diff --git a/source/blender/blenkernel/intern/material.cc b/source/blender/blenkernel/intern/material.cc index 08b6004696c..e0a4ab83477 100644 --- a/source/blender/blenkernel/intern/material.cc +++ b/source/blender/blenkernel/intern/material.cc @@ -304,10 +304,6 @@ Material *BKE_material_add(Main *bmain, const char *name) ma = static_cast(BKE_id_new(bmain, ID_MA, name)); - if (U.uiflag & USER_NODE_AUTO_FAKE_USER) { - id_fake_user_set(&(ma->id)); - } - return ma; } diff --git a/source/blender/editors/render/render_shading.cc b/source/blender/editors/render/render_shading.cc index 8f82835f0cd..4c36269f09c 100644 --- a/source/blender/editors/render/render_shading.cc +++ b/source/blender/editors/render/render_shading.cc @@ -770,10 +770,6 @@ static int new_material_exec(bContext *C, wmOperator * /*op*/) Material *new_ma = (Material *)BKE_id_copy_ex( bmain, &ma->id, nullptr, LIB_ID_COPY_DEFAULT | LIB_ID_COPY_ACTIONS); ma = new_ma; - - if (U.uiflag & USER_NODE_AUTO_FAKE_USER) { - id_fake_user_set(&(ma->id)); - } } else { const char *name = DATA_("Material"); @@ -787,6 +783,10 @@ static int new_material_exec(bContext *C, wmOperator * /*op*/) ma->use_nodes = true; } + if (U.uiflag & USER_NODE_AUTO_FAKE_USER) { + id_fake_user_set(&(ma->id)); + } + if (prop) { if (ob != nullptr) { /* Add slot follows user-preferences for creating new slots, @@ -846,6 +846,10 @@ static int new_texture_exec(bContext *C, wmOperator * /*op*/) tex = BKE_texture_add(bmain, DATA_("Texture")); } + if (U.uiflag & USER_NODE_AUTO_FAKE_USER) { + id_fake_user_set(&(tex->id)); + } + /* hook into UI */ UI_context_active_but_prop_get_templateID(C, &ptr, &prop); @@ -903,6 +907,10 @@ static int new_world_exec(bContext *C, wmOperator * /*op*/) wo->use_nodes = true; } + if (U.uiflag & USER_NODE_AUTO_FAKE_USER) { + id_fake_user_set(&(wo->id)); + } + /* hook into UI */ UI_context_active_but_prop_get_templateID(C, &ptr, &prop); @@ -2263,6 +2271,11 @@ static int freestyle_linestyle_new_exec(bContext *C, wmOperator *op) else { lineset->linestyle = BKE_linestyle_new(bmain, DATA_("LineStyle")); } + + if (U.uiflag & USER_NODE_AUTO_FAKE_USER) { + id_fake_user_set(&(lineset->linestyle->id)); + } + DEG_id_tag_update(&lineset->linestyle->id, 0); WM_event_add_notifier(C, NC_LINESTYLE, lineset->linestyle); -- 2.30.2 From 949e05d5cad10ddc10d98b581358c1939aec9d4b Mon Sep 17 00:00:00 2001 From: Hoshinova Date: Sun, 8 Oct 2023 15:59:59 +0200 Subject: [PATCH 3/3] -- Change UI. --- .../startup/bl_operators/geometry_nodes.py | 2 +- scripts/startup/bl_ui/space_userpref.py | 17 ++++++++++-- source/blender/blenkernel/intern/freestyle.cc | 5 ---- source/blender/blenkernel/intern/lib_id.cc | 26 ++++++++++++++++++- .../blenloader/intern/versioning_userdef.cc | 8 +++--- .../blender/editors/object/object_modifier.cc | 4 +++ .../blender/editors/render/render_shading.cc | 10 +++---- source/blender/makesdna/DNA_userdef_types.h | 8 +++--- source/blender/makesrna/intern/rna_userdef.cc | 24 ++++++++++++++--- 9 files changed, 77 insertions(+), 27 deletions(-) diff --git a/scripts/startup/bl_operators/geometry_nodes.py b/scripts/startup/bl_operators/geometry_nodes.py index 0dbe69f98cc..faf1267bca8 100644 --- a/scripts/startup/bl_operators/geometry_nodes.py +++ b/scripts/startup/bl_operators/geometry_nodes.py @@ -37,7 +37,7 @@ def geometry_node_group_empty_new(name): def geometry_node_group_empty_modifier_new(name): group = geometry_node_group_empty_new(data_("Geometry Nodes")) - group.use_fake_user = bpy.context.preferences.edit.node_auto_add_fake_user + group.use_fake_user = bpy.context.preferences.edit.node_auto_add_fake_user_id_nt group.is_modifier = True return group diff --git a/scripts/startup/bl_ui/space_userpref.py b/scripts/startup/bl_ui/space_userpref.py index 34aaffa26b6..06df47f1399 100644 --- a/scripts/startup/bl_ui/space_userpref.py +++ b/scripts/startup/bl_ui/space_userpref.py @@ -445,6 +445,20 @@ class USERPREF_PT_edit_objects_duplicate_data(EditingPanel, CenterAlignMixIn, Pa row_label.active = getattr(edit, prop) +class USERPREF_PT_edit_data_blocks(EditingPanel, CenterAlignMixIn, Panel): + bl_label = "Data-Blocks" + + def draw_centered(self, context, layout): + prefs = context.preferences + edit = prefs.edit + + col = layout.column(heading="Auto Add Fake User") + col.prop(edit, "node_auto_add_fake_user_id_ma",text="Material") + col.prop(edit, "node_auto_add_fake_user_id_te",text="Texture") + col.prop(edit, "node_auto_add_fake_user_id_wo",text="World") + col.prop(edit, "node_auto_add_fake_user_id_nt",text="Geometry Nodes Group") + + class USERPREF_PT_edit_cursor(EditingPanel, CenterAlignMixIn, Panel): bl_label = "3D Cursor" @@ -518,8 +532,6 @@ class USERPREF_PT_edit_node_editor(EditingPanel, CenterAlignMixIn, Panel): prefs = context.preferences edit = prefs.edit - layout.prop(edit, "node_auto_add_fake_user") - col = layout.column(heading="Auto-Offset") row = col.row() row.prop(edit, "node_use_insert_offset", text="") @@ -2638,6 +2650,7 @@ classes = ( USERPREF_PT_edit_objects, USERPREF_PT_edit_objects_new, USERPREF_PT_edit_objects_duplicate_data, + USERPREF_PT_edit_data_blocks, USERPREF_PT_edit_cursor, USERPREF_PT_edit_annotations, USERPREF_PT_edit_weight_paint, diff --git a/source/blender/blenkernel/intern/freestyle.cc b/source/blender/blenkernel/intern/freestyle.cc index 9c3662342ab..13a06354d51 100644 --- a/source/blender/blenkernel/intern/freestyle.cc +++ b/source/blender/blenkernel/intern/freestyle.cc @@ -170,11 +170,6 @@ FreestyleLineSet *BKE_freestyle_lineset_add(Main *bmain, FreestyleConfig *config BKE_freestyle_lineset_set_active_index(config, lineset_index); lineset->linestyle = BKE_linestyle_new(bmain, DATA_("LineStyle")); - - if (U.uiflag & USER_NODE_AUTO_FAKE_USER) { - id_fake_user_set(&(lineset->linestyle->id)); - } - lineset->flags |= FREESTYLE_LINESET_ENABLED; lineset->selection = FREESTYLE_SEL_VISIBILITY | FREESTYLE_SEL_EDGE_TYPES | FREESTYLE_SEL_IMAGE_BORDER; diff --git a/source/blender/blenkernel/intern/lib_id.cc b/source/blender/blenkernel/intern/lib_id.cc index b3341a97b53..42b66e4d13c 100644 --- a/source/blender/blenkernel/intern/lib_id.cc +++ b/source/blender/blenkernel/intern/lib_id.cc @@ -948,7 +948,31 @@ bool id_single_user(bContext *C, ID *id, PointerRNA *ptr, PropertyRNA *prop) * will also increment it, decrement it here. */ id_us_min(newid); - if (U.uiflag & USER_NODE_AUTO_FAKE_USER) { + bool set_fake_user = false; + switch (GS(id->name)) { + case ID_MA: { + set_fake_user = U.uiflag & USER_NODE_AUTO_ADD_FAKE_USER_ID_MA; + break; + } + case ID_TE: { + set_fake_user = U.uiflag & USER_NODE_AUTO_ADD_FAKE_USER_ID_TE; + break; + } + case ID_WO: { + set_fake_user = U.uiflag & USER_NODE_AUTO_ADD_FAKE_USER_ID_WO; + break; + } + case ID_NT: { + set_fake_user = U.uiflag & USER_NODE_AUTO_ADD_FAKE_USER_ID_NT; + break; + } + default: { + set_fake_user = false; + break; + } + } + + if (set_fake_user) { id_fake_user_set(newid); } diff --git a/source/blender/blenloader/intern/versioning_userdef.cc b/source/blender/blenloader/intern/versioning_userdef.cc index dc472b2ea30..d8337cb2222 100644 --- a/source/blender/blenloader/intern/versioning_userdef.cc +++ b/source/blender/blenloader/intern/versioning_userdef.cc @@ -576,8 +576,8 @@ void blo_do_versions_userdef(UserDef *userdef) } if (!USER_VERSION_ATLEAST(280, 44)) { - userdef->uiflag &= ~(USER_NO_MULTITOUCH_GESTURES | USER_UIFLAG_UNUSED_1); - userdef->uiflag2 &= ~(USER_UIFLAG2_UNUSED_0); + userdef->uiflag &= ~(USER_NO_MULTITOUCH_GESTURES | USER_NODE_AUTO_ADD_FAKE_USER_ID_MA); + userdef->uiflag2 &= ~(USER_NODE_AUTO_ADD_FAKE_USER_ID_NT); userdef->gp_settings &= ~(GP_PAINT_UNUSED_0); } @@ -712,7 +712,7 @@ void blo_do_versions_userdef(UserDef *userdef) userdef->pixelsize = 1.0f; } /* Clear old userdef flag for "Camera Parent Lock". */ - userdef->uiflag &= ~USER_NODE_AUTO_FAKE_USER; + userdef->uiflag &= ~USER_NODE_AUTO_ADD_FAKE_USER_ID_TE; } if (!USER_VERSION_ATLEAST(292, 9)) { @@ -874,7 +874,7 @@ void blo_do_versions_userdef(UserDef *userdef) if (!USER_VERSION_ATLEAST(400, 24)) { /* Clear deprecated USER_MENUFIXEDORDER user flag for reuse. */ - userdef->uiflag &= ~USER_UIFLAG_UNUSED_4; + userdef->uiflag &= ~USER_NODE_AUTO_ADD_FAKE_USER_ID_WO; } if (!USER_VERSION_ATLEAST(400, 26)) { diff --git a/source/blender/editors/object/object_modifier.cc b/source/blender/editors/object/object_modifier.cc index a6091788f20..603716af386 100644 --- a/source/blender/editors/object/object_modifier.cc +++ b/source/blender/editors/object/object_modifier.cc @@ -3697,6 +3697,10 @@ static int geometry_node_tree_copy_assign_exec(bContext *C, wmOperator * /*op*/) nmd->node_group = new_tree; id_us_min(&tree->id); + if (U.uiflag & USER_NODE_AUTO_ADD_FAKE_USER_ID_NT) { + id_fake_user_set(&(new_tree->id)); + } + DEG_id_tag_update(&ob->id, ID_RECALC_GEOMETRY); DEG_relations_tag_update(bmain); WM_event_add_notifier(C, NC_OBJECT | ND_MODIFIER, ob); diff --git a/source/blender/editors/render/render_shading.cc b/source/blender/editors/render/render_shading.cc index 4c36269f09c..c9a93b4cae7 100644 --- a/source/blender/editors/render/render_shading.cc +++ b/source/blender/editors/render/render_shading.cc @@ -783,7 +783,7 @@ static int new_material_exec(bContext *C, wmOperator * /*op*/) ma->use_nodes = true; } - if (U.uiflag & USER_NODE_AUTO_FAKE_USER) { + if (U.uiflag & USER_NODE_AUTO_ADD_FAKE_USER_ID_MA) { id_fake_user_set(&(ma->id)); } @@ -846,7 +846,7 @@ static int new_texture_exec(bContext *C, wmOperator * /*op*/) tex = BKE_texture_add(bmain, DATA_("Texture")); } - if (U.uiflag & USER_NODE_AUTO_FAKE_USER) { + if (U.uiflag & USER_NODE_AUTO_ADD_FAKE_USER_ID_TE) { id_fake_user_set(&(tex->id)); } @@ -907,7 +907,7 @@ static int new_world_exec(bContext *C, wmOperator * /*op*/) wo->use_nodes = true; } - if (U.uiflag & USER_NODE_AUTO_FAKE_USER) { + if (U.uiflag & USER_NODE_AUTO_ADD_FAKE_USER_ID_WO) { id_fake_user_set(&(wo->id)); } @@ -2272,10 +2272,6 @@ static int freestyle_linestyle_new_exec(bContext *C, wmOperator *op) lineset->linestyle = BKE_linestyle_new(bmain, DATA_("LineStyle")); } - if (U.uiflag & USER_NODE_AUTO_FAKE_USER) { - id_fake_user_set(&(lineset->linestyle->id)); - } - DEG_id_tag_update(&lineset->linestyle->id, 0); WM_event_add_notifier(C, NC_LINESTYLE, lineset->linestyle); diff --git a/source/blender/makesdna/DNA_userdef_types.h b/source/blender/makesdna/DNA_userdef_types.h index be6ae3d923b..6e09ef9a30c 100644 --- a/source/blender/makesdna/DNA_userdef_types.h +++ b/source/blender/makesdna/DNA_userdef_types.h @@ -1169,7 +1169,7 @@ typedef enum eWalkNavigation_Flag { /** #UserDef.uiflag */ typedef enum eUserpref_UI_Flag { USER_NO_MULTITOUCH_GESTURES = (1 << 0), - USER_UIFLAG_UNUSED_1 = (1 << 1), /* cleared */ + USER_NODE_AUTO_ADD_FAKE_USER_ID_MA = (1 << 1), /* cleared */ USER_WHEELZOOMDIR = (1 << 2), USER_FILTERFILEEXTS = (1 << 3), USER_DRAWVIEWINFO = (1 << 4), @@ -1188,11 +1188,11 @@ typedef enum eUserpref_UI_Flag { USER_HIDE_DOT = (1 << 16), USER_SHOW_GIZMO_NAVIGATE = (1 << 17), USER_SHOW_VIEWPORTNAME = (1 << 18), - USER_NODE_AUTO_FAKE_USER = (1 << 19), /* Cleared. */ + USER_NODE_AUTO_ADD_FAKE_USER_ID_TE = (1 << 19), /* Cleared. */ USER_ZOOM_TO_MOUSEPOS = (1 << 20), USER_SHOW_FPS = (1 << 21), USER_REGISTER_ALL_USERS = (1 << 22), - USER_UIFLAG_UNUSED_4 = (1 << 23), /* Cleared. */ + USER_NODE_AUTO_ADD_FAKE_USER_ID_WO = (1 << 23), /* Cleared. */ USER_CONTINUOUS_MOUSE = (1 << 24), USER_ZOOM_INVERT = (1 << 25), USER_ZOOM_HORIZ = (1 << 26), /* for CONTINUE and DOLLY zoom */ @@ -1213,7 +1213,7 @@ typedef enum eUserpref_UI_Flag { * \note don't add new flags here, use 'uiflag' which has flags free. */ typedef enum eUserpref_UI_Flag2 { - USER_UIFLAG2_UNUSED_0 = (1 << 0), /* cleared */ + USER_NODE_AUTO_ADD_FAKE_USER_ID_NT = (1 << 0), /* cleared */ USER_REGION_OVERLAP = (1 << 1), USER_UIFLAG2_UNUSED_2 = (1 << 2), USER_UIFLAG2_UNUSED_3 = (1 << 3), /* dirty */ diff --git a/source/blender/makesrna/intern/rna_userdef.cc b/source/blender/makesrna/intern/rna_userdef.cc index a75606ab68e..8feb516db59 100644 --- a/source/blender/makesrna/intern/rna_userdef.cc +++ b/source/blender/makesrna/intern/rna_userdef.cc @@ -5630,10 +5630,28 @@ static void rna_def_userdef_edit(BlenderRNA *brna) "Duplicate Node Tree", "Make copies of node groups when duplicating nodes in the node editor"); - prop = RNA_def_property(srna, "node_auto_add_fake_user", PROP_BOOLEAN, PROP_NONE); - RNA_def_property_boolean_sdna(prop, nullptr, "uiflag", USER_NODE_AUTO_FAKE_USER); + prop = RNA_def_property(srna, "node_auto_add_fake_user_id_ma", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, nullptr, "uiflag", USER_NODE_AUTO_ADD_FAKE_USER_ID_MA); + RNA_def_property_ui_text(prop, + "Auto Add Fake User Material", + "Automatically add a fake user when creating new materials"); + + prop = RNA_def_property(srna, "node_auto_add_fake_user_id_te", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, nullptr, "uiflag", USER_NODE_AUTO_ADD_FAKE_USER_ID_TE); + RNA_def_property_ui_text(prop, + "Auto Add Fake User Texture", + "Automatically add a fake user when creating new textures"); + + prop = RNA_def_property(srna, "node_auto_add_fake_user_id_wo", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, nullptr, "uiflag", USER_NODE_AUTO_ADD_FAKE_USER_ID_WO); RNA_def_property_ui_text( - prop, "Auto Add Fake User", "Automatically add a fake user when creating new node groups"); + prop, "Auto Add Fake User World", "Automatically add a fake user when creating new worlds"); + + prop = RNA_def_property(srna, "node_auto_add_fake_user_id_nt", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, nullptr, "uiflag", USER_NODE_AUTO_ADD_FAKE_USER_ID_NT); + RNA_def_property_ui_text(prop, + "Auto Add Fake User Geometry Node Group", + "Automatically add a fake user when creating new geometry node groups"); prop = RNA_def_property(srna, "node_use_insert_offset", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, nullptr, "uiflag", USER_NODE_AUTO_OFFSET); -- 2.30.2