Fix T80945: Build modifier not updating after outliner copy
Build modifiers linked or copied to objects from the outliner would not animate until the file was saved and reopened due to a missing depsgraph relations tag.
This commit is contained in:
@@ -430,7 +430,8 @@ int ED_object_modifier_copy(struct ReportList *reports,
|
||||
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,
|
||||
void ED_object_modifier_copy_to_object(struct bContext *C,
|
||||
struct Object *ob_dst,
|
||||
struct Object *ob_src,
|
||||
struct ModifierData *md);
|
||||
|
||||
|
||||
@@ -521,13 +521,22 @@ 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);
|
||||
|
||||
Main *bmain = CTX_data_main(C);
|
||||
DEG_relations_tag_update(bmain);
|
||||
}
|
||||
|
||||
void ED_object_modifier_copy_to_object(Object *ob_dst, Object *ob_src, ModifierData *md)
|
||||
void ED_object_modifier_copy_to_object(bContext *C,
|
||||
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);
|
||||
|
||||
Main *bmain = CTX_data_main(C);
|
||||
DEG_relations_tag_update(bmain);
|
||||
}
|
||||
|
||||
bool ED_object_modifier_convert(ReportList *UNUSED(reports),
|
||||
|
||||
@@ -964,7 +964,7 @@ static void datastack_drop_copy(bContext *C, StackDropData *drop_data)
|
||||
}
|
||||
else if (drop_data->ob_parent->type != OB_GPENCIL && ob_dst->type != OB_GPENCIL) {
|
||||
ED_object_modifier_copy_to_object(
|
||||
ob_dst, drop_data->ob_parent, drop_data->drag_directdata);
|
||||
C, ob_dst, drop_data->ob_parent, drop_data->drag_directdata);
|
||||
}
|
||||
break;
|
||||
case TSE_CONSTRAINT:
|
||||
|
||||
Reference in New Issue
Block a user