From 81b53aa5079f4a7275fe499c2f7c99ced3671820 Mon Sep 17 00:00:00 2001 From: Hans Goudey Date: Thu, 16 Feb 2023 11:17:02 -0500 Subject: [PATCH 1/2] WM: Add option for clearing asset data to append operator When appending assets it often isn't expected for the asset tags and meta-data to be included. Add an option to the append operator to disable appending the asset data, exposing existing internal options. --- source/blender/windowmanager/intern/wm_files_link.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/source/blender/windowmanager/intern/wm_files_link.c b/source/blender/windowmanager/intern/wm_files_link.c index bbe53bf7355..3af7d2f26f0 100644 --- a/source/blender/windowmanager/intern/wm_files_link.c +++ b/source/blender/windowmanager/intern/wm_files_link.c @@ -141,6 +141,9 @@ static int wm_link_append_flag(wmOperator *op) if (RNA_boolean_get(op->ptr, "do_reuse_local_id")) { flag |= BLO_LIBLINK_APPEND_LOCAL_ID_REUSE; } + if (RNA_boolean_get(op->ptr, "clear_asset_data")) { + flag |= BLO_LIBLINK_APPEND_ASSET_DATA_CLEAR; + } } if (RNA_boolean_get(op->ptr, "instance_collections")) { flag |= BLO_LIBLINK_COLLECTION_INSTANCE; @@ -400,6 +403,12 @@ static void wm_link_append_properties_common(wmOperatorType *ot, bool is_link) "Re-Use Local Data", "Try to re-use previously matching appended data-blocks instead of appending a new copy"); RNA_def_property_flag(prop, PROP_SKIP_SAVE | PROP_HIDDEN); + prop = RNA_def_boolean(ot->srna, + "clear_asset_data", + false, + "Clear Asset Data", + "Don't add asset meta-data or tags from the original data-block"); + RNA_def_property_flag(prop, PROP_SKIP_SAVE | PROP_HIDDEN); prop = RNA_def_boolean(ot->srna, "autoselect", true, "Select", "Select new objects"); RNA_def_property_flag(prop, PROP_SKIP_SAVE); -- 2.30.2 From ce22960cdf0b4f8064d80702c86029aafdbfb44b Mon Sep 17 00:00:00 2001 From: Hans Goudey Date: Thu, 16 Feb 2023 11:17:21 -0500 Subject: [PATCH 2/2] Fix #104785: Quick fur keeps asset status of appended node groups Use the recently added "clear_asset_data" option in the append operator. --- release/scripts/startup/bl_operators/object_quick_effects.py | 1 + 1 file changed, 1 insertion(+) diff --git a/release/scripts/startup/bl_operators/object_quick_effects.py b/release/scripts/startup/bl_operators/object_quick_effects.py index 06f44336972..dc3edcd9b75 100644 --- a/release/scripts/startup/bl_operators/object_quick_effects.py +++ b/release/scripts/startup/bl_operators/object_quick_effects.py @@ -111,6 +111,7 @@ class QuickFur(ObjectModeOperator, Operator): bpy.ops.wm.append(directory=assets_directory, filename=name, use_recursive=True, + clear_asset_data=True, do_reuse_local_id=True) generate_group = bpy.data.node_groups["Generate Hair Curves"] interpolate_group = bpy.data.node_groups["Interpolate Hair Curves"] -- 2.30.2