diff options
author | Philipp Oeser <info@graphics-engineer.com> | 2019-10-23 13:28:32 +0300 |
---|---|---|
committer | Philipp Oeser <info@graphics-engineer.com> | 2020-03-03 12:01:20 +0300 |
commit | b454a1223317c8d05bc09a745f85eae22be658e8 (patch) | |
tree | 22236e3119a1866fd703228703c1433b8cbbc7db /source/blender/editors/gpencil | |
parent | ee7034949fd8a44e906f26cc18bc30af340c2ab9 (diff) |
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
Diffstat (limited to 'source/blender/editors/gpencil')
-rw-r--r-- | source/blender/editors/gpencil/gpencil_edit.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/source/blender/editors/gpencil/gpencil_edit.c b/source/blender/editors/gpencil/gpencil_edit.c index d710e59c569..ee4a26475b9 100644 --- a/source/blender/editors/gpencil/gpencil_edit.c +++ b/source/blender/editors/gpencil/gpencil_edit.c @@ -4092,8 +4092,11 @@ static int gp_stroke_separate_exec(bContext *C, wmOperator *op) const bool is_multiedit = (bool)GPENCIL_MULTIEDIT_SESSIONS_ON(gpd_src); - /* create a new object */ - base_new = ED_object_add_duplicate(bmain, scene, view_layer, base_old, 0); + /* Create a new object. */ + /* Take into account user preferences for duplicating actions. */ + short dupflag = (U.dupflag & USER_DUP_ACT); + + base_new = ED_object_add_duplicate(bmain, scene, view_layer, base_old, dupflag); ob_dst = base_new->object; ob_dst->mode = OB_MODE_OBJECT; /* create new grease pencil datablock */ |