From b454a1223317c8d05bc09a745f85eae22be658e8 Mon Sep 17 00:00:00 2001 From: Philipp Oeser Date: Wed, 23 Oct 2019 12:28:32 +0200 Subject: Separate operators (mesh/curve/armature/gpencil): take user preferences into account for duplicating actions Previously actions remained linked after duplication, now this is based on the User Preferences (PreferencesEdit.use_duplicate_action). note: default is ON here, so this changes default behavior of separate operators. First intuition was to respect _all_ preferences here (e.g. also duplicating materials if chosen in the User Preferences) but after consideration this is probably not what the User would expect from such 'modeling' opertions (e.g. separate by loose parts resulting in possibly many duplicate materials) Fixes T71038 Maniphest Tasks: T71038 Differential Revision: https://developer.blender.org/D6120 --- source/blender/editors/armature/armature_relations.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'source/blender/editors/armature/armature_relations.c') diff --git a/source/blender/editors/armature/armature_relations.c b/source/blender/editors/armature/armature_relations.c index ae0501d14ef..b800714cd14 100644 --- a/source/blender/editors/armature/armature_relations.c +++ b/source/blender/editors/armature/armature_relations.c @@ -667,8 +667,9 @@ static int separate_armature_exec(bContext *C, wmOperator *op) /* 2) duplicate base */ - /* only duplicate linked armature */ - Base *base_new = ED_object_add_duplicate(bmain, scene, view_layer, base_old, USER_DUP_ARM); + /* Only duplicate linked armature but take into account user preferences for duplicating actions. */ + short dupflag = USER_DUP_ARM | (U.dupflag & USER_DUP_ACT); + Base *base_new = ED_object_add_duplicate(bmain, scene, view_layer, base_old, dupflag); Object *ob_new = base_new->object; DEG_relations_tag_update(bmain); -- cgit v1.2.3