diff options
Diffstat (limited to 'source/blender/editors')
-rw-r--r-- | source/blender/editors/include/ED_object.h | 6 | ||||
-rw-r--r-- | source/blender/editors/object/object_gpencil_modifier.c | 7 | ||||
-rw-r--r-- | source/blender/editors/object/object_modifier.c | 14 |
3 files changed, 27 insertions, 0 deletions
diff --git a/source/blender/editors/include/ED_object.h b/source/blender/editors/include/ED_object.h index fcf18f306e1..45e23cadaaa 100644 --- a/source/blender/editors/include/ED_object.h +++ b/source/blender/editors/include/ED_object.h @@ -429,6 +429,10 @@ int ED_object_modifier_copy(struct ReportList *reports, struct Scene *scene, struct Object *ob, struct ModifierData *md); +void ED_object_modifier_link(struct bContext *C, struct Object *ob_dst, struct Object *ob_src); +void ED_object_modifier_copy_to_object(struct Object *ob_dst, + struct Object *ob_src, + struct ModifierData *md); bool ED_object_iter_other(struct Main *bmain, struct Object *orig_ob, @@ -469,6 +473,8 @@ int ED_object_gpencil_modifier_apply(struct Main *bmain, int ED_object_gpencil_modifier_copy(struct ReportList *reports, struct Object *ob, struct GpencilModifierData *md); +void ED_object_gpencil_modifier_copy_to_object(struct Object *ob_dst, + struct GpencilModifierData *md); /* object_shader_fx.c */ struct ShaderFxData *ED_object_shaderfx_add(struct ReportList *reports, diff --git a/source/blender/editors/object/object_gpencil_modifier.c b/source/blender/editors/object/object_gpencil_modifier.c index e9b430ee54b..eed3c7f419d 100644 --- a/source/blender/editors/object/object_gpencil_modifier.c +++ b/source/blender/editors/object/object_gpencil_modifier.c @@ -322,6 +322,13 @@ int ED_object_gpencil_modifier_copy(ReportList *reports, Object *ob, GpencilModi return 1; } +void ED_object_gpencil_modifier_copy_to_object(Object *ob_dst, GpencilModifierData *md) +{ + BKE_object_copy_gpencil_modifier(ob_dst, 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); +} + /************************ add modifier operator *********************/ static int gpencil_modifier_add_exec(bContext *C, wmOperator *op) 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, |