diff options
author | Nathan Craddock <nzcraddock@gmail.com> | 2020-09-16 00:14:32 +0300 |
---|---|---|
committer | Nathan Craddock <nzcraddock@gmail.com> | 2020-09-16 00:29:19 +0300 |
commit | 583354e9e989a66a684053e16bcbd950cac91428 (patch) | |
tree | faa99407de6a8f85114ea53166fb45ff00233477 /source/blender/editors/object/object_modifier.c | |
parent | f4a2024c448568badb44709b342d4f47002c456b (diff) |
Modifiers: Add link and copy functions
Adds functions to copy a modifier between objects, and an ED_ level
function for linking modifiers between objects. This will be used in
outliner modifier drag and drop.
These functions support both regular and grease pencil modifiers.
Differential Revision: https://developer.blender.org/D8642
Diffstat (limited to 'source/blender/editors/object/object_modifier.c')
-rw-r--r-- | source/blender/editors/object/object_modifier.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/source/blender/editors/object/object_modifier.c b/source/blender/editors/object/object_modifier.c index 99644c8f233..370667391c5 100644 --- a/source/blender/editors/object/object_modifier.c +++ b/source/blender/editors/object/object_modifier.c @@ -516,6 +516,20 @@ bool ED_object_modifier_move_to_index(ReportList *reports, return true; } +void ED_object_modifier_link(bContext *C, Object *ob_dst, Object *ob_src) +{ + BKE_object_link_modifiers(ob_dst, ob_src); + WM_event_add_notifier(C, NC_OBJECT | ND_MODIFIER, ob_dst); + DEG_id_tag_update(&ob_dst->id, ID_RECALC_TRANSFORM | ID_RECALC_GEOMETRY | ID_RECALC_ANIMATION); +} + +void ED_object_modifier_copy_to_object(Object *ob_dst, Object *ob_src, ModifierData *md) +{ + BKE_object_copy_modifier(ob_dst, ob_src, md); + WM_main_add_notifier(NC_OBJECT | ND_MODIFIER, ob_dst); + DEG_id_tag_update(&ob_dst->id, ID_RECALC_TRANSFORM | ID_RECALC_GEOMETRY | ID_RECALC_ANIMATION); +} + bool ED_object_modifier_convert(ReportList *UNUSED(reports), Main *bmain, Depsgraph *depsgraph, |