From d675415eef9f565b1828f48dfe874321af1c4af8 Mon Sep 17 00:00:00 2001 From: Luca Rood Date: Thu, 8 Jun 2017 10:14:53 +0200 Subject: Replace all old DAG calls with direct calls to new DEG and remove BKE_depsgraph.h This removes BKE_depsgraph.h and depsgraph.c --- source/blender/editors/object/object_add.c | 58 +++++++++-------- source/blender/editors/object/object_bake.c | 7 +- source/blender/editors/object/object_bake_api.c | 3 +- source/blender/editors/object/object_constraint.c | 42 ++++++------ .../blender/editors/object/object_data_transfer.c | 9 +-- source/blender/editors/object/object_edit.c | 32 +++++----- source/blender/editors/object/object_facemap_ops.c | 16 ++--- source/blender/editors/object/object_group.c | 13 ++-- source/blender/editors/object/object_hook.c | 16 +++-- source/blender/editors/object/object_lattice.c | 7 +- source/blender/editors/object/object_modifier.c | 64 ++++++++++--------- source/blender/editors/object/object_relations.c | 74 +++++++++++----------- source/blender/editors/object/object_shapekey.c | 20 +++--- source/blender/editors/object/object_transform.c | 21 +++--- source/blender/editors/object/object_vgroup.c | 53 ++++++++-------- 15 files changed, 227 insertions(+), 208 deletions(-) (limited to 'source/blender/editors/object') diff --git a/source/blender/editors/object/object_add.c b/source/blender/editors/object/object_add.c index 068caee4e1a..3c64117a2d8 100644 --- a/source/blender/editors/object/object_add.c +++ b/source/blender/editors/object/object_add.c @@ -67,7 +67,6 @@ #include "BKE_context.h" #include "BKE_constraint.h" #include "BKE_curve.h" -#include "BKE_depsgraph.h" #include "BKE_DerivedMesh.h" #include "BKE_displist.h" #include "BKE_effect.h" @@ -94,6 +93,9 @@ #include "BKE_speaker.h" #include "BKE_texture.h" +#include "DEG_depsgraph.h" +#include "DEG_depsgraph_build.h" + #include "RNA_access.h" #include "RNA_define.h" #include "RNA_enum_types.h" @@ -433,8 +435,8 @@ Object *ED_object_add_type( ob->gameflag &= ~(OB_SENSOR | OB_RIGID_BODY | OB_SOFT_BODY | OB_COLLISION | OB_CHARACTER | OB_OCCLUDER | OB_DYNAMIC | OB_NAVMESH); /* copied from rna_object.c */ } - DAG_id_type_tag(bmain, ID_OB); - DAG_relations_tag_update(bmain); + DEG_id_type_tag(bmain, ID_OB); + DEG_relations_tag_update(bmain); if (ob->data) { ED_render_id_flush_update(bmain, ob->data); } @@ -445,7 +447,7 @@ Object *ED_object_add_type( WM_event_add_notifier(C, NC_SCENE | ND_LAYER_CONTENT, scene); /* TODO(sergey): Use proper flag for tagging here. */ - DAG_id_tag_update(&scene->id, 0); + DEG_id_tag_update(&scene->id, 0); return ob; } @@ -541,7 +543,7 @@ static int effector_add_exec(bContext *C, wmOperator *op) ob->pd = object_add_collision_fields(type); - DAG_relations_tag_update(CTX_data_main(C)); + DEG_relations_tag_update(CTX_data_main(C)); return OPERATOR_FINISHED; } @@ -646,7 +648,7 @@ static int object_metaball_add_exec(bContext *C, wmOperator *op) newob = true; } else { - DAG_id_tag_update(&obedit->id, OB_RECALC_DATA); + DEG_id_tag_update(&obedit->id, OB_RECALC_DATA); } ED_object_new_primitive_matrix(C, obedit, loc, rot, mat); @@ -750,7 +752,7 @@ static int object_armature_add_exec(bContext *C, wmOperator *op) newob = true; } else { - DAG_id_tag_update(&obedit->id, OB_RECALC_DATA); + DEG_id_tag_update(&obedit->id, OB_RECALC_DATA); } if (obedit == NULL) { @@ -1008,7 +1010,7 @@ static int group_instance_add_exec(bContext *C, wmOperator *op) id_us_plus(&group->id); /* works without this except if you try render right after, see: 22027 */ - DAG_relations_tag_update(bmain); + DEG_relations_tag_update(bmain); WM_event_add_notifier(C, NC_SCENE | ND_OB_ACTIVE, scene); @@ -1128,7 +1130,7 @@ void ED_base_object_free_and_unlink(Main *bmain, Scene *scene, Object *ob) object_delete_check_glsl_update(ob); BKE_collections_object_remove(bmain, scene, ob, true); - DAG_id_type_tag(bmain, ID_OB); + DEG_id_type_tag(bmain, ID_OB); } static int object_delete_exec(bContext *C, wmOperator *op) @@ -1215,7 +1217,7 @@ static int object_delete_exec(bContext *C, wmOperator *op) if (scene->id.tag & LIB_TAG_DOIT) { scene->id.tag &= ~LIB_TAG_DOIT; - DAG_relations_tag_update(bmain); + DEG_relations_tag_update(bmain); WM_event_add_notifier(C, NC_SCENE | ND_OB_ACTIVE, scene); WM_event_add_notifier(C, NC_SCENE | ND_LAYER_CONTENT, scene); @@ -1408,7 +1410,7 @@ static void make_object_duplilist_real(bContext *C, Scene *scene, Base *base, set_sca_new_poins_ob(ob); BKE_id_clear_newpoin(&dob->ob->id); - DAG_id_tag_update(&ob->id, OB_RECALC_DATA); + DEG_id_tag_update(&ob->id, OB_RECALC_DATA); } if (use_hierarchy) { @@ -1462,7 +1464,7 @@ static void make_object_duplilist_real(bContext *C, Scene *scene, Base *base, BKE_object_apply_mat4(ob_dst, dob->mat, false, true); /* to set ob_dst->orig and in case theres any other discrepicies */ - DAG_id_tag_update(&ob_dst->id, OB_RECALC_OB); + DEG_id_tag_update(&ob_dst->id, OB_RECALC_OB); } } } @@ -1479,7 +1481,7 @@ static void make_object_duplilist_real(bContext *C, Scene *scene, Base *base, /* similer to the code above, see comments */ invert_m4_m4(ob_dst->parentinv, dob->mat); BKE_object_apply_mat4(ob_dst, dob->mat, false, true); - DAG_id_tag_update(&ob_dst->id, OB_RECALC_OB); + DEG_id_tag_update(&ob_dst->id, OB_RECALC_OB); } } @@ -1488,7 +1490,7 @@ static void make_object_duplilist_real(bContext *C, Scene *scene, Base *base, if (object->proxy_group == base->object) { object->proxy = NULL; object->proxy_from = NULL; - DAG_id_tag_update(&object->id, OB_RECALC_OB); + DEG_id_tag_update(&object->id, OB_RECALC_OB); } } } @@ -1522,7 +1524,7 @@ static int object_duplicates_make_real_exec(bContext *C, wmOperator *op) } CTX_DATA_END; - DAG_relations_tag_update(bmain); + DEG_relations_tag_update(bmain); WM_event_add_notifier(C, NC_SCENE, scene); WM_main_add_notifier(NC_OBJECT | ND_DRAW, NULL); @@ -1605,7 +1607,7 @@ static Base *duplibase_for_convert(Main *bmain, Scene *scene, SceneLayer *sl, Ba } obn = BKE_object_copy(bmain, ob); - DAG_id_tag_update(&ob->id, OB_RECALC_OB | OB_RECALC_DATA | OB_RECALC_TIME); + DEG_id_tag_update(&ob->id, OB_RECALC_OB | OB_RECALC_DATA | OB_RECALC_TIME); BKE_collection_object_add_from(scene, ob, obn); basen = BKE_scene_layer_base_find(sl, obn); @@ -1665,7 +1667,7 @@ static int convert_exec(bContext *C, wmOperator *op) { for (CollectionPointerLink *link = selected_editable_bases.first; link; link = link->next) { Base *base = link->ptr.data; - DAG_id_tag_update(&base->object->id, OB_RECALC_DATA); + DEG_id_tag_update(&base->object->id, OB_RECALC_DATA); } uint64_t customdata_mask_prev = scene->customdata_mask; @@ -1734,7 +1736,7 @@ static int convert_exec(bContext *C, wmOperator *op) } else { newob = ob; - DAG_id_tag_update(&ob->id, OB_RECALC_OB | OB_RECALC_DATA | OB_RECALC_TIME); + DEG_id_tag_update(&ob->id, OB_RECALC_OB | OB_RECALC_DATA | OB_RECALC_TIME); } /* make new mesh data from the original copy */ @@ -1800,7 +1802,7 @@ static int convert_exec(bContext *C, wmOperator *op) for (ob1 = bmain->object.first; ob1; ob1 = ob1->id.next) { if (ob1->data == ob->data) { ob1->type = OB_CURVE; - DAG_id_tag_update(&ob1->id, OB_RECALC_OB | OB_RECALC_DATA | OB_RECALC_TIME); + DEG_id_tag_update(&ob1->id, OB_RECALC_OB | OB_RECALC_DATA | OB_RECALC_TIME); } } } @@ -1902,7 +1904,7 @@ static int convert_exec(bContext *C, wmOperator *op) } if (!keep_original && (ob->flag & OB_DONE)) { - DAG_id_tag_update(&ob->id, OB_RECALC_DATA); + DEG_id_tag_update(&ob->id, OB_RECALC_DATA); ((ID *)ob->data)->tag &= ~LIB_TAG_DOIT; /* flag not to convert this datablock again */ } } @@ -1927,7 +1929,7 @@ static int convert_exec(bContext *C, wmOperator *op) } /* delete object should renew depsgraph */ - DAG_relations_tag_update(bmain); + DEG_relations_tag_update(bmain); } // XXX ED_object_editmode_enter(C, 0); @@ -1943,7 +1945,7 @@ static int convert_exec(bContext *C, wmOperator *op) WM_event_add_notifier(C, NC_OBJECT | ND_DATA, BASACT_NEW->object); } - DAG_relations_tag_update(bmain); + DEG_relations_tag_update(bmain); WM_event_add_notifier(C, NC_OBJECT | ND_DRAW, scene); WM_event_add_notifier(C, NC_SCENE | ND_OB_SELECT, scene); @@ -1998,7 +2000,7 @@ static Base *object_add_duplicate_internal(Main *bmain, Scene *scene, SceneLayer } else { obn = ID_NEW_SET(ob, BKE_object_copy(bmain, ob)); - DAG_id_tag_update(&obn->id, OB_RECALC_OB | OB_RECALC_DATA | OB_RECALC_TIME); + DEG_id_tag_update(&obn->id, OB_RECALC_OB | OB_RECALC_DATA | OB_RECALC_TIME); BKE_collection_object_add_from(scene, ob, obn); basen = BKE_scene_layer_base_find(sl, obn); @@ -2120,7 +2122,7 @@ static Base *object_add_duplicate_internal(Main *bmain, Scene *scene, SceneLayer } break; case OB_ARMATURE: - DAG_id_tag_update(&obn->id, OB_RECALC_DATA); + DEG_id_tag_update(&obn->id, OB_RECALC_DATA); if (obn->pose) BKE_pose_tag_recalc(bmain, obn->pose); if (dupflag & USER_DUP_ARM) { @@ -2277,7 +2279,7 @@ static int duplicate_exec(bContext *C, wmOperator *op) ED_object_base_activate(C, basen); if (basen->object->data) { - DAG_id_tag_update(basen->object->data, 0); + DEG_id_tag_update(basen->object->data, 0); } } CTX_DATA_END; @@ -2286,9 +2288,9 @@ static int duplicate_exec(bContext *C, wmOperator *op) BKE_main_id_clear_newpoins(bmain); - DAG_relations_tag_update(bmain); + DEG_relations_tag_update(bmain); /* TODO(sergey): Use proper flag for tagging here. */ - DAG_id_tag_update(&CTX_data_scene(C)->id, 0); + DEG_id_tag_update(&CTX_data_scene(C)->id, 0); WM_event_add_notifier(C, NC_SCENE | ND_OB_SELECT, scene); @@ -2369,7 +2371,7 @@ static int add_named_exec(bContext *C, wmOperator *op) BKE_main_id_clear_newpoins(bmain); - DAG_relations_tag_update(bmain); + DEG_relations_tag_update(bmain); WM_event_add_notifier(C, NC_SCENE | ND_OB_SELECT | ND_OB_ACTIVE, scene); diff --git a/source/blender/editors/object/object_bake.c b/source/blender/editors/object/object_bake.c index 92a3850f2f3..e3dd47295fe 100644 --- a/source/blender/editors/object/object_bake.c +++ b/source/blender/editors/object/object_bake.c @@ -58,10 +58,11 @@ #include "BKE_cdderivedmesh.h" #include "BKE_modifier.h" #include "BKE_DerivedMesh.h" -#include "BKE_depsgraph.h" #include "BKE_mesh.h" #include "BKE_scene.h" +#include "DEG_depsgraph.h" + #include "RE_pipeline.h" #include "RE_shader_ext.h" #include "RE_multires_bake.h" @@ -688,7 +689,7 @@ static void finish_bake_internal(BakeRender *bkr) } BKE_image_release_ibuf(ima, ibuf, NULL); - DAG_id_tag_update(&ima->id, 0); + DEG_id_tag_update(&ima->id, 0); } } @@ -698,7 +699,7 @@ static void finish_bake_internal(BakeRender *bkr) BLI_assert(BLI_thread_is_main()); for (me = G.main->mesh.first; me; me = me->id.next) { if (me->id.tag & LIB_TAG_DOIT) { - DAG_id_tag_update(&me->id, OB_RECALC_DATA); + DEG_id_tag_update(&me->id, OB_RECALC_DATA); BKE_mesh_tessface_clear(me); } } diff --git a/source/blender/editors/object/object_bake_api.c b/source/blender/editors/object/object_bake_api.c index a4aff5b10f3..990761e233a 100644 --- a/source/blender/editors/object/object_bake_api.c +++ b/source/blender/editors/object/object_bake_api.c @@ -57,7 +57,6 @@ #include "BKE_modifier.h" #include "BKE_mesh.h" #include "BKE_screen.h" -#include "BKE_depsgraph.h" #include "DEG_depsgraph.h" @@ -275,7 +274,7 @@ static void refresh_images(BakeImages *bake_images) Image *ima = bake_images->data[i].image; if (ima->ok == IMA_OK_LOADED) { GPU_free_image(ima); - DAG_id_tag_update(&ima->id, 0); + DEG_id_tag_update(&ima->id, 0); } } } diff --git a/source/blender/editors/object/object_constraint.c b/source/blender/editors/object/object_constraint.c index 2437a6bff28..d110400de80 100644 --- a/source/blender/editors/object/object_constraint.c +++ b/source/blender/editors/object/object_constraint.c @@ -53,7 +53,6 @@ #include "BKE_armature.h" #include "BKE_constraint.h" #include "BKE_context.h" -#include "BKE_depsgraph.h" #include "BKE_fcurve.h" #include "BKE_global.h" #include "BKE_main.h" @@ -62,6 +61,9 @@ #include "BKE_tracking.h" #include "BIK_api.h" +#include "DEG_depsgraph.h" +#include "DEG_depsgraph_build.h" + #ifdef WITH_PYTHON #include "BPY_extern.h" #endif @@ -1196,9 +1198,9 @@ void ED_object_constraint_update(Object *ob) object_test_constraints(ob); if (ob->type == OB_ARMATURE) - DAG_id_tag_update(&ob->id, OB_RECALC_DATA | OB_RECALC_OB); + DEG_id_tag_update(&ob->id, OB_RECALC_DATA | OB_RECALC_OB); else - DAG_id_tag_update(&ob->id, OB_RECALC_OB); + DEG_id_tag_update(&ob->id, OB_RECALC_OB); } static void object_pose_tag_update(Main *bmain, Object *ob) @@ -1221,7 +1223,7 @@ void ED_object_constraint_dependency_update(Main *bmain, Object *ob) if (ob->pose) { object_pose_tag_update(bmain, ob); } - DAG_relations_tag_update(bmain); + DEG_relations_tag_update(bmain); } void ED_object_constraint_tag_update(Object *ob, bConstraint *con) @@ -1233,9 +1235,9 @@ void ED_object_constraint_tag_update(Object *ob, bConstraint *con) object_test_constraint(ob, con); if (ob->type == OB_ARMATURE) - DAG_id_tag_update(&ob->id, OB_RECALC_DATA | OB_RECALC_OB); + DEG_id_tag_update(&ob->id, OB_RECALC_DATA | OB_RECALC_OB); else - DAG_id_tag_update(&ob->id, OB_RECALC_OB); + DEG_id_tag_update(&ob->id, OB_RECALC_OB); } void ED_object_constraint_dependency_tag_update(Main *bmain, Object *ob, bConstraint *con) @@ -1245,7 +1247,7 @@ void ED_object_constraint_dependency_tag_update(Main *bmain, Object *ob, bConstr if (ob->pose) { object_pose_tag_update(bmain, ob); } - DAG_relations_tag_update(bmain); + DEG_relations_tag_update(bmain); } static int constraint_poll(bContext *C) @@ -1269,7 +1271,7 @@ static int constraint_delete_exec(bContext *C, wmOperator *UNUSED(op)) ED_object_constraint_update(ob); /* needed to set the flags on posebones correctly */ /* relatiols */ - DAG_relations_tag_update(CTX_data_main(C)); + DEG_relations_tag_update(CTX_data_main(C)); /* notifiers */ WM_event_add_notifier(C, NC_OBJECT | ND_CONSTRAINT | NA_REMOVED, ob); @@ -1411,12 +1413,12 @@ static int pose_constraints_clear_exec(bContext *C, wmOperator *UNUSED(op)) CTX_DATA_END; /* force depsgraph to get recalculated since relationships removed */ - DAG_relations_tag_update(bmain); + DEG_relations_tag_update(bmain); /* note, calling BIK_clear_data() isn't needed here */ /* do updates */ - DAG_id_tag_update(&ob->id, OB_RECALC_DATA); + DEG_id_tag_update(&ob->id, OB_RECALC_DATA); WM_event_add_notifier(C, NC_OBJECT | ND_CONSTRAINT | NA_REMOVED, ob); return OPERATOR_FINISHED; @@ -1443,12 +1445,12 @@ static int object_constraints_clear_exec(bContext *C, wmOperator *UNUSED(op)) CTX_DATA_BEGIN (C, Object *, ob, selected_editable_objects) { BKE_constraints_free(&ob->constraints); - DAG_id_tag_update(&ob->id, OB_RECALC_OB); + DEG_id_tag_update(&ob->id, OB_RECALC_OB); } CTX_DATA_END; /* force depsgraph to get recalculated since relationships removed */ - DAG_relations_tag_update(bmain); + DEG_relations_tag_update(bmain); /* do updates */ WM_event_add_notifier(C, NC_OBJECT | ND_CONSTRAINT | NA_REMOVED, NULL); @@ -1496,13 +1498,13 @@ static int pose_constraint_copy_exec(bContext *C, wmOperator *op) chan->constflag |= pchan->constflag; BKE_pose_tag_recalc(bmain, ob->pose); - DAG_id_tag_update((ID *)ob, OB_RECALC_DATA); + DEG_id_tag_update((ID *)ob, OB_RECALC_DATA); } } BLI_freelistN(&lb); /* force depsgraph to get recalculated since new relationships added */ - DAG_relations_tag_update(bmain); + DEG_relations_tag_update(bmain); WM_event_add_notifier(C, NC_OBJECT | ND_CONSTRAINT, NULL); @@ -1535,13 +1537,13 @@ static int object_constraint_copy_exec(bContext *C, wmOperator *UNUSED(op)) /* if we're not handling the object we're copying from, copy all constraints over */ if (obact != ob) { BKE_constraints_copy(&ob->constraints, &obact->constraints, true); - DAG_id_tag_update(&ob->id, OB_RECALC_DATA); + DEG_id_tag_update(&ob->id, OB_RECALC_DATA); } } CTX_DATA_END; /* force depsgraph to get recalculated since new relationships added */ - DAG_relations_tag_update(bmain); + DEG_relations_tag_update(bmain); /* notifiers for updates */ WM_event_add_notifier(C, NC_OBJECT | ND_CONSTRAINT | NA_ADDED, NULL); @@ -1818,7 +1820,7 @@ static int constraint_add_exec(bContext *C, wmOperator *op, Object *ob, ListBase /* force depsgraph to get recalculated since new relationships added */ - DAG_relations_tag_update(bmain); + DEG_relations_tag_update(bmain); if ((ob->type == OB_ARMATURE) && (pchan)) { BKE_pose_tag_recalc(bmain, ob->pose); /* sort pose channels */ @@ -1828,10 +1830,10 @@ static int constraint_add_exec(bContext *C, wmOperator *op, Object *ob, ListBase * XXX Temp hack until new depsgraph hopefully solves this. */ ob->adt->recalc |= ADT_RECALC_ANIM; } - DAG_id_tag_update(&ob->id, OB_RECALC_DATA | OB_RECALC_OB); + DEG_id_tag_update(&ob->id, OB_RECALC_DATA | OB_RECALC_OB); } else - DAG_id_tag_update(&ob->id, OB_RECALC_OB); + DEG_id_tag_update(&ob->id, OB_RECALC_OB); /* notifiers for updates */ WM_event_add_notifier(C, NC_OBJECT | ND_CONSTRAINT | NA_ADDED, ob); @@ -2071,7 +2073,7 @@ static int pose_ik_clear_exec(bContext *C, wmOperator *UNUSED(op)) CTX_DATA_END; /* refresh depsgraph */ - DAG_id_tag_update(&ob->id, OB_RECALC_DATA); + DEG_id_tag_update(&ob->id, OB_RECALC_DATA); /* note, notifier might evolve */ WM_event_add_notifier(C, NC_OBJECT | ND_CONSTRAINT | NA_REMOVED, ob); diff --git a/source/blender/editors/object/object_data_transfer.c b/source/blender/editors/object/object_data_transfer.c index 250737a130c..9a89ec453fd 100644 --- a/source/blender/editors/object/object_data_transfer.c +++ b/source/blender/editors/object/object_data_transfer.c @@ -40,13 +40,14 @@ #include "BKE_context.h" #include "BKE_data_transfer.h" -#include "BKE_depsgraph.h" #include "BKE_DerivedMesh.h" #include "BKE_mesh_mapping.h" #include "BKE_mesh_remap.h" #include "BKE_object.h" #include "BKE_report.h" +#include "DEG_depsgraph.h" + #include "RNA_access.h" #include "RNA_define.h" #include "RNA_enum_types.h" @@ -423,7 +424,7 @@ static int data_transfer_exec(bContext *C, wmOperator *op) } } - DAG_id_tag_update(&ob_dst->id, OB_RECALC_DATA); + DEG_id_tag_update(&ob_dst->id, OB_RECALC_DATA); if (reverse_transfer) { SWAP(Object *, ob_src, ob_dst); @@ -641,7 +642,7 @@ static int datalayout_transfer_exec(bContext *C, wmOperator *op) BKE_object_data_transfer_layout(scene, ob_src, ob_dst, dtmd->data_types, use_delete, dtmd->layers_select_src, dtmd->layers_select_dst); - DAG_id_tag_update(&ob_dst->id, OB_RECALC_DATA); + DEG_id_tag_update(&ob_dst->id, OB_RECALC_DATA); } else { Object *ob_src = ob_act; @@ -672,7 +673,7 @@ static int datalayout_transfer_exec(bContext *C, wmOperator *op) layers_select_src, layers_select_dst); } - DAG_id_tag_update(&ob_dst->id, OB_RECALC_DATA); + DEG_id_tag_update(&ob_dst->id, OB_RECALC_DATA); } BLI_freelistN(&ctx_objects); diff --git a/source/blender/editors/object/object_edit.c b/source/blender/editors/object/object_edit.c index fe232e37886..f9254096290 100644 --- a/source/blender/editors/object/object_edit.c +++ b/source/blender/editors/object/object_edit.c @@ -66,7 +66,6 @@ #include "BKE_context.h" #include "BKE_curve.h" #include "BKE_effect.h" -#include "BKE_depsgraph.h" #include "BKE_global.h" #include "BKE_image.h" #include "BKE_lattice.h" @@ -85,6 +84,9 @@ #include "BKE_report.h" #include "BKE_workspace.h" +#include "DEG_depsgraph.h" +#include "DEG_depsgraph_build.h" + #include "ED_armature.h" #include "ED_curve.h" #include "ED_mesh.h" @@ -194,7 +196,7 @@ static bool ED_object_editmode_load_ex(Main *bmain, Object *obedit, const bool f * to inform dependency graph about this. But is it really the * best place to do this? */ - DAG_relations_tag_update(bmain); + DEG_relations_tag_update(bmain); } else if (ELEM(obedit->type, OB_CURVE, OB_SURF)) { ED_curve_editnurb_load(obedit); @@ -216,7 +218,7 @@ static bool ED_object_editmode_load_ex(Main *bmain, Object *obedit, const bool f /* Tag update so no access to freed data referenced from * derived cache will happen. */ - DAG_id_tag_update((ID *)obedit->data, 0); + DEG_id_tag_update((ID *)obedit->data, 0); return true; } @@ -267,7 +269,7 @@ void ED_object_editmode_exit(bContext *C, int flag) BKE_ptcache_object_reset(scene, obedit, PTCACHE_RESET_OUTDATED); /* also flush ob recalc, doesn't take much overhead, but used for particles */ - DAG_id_tag_update(&obedit->id, OB_RECALC_OB | OB_RECALC_DATA); + DEG_id_tag_update(&obedit->id, OB_RECALC_OB | OB_RECALC_DATA); if (flag & EM_DO_UNDO) ED_undo_push(C, "Editmode"); @@ -358,7 +360,7 @@ void ED_object_editmode_enter(bContext *C, int flag) scene->obedit = ob; ED_armature_to_edit(arm); /* to ensure all goes in restposition and without striding */ - DAG_id_tag_update(&ob->id, OB_RECALC_OB | OB_RECALC_DATA | OB_RECALC_TIME); /* XXX: should this be OB_RECALC_DATA? */ + DEG_id_tag_update(&ob->id, OB_RECALC_OB | OB_RECALC_DATA | OB_RECALC_TIME); /* XXX: should this be OB_RECALC_DATA? */ WM_event_add_notifier(C, NC_SCENE | ND_MODE | NS_EDITMODE_ARMATURE, scene); } @@ -392,7 +394,7 @@ void ED_object_editmode_enter(bContext *C, int flag) } if (ok) { - DAG_id_tag_update(&ob->id, OB_RECALC_DATA); + DEG_id_tag_update(&ob->id, OB_RECALC_DATA); } else { scene->obedit = NULL; /* XXX for context */ @@ -684,7 +686,7 @@ static void copy_attr(Main *bmain, Scene *scene, SceneLayer *sl, short event) for (base = FIRSTBASE_NEW; base; base = base->next) { if (base != BASACT_NEW) { if (TESTBASELIB_NEW(base)) { - DAG_id_tag_update(&base->object->id, OB_RECALC_DATA); + DEG_id_tag_update(&base->object->id, OB_RECALC_DATA); if (event == 1) { /* loc */ copy_v3_v3(base->object->loc, ob->loc); @@ -787,7 +789,7 @@ static void copy_attr(Main *bmain, Scene *scene, SceneLayer *sl, short event) BLI_strncpy(cu1->family, cu->family, sizeof(cu1->family)); - DAG_id_tag_update(&base->object->id, OB_RECALC_DATA); + DEG_id_tag_update(&base->object->id, OB_RECALC_DATA); } } else if (event == 19) { /* bevel settings */ @@ -803,7 +805,7 @@ static void copy_attr(Main *bmain, Scene *scene, SceneLayer *sl, short event) cu1->ext1 = cu->ext1; cu1->ext2 = cu->ext2; - DAG_id_tag_update(&base->object->id, OB_RECALC_DATA); + DEG_id_tag_update(&base->object->id, OB_RECALC_DATA); } } else if (event == 25) { /* curve resolution */ @@ -822,7 +824,7 @@ static void copy_attr(Main *bmain, Scene *scene, SceneLayer *sl, short event) nu = nu->next; } - DAG_id_tag_update(&base->object->id, OB_RECALC_DATA); + DEG_id_tag_update(&base->object->id, OB_RECALC_DATA); } } else if (event == 21) { @@ -838,7 +840,7 @@ static void copy_attr(Main *bmain, Scene *scene, SceneLayer *sl, short event) } modifier_copyData(md, tmd); - DAG_id_tag_update(&base->object->id, OB_RECALC_DATA); + DEG_id_tag_update(&base->object->id, OB_RECALC_DATA); } } } @@ -899,7 +901,7 @@ static void copy_attr(Main *bmain, Scene *scene, SceneLayer *sl, short event) } if (do_depgraph_update) - DAG_relations_tag_update(bmain); + DEG_relations_tag_update(bmain); } static void UNUSED_FUNCTION(copy_attr_menu) (Main *bmain, Scene *scene, SceneLayer *sl) @@ -1255,7 +1257,7 @@ static int shade_smooth_exec(bContext *C, wmOperator *op) if (ob->type == OB_MESH) { BKE_mesh_smooth_flag_set(ob, !clear); - DAG_id_tag_update(&ob->id, OB_RECALC_DATA); + DEG_id_tag_update(&ob->id, OB_RECALC_DATA); WM_event_add_notifier(C, NC_OBJECT | ND_DRAW, ob); done = true; @@ -1268,7 +1270,7 @@ static int shade_smooth_exec(bContext *C, wmOperator *op) else nu->flag &= ~ME_SMOOTH; } - DAG_id_tag_update(&ob->id, OB_RECALC_DATA); + DEG_id_tag_update(&ob->id, OB_RECALC_DATA); WM_event_add_notifier(C, NC_OBJECT | ND_DRAW, ob); done = true; @@ -1366,7 +1368,7 @@ static void UNUSED_FUNCTION(image_aspect) (Scene *scene, SceneLayer *sl) else ob->size[1] = ob->size[0] * y / x; done = true; - DAG_id_tag_update(&ob->id, OB_RECALC_OB); + DEG_id_tag_update(&ob->id, OB_RECALC_OB); BKE_image_release_ibuf(tex->ima, ibuf, NULL); } diff --git a/source/blender/editors/object/object_facemap_ops.c b/source/blender/editors/object/object_facemap_ops.c index b8666fc7a65..87b59da6c62 100644 --- a/source/blender/editors/object/object_facemap_ops.c +++ b/source/blender/editors/object/object_facemap_ops.c @@ -38,7 +38,7 @@ #include "BKE_object_facemap.h" #include "BKE_object_deform.h" -#include "BKE_depsgraph.h" +#include "DEG_depsgraph.h" #include "BLI_utildefines.h" #include "BLI_path_util.h" @@ -182,7 +182,7 @@ static int face_map_add_exec(bContext *C, wmOperator *UNUSED(op)) Object *ob = ED_object_context(C); BKE_object_facemap_add(ob); - DAG_id_tag_update(&ob->id, OB_RECALC_DATA); + DEG_id_tag_update(&ob->id, OB_RECALC_DATA); WM_event_add_notifier(C, NC_GEOM | ND_DATA, ob->data); WM_event_add_notifier(C, NC_OBJECT | ND_DRAW, ob); @@ -211,7 +211,7 @@ static int face_map_remove_exec(bContext *C, wmOperator *UNUSED(op)) if (fmap) { BKE_object_facemap_remove(ob, fmap); - DAG_id_tag_update(&ob->id, OB_RECALC_DATA); + DEG_id_tag_update(&ob->id, OB_RECALC_DATA); WM_event_add_notifier(C, NC_GEOM | ND_DATA, ob->data); WM_event_add_notifier(C, NC_OBJECT | ND_DRAW, ob); } @@ -259,7 +259,7 @@ static int face_map_assign_exec(bContext *C, wmOperator *UNUSED(op)) } } - DAG_id_tag_update(&ob->id, OB_RECALC_DATA); + DEG_id_tag_update(&ob->id, OB_RECALC_DATA); WM_event_add_notifier(C, NC_GEOM | ND_DATA, ob->data); WM_event_add_notifier(C, NC_OBJECT | ND_DRAW, ob); } @@ -308,7 +308,7 @@ static int face_map_remove_from_exec(bContext *C, wmOperator *UNUSED(op)) } } - DAG_id_tag_update(&ob->id, OB_RECALC_DATA); + DEG_id_tag_update(&ob->id, OB_RECALC_DATA); WM_event_add_notifier(C, NC_GEOM | ND_DATA, ob->data); WM_event_add_notifier(C, NC_OBJECT | ND_DRAW, ob); } @@ -362,7 +362,7 @@ static int face_map_select_exec(bContext *C, wmOperator *UNUSED(op)) if (fmap) { fmap_select(ob, true); - DAG_id_tag_update(&ob->id, OB_RECALC_DATA); + DEG_id_tag_update(&ob->id, OB_RECALC_DATA); WM_event_add_notifier(C, NC_GEOM | ND_DATA, ob->data); WM_event_add_notifier(C, NC_OBJECT | ND_DRAW, ob); } @@ -392,7 +392,7 @@ static int face_map_deselect_exec(bContext *C, wmOperator *UNUSED(op)) if (fmap) { fmap_select(ob, false); - DAG_id_tag_update(&ob->id, OB_RECALC_DATA); + DEG_id_tag_update(&ob->id, OB_RECALC_DATA); WM_event_add_notifier(C, NC_GEOM | ND_DATA, ob->data); WM_event_add_notifier(C, NC_OBJECT | ND_DRAW, ob); } @@ -462,7 +462,7 @@ static int face_map_move_exec(bContext *C, wmOperator *op) ob->actfmap = pos2 + 1; - DAG_id_tag_update(&ob->id, OB_RECALC_DATA); + DEG_id_tag_update(&ob->id, OB_RECALC_DATA); WM_event_add_notifier(C, NC_GEOM | ND_VERTEX_GROUP, ob); return OPERATOR_FINISHED; diff --git a/source/blender/editors/object/object_group.c b/source/blender/editors/object/object_group.c index b22b034ecab..9d06624bd9c 100644 --- a/source/blender/editors/object/object_group.c +++ b/source/blender/editors/object/object_group.c @@ -40,7 +40,6 @@ #include "DNA_scene_types.h" #include "BKE_context.h" -#include "BKE_depsgraph.h" #include "BKE_group.h" #include "BKE_library.h" #include "BKE_library_remap.h" @@ -48,6 +47,8 @@ #include "BKE_report.h" #include "BKE_object.h" +#include "DEG_depsgraph_build.h" + #include "ED_screen.h" #include "ED_object.h" @@ -166,7 +167,7 @@ static int objects_add_active_exec(bContext *C, wmOperator *op) if (!updated) return OPERATOR_CANCELLED; - DAG_relations_tag_update(bmain); + DEG_relations_tag_update(bmain); WM_event_add_notifier(C, NC_GROUP | NA_EDITED, NULL); return OPERATOR_FINISHED; @@ -230,7 +231,7 @@ static int objects_remove_active_exec(bContext *C, wmOperator *op) if (!ok) BKE_report(op->reports, RPT_ERROR, "Active object contains no groups"); - DAG_relations_tag_update(bmain); + DEG_relations_tag_update(bmain); WM_event_add_notifier(C, NC_GROUP | NA_EDITED, NULL); return OPERATOR_FINISHED; @@ -270,7 +271,7 @@ static int group_objects_remove_all_exec(bContext *C, wmOperator *UNUSED(op)) } CTX_DATA_END; - DAG_relations_tag_update(bmain); + DEG_relations_tag_update(bmain); WM_event_add_notifier(C, NC_GROUP | NA_EDITED, NULL); return OPERATOR_FINISHED; @@ -321,7 +322,7 @@ static int group_objects_remove_exec(bContext *C, wmOperator *op) if (!updated) return OPERATOR_CANCELLED; - DAG_relations_tag_update(bmain); + DEG_relations_tag_update(bmain); WM_event_add_notifier(C, NC_GROUP | NA_EDITED, NULL); return OPERATOR_FINISHED; @@ -367,7 +368,7 @@ static int group_create_exec(bContext *C, wmOperator *op) } CTX_DATA_END; - DAG_relations_tag_update(bmain); + DEG_relations_tag_update(bmain); WM_event_add_notifier(C, NC_GROUP | NA_EDITED, NULL); return OPERATOR_FINISHED; diff --git a/source/blender/editors/object/object_hook.c b/source/blender/editors/object/object_hook.c index abb0172d9ce..fce55689e9a 100644 --- a/source/blender/editors/object/object_hook.c +++ b/source/blender/editors/object/object_hook.c @@ -48,7 +48,6 @@ #include "BKE_action.h" #include "BKE_context.h" -#include "BKE_depsgraph.h" #include "BKE_layer.h" #include "BKE_main.h" #include "BKE_modifier.h" @@ -58,6 +57,9 @@ #include "BKE_deform.h" #include "BKE_editmesh.h" +#include "DEG_depsgraph.h" +#include "DEG_depsgraph_build.h" + #include "RNA_define.h" #include "RNA_access.h" #include "RNA_enum_types.h" @@ -319,7 +321,7 @@ static bool object_hook_index_array(Scene *scene, Object *obedit, EDBM_mesh_load(obedit); EDBM_mesh_make(scene->toolsettings, obedit, true); - DAG_id_tag_update(obedit->data, 0); + DEG_id_tag_update(obedit->data, 0); em = me->edit_btmesh; @@ -548,7 +550,7 @@ static int add_hook_object(Main *bmain, Scene *scene, SceneLayer *sl, Object *ob /* apparently this call goes from right to left... */ mul_m4_series(hmd->parentinv, pose_mat, ob->imat, obedit->obmat); - DAG_relations_tag_update(bmain); + DEG_relations_tag_update(bmain); return true; } @@ -658,7 +660,7 @@ static int object_hook_remove_exec(bContext *C, wmOperator *op) BLI_remlink(&ob->modifiers, (ModifierData *)hmd); modifier_free((ModifierData *)hmd); - DAG_id_tag_update(&ob->id, OB_RECALC_DATA); + DEG_id_tag_update(&ob->id, OB_RECALC_DATA); WM_event_add_notifier(C, NC_OBJECT | ND_MODIFIER, ob); return OPERATOR_FINISHED; @@ -732,7 +734,7 @@ static int object_hook_reset_exec(bContext *C, wmOperator *op) BKE_object_modifier_hook_reset(ob, hmd); - DAG_id_tag_update(&ob->id, OB_RECALC_DATA); + DEG_id_tag_update(&ob->id, OB_RECALC_DATA); WM_event_add_notifier(C, NC_OBJECT | ND_MODIFIER, ob); return OPERATOR_FINISHED; @@ -782,7 +784,7 @@ static int object_hook_recenter_exec(bContext *C, wmOperator *op) sub_v3_v3v3(hmd->cent, scene->cursor, ob->obmat[3]); mul_m3_v3(imat, hmd->cent); - DAG_id_tag_update(&ob->id, OB_RECALC_DATA); + DEG_id_tag_update(&ob->id, OB_RECALC_DATA); WM_event_add_notifier(C, NC_OBJECT | ND_MODIFIER, ob); return OPERATOR_FINISHED; @@ -840,7 +842,7 @@ static int object_hook_assign_exec(bContext *C, wmOperator *op) hmd->indexar = indexar; hmd->totindex = tot; - DAG_id_tag_update(&ob->id, OB_RECALC_DATA); + DEG_id_tag_update(&ob->id, OB_RECALC_DATA); WM_event_add_notifier(C, NC_OBJECT | ND_MODIFIER, ob); return OPERATOR_FINISHED; diff --git a/source/blender/editors/object/object_lattice.c b/source/blender/editors/object/object_lattice.c index 73ce1fae605..4eafe715a6f 100644 --- a/source/blender/editors/object/object_lattice.c +++ b/source/blender/editors/object/object_lattice.c @@ -52,13 +52,14 @@ #include "RNA_enum_types.h" #include "BKE_context.h" -#include "BKE_depsgraph.h" #include "BKE_key.h" #include "BKE_lattice.h" #include "BKE_deform.h" #include "BKE_report.h" #include "BKE_utildefines.h" +#include "DEG_depsgraph.h" + #include "ED_lattice.h" #include "ED_object.h" #include "ED_screen.h" @@ -591,7 +592,7 @@ static int make_regular_exec(bContext *C, wmOperator *UNUSED(op)) BKE_lattice_resize(lt, lt->pntsu, lt->pntsv, lt->pntsw, NULL); } - DAG_id_tag_update(&ob->id, OB_RECALC_DATA); + DEG_id_tag_update(&ob->id, OB_RECALC_DATA); WM_event_add_notifier(C, NC_GEOM | ND_DATA, ob->data); return OPERATOR_FINISHED; @@ -811,7 +812,7 @@ static int lattice_flip_exec(bContext *C, wmOperator *op) } /* updates */ - DAG_id_tag_update(&obedit->id, OB_RECALC_DATA); + DEG_id_tag_update(&obedit->id, OB_RECALC_DATA); WM_event_add_notifier(C, NC_GEOM | ND_DATA, obedit->data); return OPERATOR_FINISHED; diff --git a/source/blender/editors/object/object_modifier.c b/source/blender/editors/object/object_modifier.c index d614be175f2..85751fd64de 100644 --- a/source/blender/editors/object/object_modifier.c +++ b/source/blender/editors/object/object_modifier.c @@ -54,7 +54,6 @@ #include "BKE_animsys.h" #include "BKE_curve.h" #include "BKE_context.h" -#include "BKE_depsgraph.h" #include "BKE_displist.h" #include "BKE_DerivedMesh.h" #include "BKE_effect.h" @@ -75,6 +74,9 @@ #include "BKE_softbody.h" #include "BKE_editmesh.h" +#include "DEG_depsgraph.h" +#include "DEG_depsgraph_build.h" + #include "RNA_access.h" #include "RNA_define.h" #include "RNA_enum_types.h" @@ -171,8 +173,8 @@ ModifierData *ED_object_modifier_add(ReportList *reports, Main *bmain, Scene *sc } } - DAG_id_tag_update(&ob->id, OB_RECALC_DATA); - DAG_relations_tag_update(bmain); + DEG_id_tag_update(&ob->id, OB_RECALC_DATA); + DEG_relations_tag_update(bmain); return new_md; } @@ -253,7 +255,7 @@ bool ED_object_multires_update_totlevels_cb(Object *ob, void *totlevel_v) for (md = ob->modifiers.first; md; md = md->next) { if (md->type == eModifierType_Multires) { multires_set_tot_level(ob, (MultiresModifierData *)md, totlevel); - DAG_id_tag_update(&ob->id, OB_RECALC_DATA); + DEG_id_tag_update(&ob->id, OB_RECALC_DATA); } } return false; @@ -320,7 +322,7 @@ static bool object_modifier_remove(Main *bmain, Object *ob, ModifierData *md, ob->mode &= ~OB_MODE_PARTICLE_EDIT; } - DAG_relations_tag_update(bmain); + DEG_relations_tag_update(bmain); BLI_remlink(&ob->modifiers, md); modifier_free(md); @@ -341,8 +343,8 @@ bool ED_object_modifier_remove(ReportList *reports, Main *bmain, Object *ob, Mod return 0; } - DAG_id_tag_update(&ob->id, OB_RECALC_DATA); - DAG_relations_tag_update(bmain); + DEG_id_tag_update(&ob->id, OB_RECALC_DATA); + DEG_relations_tag_update(bmain); return 1; } @@ -365,8 +367,8 @@ void ED_object_modifier_clear(Main *bmain, Object *ob) md = next_md; } - DAG_id_tag_update(&ob->id, OB_RECALC_DATA); - DAG_relations_tag_update(bmain); + DEG_id_tag_update(&ob->id, OB_RECALC_DATA); + DEG_relations_tag_update(bmain); } int ED_object_modifier_move_up(ReportList *reports, Object *ob, ModifierData *md) @@ -515,7 +517,7 @@ int ED_object_modifier_convert(ReportList *UNUSED(reports), Main *bmain, Scene * } } - DAG_relations_tag_update(bmain); + DEG_relations_tag_update(bmain); return 1; } @@ -643,7 +645,7 @@ static int modifier_apply_obdata(ReportList *reports, Scene *scene, Object *ob, MEM_freeN(vertexCos); - DAG_id_tag_update(&ob->id, OB_RECALC_DATA); + DEG_id_tag_update(&ob->id, OB_RECALC_DATA); } else { BKE_report(reports, RPT_ERROR, "Cannot apply modifier for this object type"); @@ -924,7 +926,7 @@ static int modifier_move_up_exec(bContext *C, wmOperator *op) if (!md || !ED_object_modifier_move_up(op->reports, ob, md)) return OPERATOR_CANCELLED; - DAG_id_tag_update(&ob->id, OB_RECALC_DATA); + DEG_id_tag_update(&ob->id, OB_RECALC_DATA); WM_event_add_notifier(C, NC_OBJECT | ND_MODIFIER, ob); return OPERATOR_FINISHED; @@ -963,7 +965,7 @@ static int modifier_move_down_exec(bContext *C, wmOperator *op) if (!md || !ED_object_modifier_move_down(op->reports, ob, md)) return OPERATOR_CANCELLED; - DAG_id_tag_update(&ob->id, OB_RECALC_DATA); + DEG_id_tag_update(&ob->id, OB_RECALC_DATA); WM_event_add_notifier(C, NC_OBJECT | ND_MODIFIER, ob); return OPERATOR_FINISHED; @@ -1005,7 +1007,7 @@ static int modifier_apply_exec(bContext *C, wmOperator *op) return OPERATOR_CANCELLED; } - DAG_id_tag_update(&ob->id, OB_RECALC_DATA); + DEG_id_tag_update(&ob->id, OB_RECALC_DATA); WM_event_add_notifier(C, NC_OBJECT | ND_MODIFIER, ob); return OPERATOR_FINISHED; @@ -1055,7 +1057,7 @@ static int modifier_convert_exec(bContext *C, wmOperator *op) if (!md || !ED_object_modifier_convert(op->reports, bmain, scene, sl, ob, md)) return OPERATOR_CANCELLED; - DAG_id_tag_update(&ob->id, OB_RECALC_DATA); + DEG_id_tag_update(&ob->id, OB_RECALC_DATA); WM_event_add_notifier(C, NC_OBJECT | ND_MODIFIER, ob); return OPERATOR_FINISHED; @@ -1094,7 +1096,7 @@ static int modifier_copy_exec(bContext *C, wmOperator *op) if (!md || !ED_object_modifier_copy(op->reports, ob, md)) return OPERATOR_CANCELLED; - DAG_id_tag_update(&ob->id, OB_RECALC_DATA); + DEG_id_tag_update(&ob->id, OB_RECALC_DATA); WM_event_add_notifier(C, NC_OBJECT | ND_MODIFIER, ob); return OPERATOR_FINISHED; @@ -1188,7 +1190,7 @@ static int multires_subdivide_exec(bContext *C, wmOperator *op) ED_object_multires_update_totlevels_cb, &mmd->totlvl); - DAG_id_tag_update(&ob->id, OB_RECALC_DATA); + DEG_id_tag_update(&ob->id, OB_RECALC_DATA); WM_event_add_notifier(C, NC_OBJECT | ND_MODIFIER, ob); if (ob->mode & OB_MODE_SCULPT) { @@ -1257,7 +1259,7 @@ static int multires_reshape_exec(bContext *C, wmOperator *op) return OPERATOR_CANCELLED; } - DAG_id_tag_update(&ob->id, OB_RECALC_DATA); + DEG_id_tag_update(&ob->id, OB_RECALC_DATA); WM_event_add_notifier(C, NC_OBJECT | ND_MODIFIER, ob); return OPERATOR_FINISHED; @@ -1405,7 +1407,7 @@ static int multires_base_apply_exec(bContext *C, wmOperator *op) multiresModifier_base_apply(mmd, ob); - DAG_id_tag_update(&ob->id, OB_RECALC_DATA); + DEG_id_tag_update(&ob->id, OB_RECALC_DATA); WM_event_add_notifier(C, NC_OBJECT | ND_MODIFIER, ob); return OPERATOR_FINISHED; @@ -1511,7 +1513,7 @@ static int skin_root_mark_exec(bContext *C, wmOperator *UNUSED(op)) BLI_gset_free(visited, NULL); - DAG_id_tag_update(&ob->id, OB_RECALC_DATA); + DEG_id_tag_update(&ob->id, OB_RECALC_DATA); WM_event_add_notifier(C, NC_OBJECT | ND_MODIFIER, ob); return OPERATOR_FINISHED; @@ -1566,7 +1568,7 @@ static int skin_loose_mark_clear_exec(bContext *C, wmOperator *op) } } - DAG_id_tag_update(&ob->id, OB_RECALC_DATA); + DEG_id_tag_update(&ob->id, OB_RECALC_DATA); WM_event_add_notifier(C, NC_OBJECT | ND_MODIFIER, ob); return OPERATOR_FINISHED; @@ -1616,7 +1618,7 @@ static int skin_radii_equalize_exec(bContext *C, wmOperator *UNUSED(op)) } } - DAG_id_tag_update(&ob->id, OB_RECALC_DATA); + DEG_id_tag_update(&ob->id, OB_RECALC_DATA); WM_event_add_notifier(C, NC_OBJECT | ND_MODIFIER, ob); return OPERATOR_FINISHED; @@ -1789,8 +1791,8 @@ static int skin_armature_create_exec(bContext *C, wmOperator *op) arm_md->object = arm_ob; arm_md->deformflag = ARM_DEF_VGROUP | ARM_DEF_QUATERNION; - DAG_relations_tag_update(bmain); - DAG_id_tag_update(&ob->id, OB_RECALC_DATA); + DEG_relations_tag_update(bmain); + DEG_id_tag_update(&ob->id, OB_RECALC_DATA); } WM_event_add_notifier(C, NC_OBJECT | ND_MODIFIER, ob); @@ -1857,7 +1859,7 @@ static int correctivesmooth_bind_exec(bContext *C, wmOperator *op) csmd->bind_coords_num = (unsigned int)-1; } - DAG_id_tag_update(&ob->id, OB_RECALC_DATA); + DEG_id_tag_update(&ob->id, OB_RECALC_DATA); WM_event_add_notifier(C, NC_OBJECT | ND_MODIFIER, ob); return OPERATOR_FINISHED; @@ -1926,7 +1928,7 @@ static int meshdeform_bind_exec(bContext *C, wmOperator *op) mmd->totcagevert = 0; mmd->totinfluence = 0; - DAG_id_tag_update(&ob->id, OB_RECALC_DATA); + DEG_id_tag_update(&ob->id, OB_RECALC_DATA); WM_event_add_notifier(C, NC_OBJECT | ND_MODIFIER, ob); } else { @@ -2000,7 +2002,7 @@ static int explode_refresh_exec(bContext *C, wmOperator *op) emd->flag |= eExplodeFlag_CalcFaces; - DAG_id_tag_update(&ob->id, OB_RECALC_DATA); + DEG_id_tag_update(&ob->id, OB_RECALC_DATA); WM_event_add_notifier(C, NC_OBJECT | ND_MODIFIER, ob); return OPERATOR_FINISHED; @@ -2145,7 +2147,7 @@ static int ocean_bake_exec(bContext *C, wmOperator *op) if (free) { omd->refresh |= MOD_OCEAN_REFRESH_CLEAR_CACHE; - DAG_id_tag_update(&ob->id, OB_RECALC_DATA); + DEG_id_tag_update(&ob->id, OB_RECALC_DATA); WM_event_add_notifier(C, NC_OBJECT | ND_MODIFIER, ob); return OPERATOR_FINISHED; } @@ -2195,7 +2197,7 @@ static int ocean_bake_exec(bContext *C, wmOperator *op) scene->r.cfra = cfra; - DAG_id_tag_update(&ob->id, OB_RECALC_DATA); + DEG_id_tag_update(&ob->id, OB_RECALC_DATA); WM_event_add_notifier(C, NC_OBJECT | ND_MODIFIER, ob); #endif @@ -2268,7 +2270,7 @@ static int laplaciandeform_bind_exec(bContext *C, wmOperator *op) else { lmd->flag |= MOD_LAPLACIANDEFORM_BIND; } - DAG_id_tag_update(&ob->id, OB_RECALC_DATA); + DEG_id_tag_update(&ob->id, OB_RECALC_DATA); WM_event_add_notifier(C, NC_OBJECT | ND_MODIFIER, ob); return OPERATOR_FINISHED; } @@ -2320,7 +2322,7 @@ static int surfacedeform_bind_exec(bContext *C, wmOperator *op) smd->flags |= MOD_SDEF_BIND; } - DAG_id_tag_update(&ob->id, OB_RECALC_DATA); + DEG_id_tag_update(&ob->id, OB_RECALC_DATA); WM_event_add_notifier(C, NC_OBJECT | ND_MODIFIER, ob); return OPERATOR_FINISHED; diff --git a/source/blender/editors/object/object_relations.c b/source/blender/editors/object/object_relations.c index f19b5619066..ae3a3866c24 100644 --- a/source/blender/editors/object/object_relations.c +++ b/source/blender/editors/object/object_relations.c @@ -67,7 +67,6 @@ #include "BKE_context.h" #include "BKE_constraint.h" #include "BKE_curve.h" -#include "BKE_depsgraph.h" #include "BKE_DerivedMesh.h" #include "BKE_displist.h" #include "BKE_global.h" @@ -94,6 +93,9 @@ #include "BKE_texture.h" #include "BKE_editmesh.h" +#include "DEG_depsgraph.h" +#include "DEG_depsgraph_build.h" + #include "WM_api.h" #include "WM_types.h" @@ -145,7 +147,7 @@ static int vertex_parent_set_exec(bContext *C, wmOperator *op) EDBM_mesh_load(obedit); EDBM_mesh_make(scene->toolsettings, obedit, true); - DAG_id_tag_update(obedit->data, 0); + DEG_id_tag_update(obedit->data, 0); em = me->edit_btmesh; @@ -233,7 +235,7 @@ static int vertex_parent_set_exec(bContext *C, wmOperator *op) CTX_DATA_BEGIN (C, Object *, ob, selected_editable_objects) { if (ob != obedit) { - DAG_id_tag_update(&ob->id, OB_RECALC_OB | OB_RECALC_DATA | OB_RECALC_TIME); + DEG_id_tag_update(&ob->id, OB_RECALC_OB | OB_RECALC_DATA | OB_RECALC_TIME); par = obedit->parent; if (BKE_object_parent_loop_check(par, ob)) { @@ -266,7 +268,7 @@ static int vertex_parent_set_exec(bContext *C, wmOperator *op) } CTX_DATA_END; - DAG_relations_tag_update(bmain); + DEG_relations_tag_update(bmain); WM_event_add_notifier(C, NC_OBJECT, NULL); @@ -371,8 +373,8 @@ static int make_proxy_exec(bContext *C, wmOperator *op) BKE_object_make_proxy(newob, ob, gob); /* depsgraph flushes are needed for the new data */ - DAG_relations_tag_update(bmain); - DAG_id_tag_update(&newob->id, OB_RECALC_OB | OB_RECALC_DATA | OB_RECALC_TIME); + DEG_relations_tag_update(bmain); + DEG_id_tag_update(&newob->id, OB_RECALC_OB | OB_RECALC_DATA | OB_RECALC_TIME); WM_event_add_notifier(C, NC_OBJECT | ND_DRAW, newob); } else { @@ -527,7 +529,7 @@ void ED_object_parent_clear(Object *ob, const int type) /* Always clear parentinv matrix for sake of consistency, see T41950. */ unit_m4(ob->parentinv); - DAG_id_tag_update(&ob->id, OB_RECALC_OB | OB_RECALC_DATA | OB_RECALC_TIME); + DEG_id_tag_update(&ob->id, OB_RECALC_OB | OB_RECALC_DATA | OB_RECALC_TIME); } /* note, poll should check for editable scene */ @@ -542,7 +544,7 @@ static int parent_clear_exec(bContext *C, wmOperator *op) } CTX_DATA_END; - DAG_relations_tag_update(bmain); + DEG_relations_tag_update(bmain); WM_event_add_notifier(C, NC_OBJECT | ND_TRANSFORM, NULL); WM_event_add_notifier(C, NC_OBJECT | ND_PARENT, NULL); return OPERATOR_FINISHED; @@ -616,7 +618,7 @@ bool ED_object_parent_set(ReportList *reports, Main *bmain, Scene *scene, Object bPoseChannel *pchan = NULL; const bool pararm = ELEM(partype, PAR_ARMATURE, PAR_ARMATURE_NAME, PAR_ARMATURE_ENVELOPE, PAR_ARMATURE_AUTO); - DAG_id_tag_update(&par->id, OB_RECALC_OB); + DEG_id_tag_update(&par->id, OB_RECALC_OB); /* preconditions */ if (partype == PAR_FOLLOW || partype == PAR_PATH_CONST) { @@ -713,7 +715,7 @@ bool ED_object_parent_set(ReportList *reports, Main *bmain, Scene *scene, Object ((CurveModifierData *)md)->object = par; } if (par->curve_cache && par->curve_cache->path == NULL) { - DAG_id_tag_update(&par->id, OB_RECALC_DATA); + DEG_id_tag_update(&par->id, OB_RECALC_DATA); } } break; @@ -796,7 +798,7 @@ bool ED_object_parent_set(ReportList *reports, Main *bmain, Scene *scene, Object invert_m4_m4(ob->parentinv, workob.obmat); } - DAG_id_tag_update(&ob->id, OB_RECALC_OB | OB_RECALC_DATA); + DEG_id_tag_update(&ob->id, OB_RECALC_OB | OB_RECALC_DATA); } } @@ -882,7 +884,7 @@ static int parent_set_exec(bContext *C, wmOperator *op) if (!ok) return OPERATOR_CANCELLED; - DAG_relations_tag_update(bmain); + DEG_relations_tag_update(bmain); WM_event_add_notifier(C, NC_OBJECT | ND_TRANSFORM, NULL); WM_event_add_notifier(C, NC_OBJECT | ND_PARENT, NULL); @@ -998,7 +1000,7 @@ static int parent_noinv_set_exec(bContext *C, wmOperator *op) Main *bmain = CTX_data_main(C); Object *par = ED_object_active_context(C); - DAG_id_tag_update(&par->id, OB_RECALC_OB); + DEG_id_tag_update(&par->id, OB_RECALC_OB); /* context iterator */ CTX_DATA_BEGIN (C, Object *, ob, selected_editable_objects) @@ -1013,7 +1015,7 @@ static int parent_noinv_set_exec(bContext *C, wmOperator *op) memset(ob->loc, 0, 3 * sizeof(float)); /* set recalc flags */ - DAG_id_tag_update(&ob->id, OB_RECALC_OB | OB_RECALC_DATA); + DEG_id_tag_update(&ob->id, OB_RECALC_OB | OB_RECALC_DATA); /* set parenting type for object - object only... */ ob->parent = par; @@ -1023,7 +1025,7 @@ static int parent_noinv_set_exec(bContext *C, wmOperator *op) } CTX_DATA_END; - DAG_relations_tag_update(bmain); + DEG_relations_tag_update(bmain); WM_event_add_notifier(C, NC_OBJECT | ND_TRANSFORM, NULL); return OPERATOR_FINISHED; @@ -1058,7 +1060,7 @@ static int object_slow_parent_clear_exec(bContext *C, wmOperator *UNUSED(op)) ob->partype -= PARSLOW; BKE_object_where_is_calc(scene, ob); ob->partype |= PARSLOW; - DAG_id_tag_update(&ob->id, OB_RECALC_OB); + DEG_id_tag_update(&ob->id, OB_RECALC_OB); } } } @@ -1096,7 +1098,7 @@ static int object_slow_parent_set_exec(bContext *C, wmOperator *UNUSED(op)) if (ob->parent) ob->partype |= PARSLOW; - DAG_id_tag_update(&ob->id, OB_RECALC_OB); + DEG_id_tag_update(&ob->id, OB_RECALC_OB); } CTX_DATA_END; @@ -1150,7 +1152,7 @@ static int object_track_clear_exec(bContext *C, wmOperator *op) /* remove track-object for old track */ ob->track = NULL; - DAG_id_tag_update(&ob->id, OB_RECALC_OB | OB_RECALC_DATA | OB_RECALC_TIME); + DEG_id_tag_update(&ob->id, OB_RECALC_OB | OB_RECALC_DATA | OB_RECALC_TIME); /* also remove all tracking constraints */ for (con = ob->constraints.last; con; con = pcon) { @@ -1164,7 +1166,7 @@ static int object_track_clear_exec(bContext *C, wmOperator *op) } CTX_DATA_END; - DAG_relations_tag_update(bmain); + DEG_relations_tag_update(bmain); WM_event_add_notifier(C, NC_OBJECT | ND_TRANSFORM, NULL); return OPERATOR_FINISHED; @@ -1224,7 +1226,7 @@ static int track_set_exec(bContext *C, wmOperator *op) data = con->data; data->tar = obact; - DAG_id_tag_update(&ob->id, OB_RECALC_OB | OB_RECALC_DATA | OB_RECALC_TIME); + DEG_id_tag_update(&ob->id, OB_RECALC_OB | OB_RECALC_DATA | OB_RECALC_TIME); /* Lamp, Camera and Speaker track differently by default */ if (ELEM(ob->type, OB_LAMP, OB_CAMERA, OB_SPEAKER)) { @@ -1247,7 +1249,7 @@ static int track_set_exec(bContext *C, wmOperator *op) data = con->data; data->tar = obact; - DAG_id_tag_update(&ob->id, OB_RECALC_OB | OB_RECALC_DATA | OB_RECALC_TIME); + DEG_id_tag_update(&ob->id, OB_RECALC_OB | OB_RECALC_DATA | OB_RECALC_TIME); /* Lamp, Camera and Speaker track differently by default */ if (ELEM(ob->type, OB_LAMP, OB_CAMERA, OB_SPEAKER)) { @@ -1271,7 +1273,7 @@ static int track_set_exec(bContext *C, wmOperator *op) data = con->data; data->tar = obact; - DAG_id_tag_update(&ob->id, OB_RECALC_OB | OB_RECALC_DATA | OB_RECALC_TIME); + DEG_id_tag_update(&ob->id, OB_RECALC_OB | OB_RECALC_DATA | OB_RECALC_TIME); /* Lamp, Camera and Speaker track differently by default */ if (ELEM(ob->type, OB_LAMP, OB_CAMERA, OB_SPEAKER)) { @@ -1285,7 +1287,7 @@ static int track_set_exec(bContext *C, wmOperator *op) } } - DAG_relations_tag_update(bmain); + DEG_relations_tag_update(bmain); WM_event_add_notifier(C, NC_OBJECT | ND_TRANSFORM, NULL); return OPERATOR_FINISHED; @@ -1447,7 +1449,7 @@ static int make_links_data_exec(bContext *C, wmOperator *op) /* if amount of material indices changed: */ test_object_materials(ob_dst, ob_dst->data); - DAG_id_tag_update(&ob_dst->id, OB_RECALC_DATA); + DEG_id_tag_update(&ob_dst->id, OB_RECALC_DATA); break; case MAKE_LINKS_MATERIALS: /* new approach, using functions from kernel */ @@ -1455,7 +1457,7 @@ static int make_links_data_exec(bContext *C, wmOperator *op) Material *ma = give_current_material(ob_src, a + 1); assign_material(ob_dst, ma, a + 1, BKE_MAT_ASSIGN_USERPREF); /* also works with ma==NULL */ } - DAG_id_tag_update(&ob_dst->id, OB_RECALC_DATA); + DEG_id_tag_update(&ob_dst->id, OB_RECALC_DATA); break; case MAKE_LINKS_ANIMDATA: BKE_animdata_copy_id((ID *)ob_dst, (ID *)ob_src, false); @@ -1466,7 +1468,7 @@ static int make_links_data_exec(bContext *C, wmOperator *op) } BKE_animdata_copy_id((ID *)ob_dst->data, (ID *)ob_src->data, false); } - DAG_id_tag_update(&ob_dst->id, OB_RECALC_OB | OB_RECALC_DATA | OB_RECALC_TIME); + DEG_id_tag_update(&ob_dst->id, OB_RECALC_OB | OB_RECALC_DATA | OB_RECALC_TIME); break; case MAKE_LINKS_GROUP: { @@ -1495,7 +1497,7 @@ static int make_links_data_exec(bContext *C, wmOperator *op) break; case MAKE_LINKS_MODIFIERS: BKE_object_link_modifiers(ob_dst, ob_src); - DAG_id_tag_update(&ob_dst->id, OB_RECALC_OB | OB_RECALC_DATA | OB_RECALC_TIME); + DEG_id_tag_update(&ob_dst->id, OB_RECALC_OB | OB_RECALC_DATA | OB_RECALC_TIME); break; case MAKE_LINKS_FONTS: { @@ -1524,7 +1526,7 @@ static int make_links_data_exec(bContext *C, wmOperator *op) cu_dst->vfontbi = cu_src->vfontbi; id_us_plus((ID *)cu_dst->vfontbi); - DAG_id_tag_update(&ob_dst->id, OB_RECALC_OB | OB_RECALC_DATA | OB_RECALC_TIME); + DEG_id_tag_update(&ob_dst->id, OB_RECALC_OB | OB_RECALC_DATA | OB_RECALC_TIME); break; } } @@ -1547,7 +1549,7 @@ static int make_links_data_exec(bContext *C, wmOperator *op) BKE_report(op->reports, RPT_WARNING, "Skipped editing library object data"); } - DAG_relations_tag_update(bmain); + DEG_relations_tag_update(bmain); WM_event_add_notifier(C, NC_SPACE | ND_SPACE_VIEW3D, CTX_wm_view3d(C)); WM_event_add_notifier(C, NC_ANIMATION | ND_NLA_ACTCHANGE, CTX_wm_view3d(C)); WM_event_add_notifier(C, NC_OBJECT, NULL); @@ -1781,7 +1783,7 @@ static void single_obdata_users(Main *bmain, Scene *scene, SceneLayer *sl, const id = ob->data; if (id && id->us > 1 && !ID_IS_LINKED_DATABLOCK(id)) { - DAG_id_tag_update(&ob->id, OB_RECALC_DATA); + DEG_id_tag_update(&ob->id, OB_RECALC_DATA); switch (ob->type) { case OB_LAMP: @@ -1819,7 +1821,7 @@ static void single_obdata_users(Main *bmain, Scene *scene, SceneLayer *sl, const BKE_animdata_copy_id_action((ID *)lat->key, false); break; case OB_ARMATURE: - DAG_id_tag_update(&ob->id, OB_RECALC_DATA); + DEG_id_tag_update(&ob->id, OB_RECALC_DATA); ob->data = ID_NEW_SET(ob->data, BKE_armature_copy(bmain, ob->data)); BKE_pose_rebuild(ob, ob->data); break; @@ -1856,7 +1858,7 @@ static void single_object_action_users(Scene *scene, SceneLayer *sl, const int f { FOREACH_OBJECT_FLAG(scene, sl, flag, ob) if (!ID_IS_LINKED_DATABLOCK(ob)) { - DAG_id_tag_update(&ob->id, OB_RECALC_DATA); + DEG_id_tag_update(&ob->id, OB_RECALC_DATA); BKE_animdata_copy_id_action(&ob->id, false); } FOREACH_OBJECT_FLAG_END @@ -2048,7 +2050,7 @@ void ED_object_single_users(Main *bmain, Scene *scene, const bool full, const bo } } BKE_main_id_clear_newpoins(bmain); - DAG_relations_tag_update(bmain); + DEG_relations_tag_update(bmain); } /******************************* Make Local ***********************************/ @@ -2148,7 +2150,7 @@ static bool make_local_all__instance_indirect_unused(Main *bmain, Scene *scene, base = BKE_scene_layer_base_find(sl, ob); base->flag |= BASE_SELECTED; BKE_scene_object_base_flag_sync_from_base(base); - DAG_id_tag_update(&ob->id, OB_RECALC_OB | OB_RECALC_DATA | OB_RECALC_TIME); + DEG_id_tag_update(&ob->id, OB_RECALC_OB | OB_RECALC_DATA | OB_RECALC_TIME); changed = true; } @@ -2355,7 +2357,7 @@ static int make_single_user_exec(bContext *C, wmOperator *op) WM_event_add_notifier(C, NC_WINDOW, NULL); if (update_deps) { - DAG_relations_tag_update(bmain); + DEG_relations_tag_update(bmain); } return OPERATOR_FINISHED; @@ -2405,7 +2407,7 @@ static int drop_named_material_invoke(bContext *C, wmOperator *op, const wmEvent assign_material(base->object, ma, 1, BKE_MAT_ASSIGN_USERPREF); - DAG_id_tag_update(&base->object->id, OB_RECALC_OB); + DEG_id_tag_update(&base->object->id, OB_RECALC_OB); WM_event_add_notifier(C, NC_OBJECT | ND_OB_SHADING, base->object); WM_event_add_notifier(C, NC_SPACE | ND_SPACE_VIEW3D, CTX_wm_view3d(C)); diff --git a/source/blender/editors/object/object_shapekey.c b/source/blender/editors/object/object_shapekey.c index e04114761e4..b7c0a2679bc 100644 --- a/source/blender/editors/object/object_shapekey.c +++ b/source/blender/editors/object/object_shapekey.c @@ -51,7 +51,6 @@ #include "DNA_object_types.h" #include "BKE_context.h" -#include "BKE_depsgraph.h" #include "BKE_key.h" #include "BKE_library.h" #include "BKE_main.h" @@ -59,6 +58,9 @@ #include "BKE_lattice.h" #include "BKE_curve.h" +#include "DEG_depsgraph.h" +#include "DEG_depsgraph_build.h" + #include "BLI_sys_types.h" // for intptr_t support #include "ED_object.h" @@ -213,7 +215,7 @@ static bool object_shape_key_mirror(bContext *C, Object *ob, *r_totmirr = totmirr; *r_totfail = totfail; - DAG_id_tag_update(&ob->id, OB_RECALC_DATA); + DEG_id_tag_update(&ob->id, OB_RECALC_DATA); WM_event_add_notifier(C, NC_OBJECT | ND_DRAW, ob); return 1; @@ -264,8 +266,8 @@ static int shape_key_add_exec(bContext *C, wmOperator *op) ED_object_shape_key_add(C, ob, from_mix); - DAG_id_tag_update(&ob->id, OB_RECALC_DATA); - DAG_relations_tag_update(CTX_data_main(C)); + DEG_id_tag_update(&ob->id, OB_RECALC_DATA); + DEG_relations_tag_update(CTX_data_main(C)); return OPERATOR_FINISHED; } @@ -302,8 +304,8 @@ static int shape_key_remove_exec(bContext *C, wmOperator *op) } if (changed) { - DAG_id_tag_update(&ob->id, OB_RECALC_DATA); - DAG_relations_tag_update(CTX_data_main(C)); + DEG_id_tag_update(&ob->id, OB_RECALC_DATA); + DEG_relations_tag_update(CTX_data_main(C)); WM_event_add_notifier(C, NC_OBJECT | ND_DRAW, ob); return OPERATOR_FINISHED; @@ -343,7 +345,7 @@ static int shape_key_clear_exec(bContext *C, wmOperator *UNUSED(op)) for (kb = key->block.first; kb; kb = kb->next) kb->curval = 0.0f; - DAG_id_tag_update(&ob->id, OB_RECALC_DATA); + DEG_id_tag_update(&ob->id, OB_RECALC_DATA); WM_event_add_notifier(C, NC_OBJECT | ND_DRAW, ob); return OPERATOR_FINISHED; @@ -378,7 +380,7 @@ static int shape_key_retime_exec(bContext *C, wmOperator *UNUSED(op)) for (kb = key->block.first; kb; kb = kb->next) kb->pos = (cfra += 0.1f); - DAG_id_tag_update(&ob->id, OB_RECALC_DATA); + DEG_id_tag_update(&ob->id, OB_RECALC_DATA); WM_event_add_notifier(C, NC_OBJECT | ND_DRAW, ob); return OPERATOR_FINISHED; @@ -469,7 +471,7 @@ static int shape_key_move_exec(bContext *C, wmOperator *op) return OPERATOR_CANCELLED; } - DAG_id_tag_update(&ob->id, OB_RECALC_DATA); + DEG_id_tag_update(&ob->id, OB_RECALC_DATA); WM_event_add_notifier(C, NC_OBJECT | ND_DRAW, ob); return OPERATOR_FINISHED; diff --git a/source/blender/editors/object/object_transform.c b/source/blender/editors/object/object_transform.c index 4d7d7df0d2f..8733b3c1b06 100644 --- a/source/blender/editors/object/object_transform.c +++ b/source/blender/editors/object/object_transform.c @@ -46,7 +46,6 @@ #include "BKE_context.h" #include "BKE_curve.h" -#include "BKE_depsgraph.h" #include "BKE_main.h" #include "BKE_idcode.h" #include "BKE_mball.h" @@ -59,6 +58,8 @@ #include "BKE_lattice.h" #include "BKE_tracking.h" +#include "DEG_depsgraph.h" + #include "RNA_define.h" #include "RNA_access.h" @@ -265,7 +266,7 @@ static int object_clear_transform_generic_exec(bContext *C, wmOperator *op, ED_autokeyframe_object(C, scene, ob, ks); /* tag for updates */ - DAG_id_tag_update(&ob->id, OB_RECALC_OB); + DEG_id_tag_update(&ob->id, OB_RECALC_OB); } } CTX_DATA_END; @@ -371,7 +372,7 @@ static int object_origin_clear_exec(bContext *C, wmOperator *UNUSED(op)) mul_m3_v3(mat, v3); } - DAG_id_tag_update(&ob->id, OB_RECALC_OB); + DEG_id_tag_update(&ob->id, OB_RECALC_OB); } CTX_DATA_END; @@ -617,7 +618,7 @@ static int apply_objects_internal(bContext *C, ReportList *reports, bool apply_l ignore_parent_tx(bmain, scene, ob); - DAG_id_tag_update(&ob->id, OB_RECALC_OB | OB_RECALC_DATA); + DEG_id_tag_update(&ob->id, OB_RECALC_OB | OB_RECALC_DATA); changed = true; } @@ -644,7 +645,7 @@ static int visual_transform_apply_exec(bContext *C, wmOperator *UNUSED(op)) BKE_object_where_is_calc(scene, ob); /* update for any children that may get moved */ - DAG_id_tag_update(&ob->id, OB_RECALC_OB); + DEG_id_tag_update(&ob->id, OB_RECALC_OB); changed = true; } @@ -784,7 +785,7 @@ static int object_origin_set_exec(bContext *C, wmOperator *op) EDBM_mesh_normals_update(em); tot_change++; - DAG_id_tag_update(&obedit->id, OB_RECALC_DATA); + DEG_id_tag_update(&obedit->id, OB_RECALC_DATA); } } @@ -898,7 +899,7 @@ static int object_origin_set_exec(bContext *C, wmOperator *op) if (obedit) { if (centermode == GEOMETRY_TO_ORIGIN) { - DAG_id_tag_update(&obedit->id, OB_RECALC_DATA); + DEG_id_tag_update(&obedit->id, OB_RECALC_DATA); } break; } @@ -976,7 +977,7 @@ static int object_origin_set_exec(bContext *C, wmOperator *op) if (obedit) { if (centermode == GEOMETRY_TO_ORIGIN) { - DAG_id_tag_update(&obedit->id, OB_RECALC_DATA); + DEG_id_tag_update(&obedit->id, OB_RECALC_DATA); } break; } @@ -1034,7 +1035,7 @@ static int object_origin_set_exec(bContext *C, wmOperator *op) (ob->transflag | ob_other->transflag) & OB_DUPLIGROUP))) { ob_other->flag |= OB_DONE; - DAG_id_tag_update(&ob_other->id, OB_RECALC_OB | OB_RECALC_DATA); + DEG_id_tag_update(&ob_other->id, OB_RECALC_OB | OB_RECALC_DATA); mul_v3_mat3_m4v3(centn, ob_other->obmat, cent); /* omit translation part */ add_v3_v3(ob_other->loc, centn); @@ -1054,7 +1055,7 @@ static int object_origin_set_exec(bContext *C, wmOperator *op) for (tob = bmain->object.first; tob; tob = tob->id.next) if (tob->data && (((ID *)tob->data)->tag & LIB_TAG_DOIT)) - DAG_id_tag_update(&tob->id, OB_RECALC_OB | OB_RECALC_DATA); + DEG_id_tag_update(&tob->id, OB_RECALC_OB | OB_RECALC_DATA); if (tot_change) { WM_event_add_notifier(C, NC_OBJECT | ND_TRANSFORM, NULL); diff --git a/source/blender/editors/object/object_vgroup.c b/source/blender/editors/object/object_vgroup.c index d93275a353e..51723ac14d3 100644 --- a/source/blender/editors/object/object_vgroup.c +++ b/source/blender/editors/object/object_vgroup.c @@ -56,7 +56,6 @@ #include "BKE_context.h" #include "BKE_customdata.h" #include "BKE_deform.h" -#include "BKE_depsgraph.h" #include "BKE_mesh_mapping.h" #include "BKE_editmesh.h" #include "BKE_layer.h" @@ -67,6 +66,8 @@ #include "BKE_object.h" #include "BKE_lattice.h" +#include "DEG_depsgraph.h" + #include "DNA_armature_types.h" #include "RNA_access.h" #include "RNA_define.h" @@ -2582,7 +2583,7 @@ static int vertex_group_add_exec(bContext *C, wmOperator *UNUSED(op)) Object *ob = ED_object_context(C); BKE_object_defgroup_add(ob); - DAG_id_tag_update(&ob->id, OB_RECALC_DATA); + DEG_id_tag_update(&ob->id, OB_RECALC_DATA); WM_event_add_notifier(C, NC_GEOM | ND_VERTEX_GROUP, ob->data); WM_event_add_notifier(C, NC_OBJECT | ND_DRAW, ob); @@ -2615,7 +2616,7 @@ static int vertex_group_remove_exec(bContext *C, wmOperator *op) else vgroup_delete_active(ob); - DAG_id_tag_update(&ob->id, OB_RECALC_DATA); + DEG_id_tag_update(&ob->id, OB_RECALC_DATA); WM_event_add_notifier(C, NC_GEOM | ND_VERTEX_GROUP, ob->data); WM_event_add_notifier(C, NC_OBJECT | ND_DRAW, ob); @@ -2650,7 +2651,7 @@ static int vertex_group_assign_exec(bContext *C, wmOperator *UNUSED(op)) Object *ob = ED_object_context(C); vgroup_assign_verts(ob, ts->vgroup_weight); - DAG_id_tag_update(&ob->id, OB_RECALC_DATA); + DEG_id_tag_update(&ob->id, OB_RECALC_DATA); WM_event_add_notifier(C, NC_GEOM | ND_DATA, ob->data); return OPERATOR_FINISHED; @@ -2723,7 +2724,7 @@ static int vertex_group_remove_from_exec(bContext *C, wmOperator *op) } } - DAG_id_tag_update(&ob->id, OB_RECALC_DATA); + DEG_id_tag_update(&ob->id, OB_RECALC_DATA); WM_event_add_notifier(C, NC_GEOM | ND_DATA, ob->data); return OPERATOR_FINISHED; @@ -2812,7 +2813,7 @@ static int vertex_group_copy_exec(bContext *C, wmOperator *UNUSED(op)) Object *ob = ED_object_context(C); vgroup_duplicate(ob); - DAG_id_tag_update(&ob->id, OB_RECALC_DATA); + DEG_id_tag_update(&ob->id, OB_RECALC_DATA); WM_event_add_notifier(C, NC_OBJECT | ND_DRAW, ob); WM_event_add_notifier(C, NC_GEOM | ND_VERTEX_GROUP, ob->data); @@ -2848,7 +2849,7 @@ static int vertex_group_levels_exec(bContext *C, wmOperator *op) vgroup_levels_subset(ob, vgroup_validmap, vgroup_tot, subset_count, offset, gain); MEM_freeN((void *)vgroup_validmap); - DAG_id_tag_update(&ob->id, OB_RECALC_DATA); + DEG_id_tag_update(&ob->id, OB_RECALC_DATA); WM_event_add_notifier(C, NC_OBJECT | ND_DRAW, ob); WM_event_add_notifier(C, NC_GEOM | ND_DATA, ob->data); @@ -2882,7 +2883,7 @@ static int vertex_group_normalize_exec(bContext *C, wmOperator *UNUSED(op)) changed = vgroup_normalize(ob); if (changed) { - DAG_id_tag_update(&ob->id, OB_RECALC_DATA); + DEG_id_tag_update(&ob->id, OB_RECALC_DATA); WM_event_add_notifier(C, NC_OBJECT | ND_DRAW, ob); WM_event_add_notifier(C, NC_GEOM | ND_DATA, ob->data); @@ -2921,7 +2922,7 @@ static int vertex_group_normalize_all_exec(bContext *C, wmOperator *op) MEM_freeN((void *)vgroup_validmap); if (changed) { - DAG_id_tag_update(&ob->id, OB_RECALC_DATA); + DEG_id_tag_update(&ob->id, OB_RECALC_DATA); WM_event_add_notifier(C, NC_OBJECT | ND_DRAW, ob); WM_event_add_notifier(C, NC_GEOM | ND_DATA, ob->data); @@ -2976,7 +2977,7 @@ static int vertex_group_fix_exec(bContext *C, wmOperator *op) } vgroup_fix(scene, ob, distToBe, strength, cp); - DAG_id_tag_update(&ob->id, OB_RECALC_DATA); + DEG_id_tag_update(&ob->id, OB_RECALC_DATA); WM_event_add_notifier(C, NC_OBJECT | ND_DRAW, ob); WM_event_add_notifier(C, NC_GEOM | ND_DATA, ob->data); @@ -3048,7 +3049,7 @@ static int vertex_group_invert_exec(bContext *C, wmOperator *op) vgroup_invert_subset(ob, vgroup_validmap, vgroup_tot, subset_count, auto_assign, auto_remove); MEM_freeN((void *)vgroup_validmap); - DAG_id_tag_update(&ob->id, OB_RECALC_DATA); + DEG_id_tag_update(&ob->id, OB_RECALC_DATA); WM_event_add_notifier(C, NC_OBJECT | ND_DRAW, ob); WM_event_add_notifier(C, NC_GEOM | ND_DATA, ob->data); @@ -3091,7 +3092,7 @@ static int vertex_group_smooth_exec(bContext *C, wmOperator *op) vgroup_smooth_subset(ob, vgroup_validmap, vgroup_tot, subset_count, fac, repeat, fac_expand, source); MEM_freeN((void *)vgroup_validmap); - DAG_id_tag_update(&ob->id, OB_RECALC_DATA); + DEG_id_tag_update(&ob->id, OB_RECALC_DATA); WM_event_add_notifier(C, NC_OBJECT | ND_DRAW, ob); WM_event_add_notifier(C, NC_GEOM | ND_DATA, ob->data); @@ -3141,7 +3142,7 @@ static int vertex_group_clean_exec(bContext *C, wmOperator *op) vgroup_clean_subset(ob, vgroup_validmap, vgroup_tot, subset_count, limit, keep_single); MEM_freeN((void *)vgroup_validmap); - DAG_id_tag_update(&ob->id, OB_RECALC_DATA); + DEG_id_tag_update(&ob->id, OB_RECALC_DATA); WM_event_add_notifier(C, NC_OBJECT | ND_DRAW, ob); WM_event_add_notifier(C, NC_GEOM | ND_DATA, ob->data); @@ -3182,7 +3183,7 @@ static int vertex_group_quantize_exec(bContext *C, wmOperator *op) vgroup_quantize_subset(ob, vgroup_validmap, vgroup_tot, subset_count, steps); MEM_freeN((void *)vgroup_validmap); - DAG_id_tag_update(&ob->id, OB_RECALC_DATA); + DEG_id_tag_update(&ob->id, OB_RECALC_DATA); WM_event_add_notifier(C, NC_OBJECT | ND_DRAW, ob); WM_event_add_notifier(C, NC_GEOM | ND_DATA, ob->data); @@ -3223,7 +3224,7 @@ static int vertex_group_limit_total_exec(bContext *C, wmOperator *op) BKE_reportf(op->reports, remove_tot ? RPT_INFO : RPT_WARNING, "%d vertex weights limited", remove_tot); if (remove_tot) { - DAG_id_tag_update(&ob->id, OB_RECALC_DATA); + DEG_id_tag_update(&ob->id, OB_RECALC_DATA); WM_event_add_notifier(C, NC_OBJECT | ND_DRAW, ob); WM_event_add_notifier(C, NC_GEOM | ND_DATA, ob->data); @@ -3268,7 +3269,7 @@ static int vertex_group_mirror_exec(bContext *C, wmOperator *op) ED_mesh_report_mirror(op, totmirr, totfail); - DAG_id_tag_update(&ob->id, OB_RECALC_DATA); + DEG_id_tag_update(&ob->id, OB_RECALC_DATA); WM_event_add_notifier(C, NC_OBJECT | ND_DRAW, ob); WM_event_add_notifier(C, NC_GEOM | ND_DATA, ob->data); @@ -3312,7 +3313,7 @@ static int vertex_group_copy_to_linked_exec(bContext *C, wmOperator *UNUSED(op)) BLI_duplicatelist(&ob_iter->defbase, &ob_active->defbase); ob_iter->actdef = ob_active->actdef; - DAG_id_tag_update(&ob_iter->id, OB_RECALC_DATA); + DEG_id_tag_update(&ob_iter->id, OB_RECALC_DATA); WM_event_add_notifier(C, NC_OBJECT | ND_DRAW, ob_iter); WM_event_add_notifier(C, NC_GEOM | ND_VERTEX_GROUP, ob_iter->data); @@ -3350,7 +3351,7 @@ static int vertex_group_copy_to_selected_exec(bContext *C, wmOperator *op) { if (obact != ob) { if (ED_vgroup_array_copy(ob, obact)) { - DAG_id_tag_update(&ob->id, OB_RECALC_DATA); + DEG_id_tag_update(&ob->id, OB_RECALC_DATA); WM_event_add_notifier(C, NC_GEOM | ND_VERTEX_GROUP, ob); changed_tot++; } @@ -3393,7 +3394,7 @@ static int set_active_group_exec(bContext *C, wmOperator *op) BLI_assert(nr + 1 >= 0); ob->actdef = nr + 1; - DAG_id_tag_update(&ob->id, OB_RECALC_DATA); + DEG_id_tag_update(&ob->id, OB_RECALC_DATA); WM_event_add_notifier(C, NC_GEOM | ND_VERTEX_GROUP, ob); return OPERATOR_FINISHED; @@ -3607,7 +3608,7 @@ static int vertex_group_sort_exec(bContext *C, wmOperator *op) ret = vgroup_do_remap(ob, name_array, op); if (ret != OPERATOR_CANCELLED) { - DAG_id_tag_update(&ob->id, OB_RECALC_DATA); + DEG_id_tag_update(&ob->id, OB_RECALC_DATA); WM_event_add_notifier(C, NC_GEOM | ND_VERTEX_GROUP, ob); } @@ -3657,7 +3658,7 @@ static int vgroup_move_exec(bContext *C, wmOperator *op) ret = vgroup_do_remap(ob, name_array, op); if (ret != OPERATOR_CANCELLED) { - DAG_id_tag_update(&ob->id, OB_RECALC_DATA); + DEG_id_tag_update(&ob->id, OB_RECALC_DATA); WM_event_add_notifier(C, NC_GEOM | ND_VERTEX_GROUP, ob); } } @@ -3786,7 +3787,7 @@ static int vertex_weight_paste_exec(bContext *C, wmOperator *op) vgroup_copy_active_to_sel_single(ob, def_nr); - DAG_id_tag_update(&ob->id, OB_RECALC_DATA); + DEG_id_tag_update(&ob->id, OB_RECALC_DATA); WM_event_add_notifier(C, NC_OBJECT | ND_DRAW, ob); return OPERATOR_FINISHED; @@ -3823,7 +3824,7 @@ static int vertex_weight_delete_exec(bContext *C, wmOperator *op) vgroup_remove_weight(ob, def_nr); - DAG_id_tag_update(&ob->id, OB_RECALC_DATA); + DEG_id_tag_update(&ob->id, OB_RECALC_DATA); WM_event_add_notifier(C, NC_OBJECT | ND_DRAW, ob); return OPERATOR_FINISHED; @@ -3856,7 +3857,7 @@ static int vertex_weight_set_active_exec(bContext *C, wmOperator *op) if (wg_index != -1) { ob->actdef = wg_index + 1; - DAG_id_tag_update(&ob->id, OB_RECALC_DATA); + DEG_id_tag_update(&ob->id, OB_RECALC_DATA); WM_event_add_notifier(C, NC_OBJECT | ND_DRAW, ob); } @@ -3893,7 +3894,7 @@ static int vertex_weight_normalize_active_vertex_exec(bContext *C, wmOperator *U changed = vgroup_normalize_active_vertex(ob, subset_type); if (changed) { - DAG_id_tag_update(&ob->id, OB_RECALC_DATA); + DEG_id_tag_update(&ob->id, OB_RECALC_DATA); WM_event_add_notifier(C, NC_OBJECT | ND_DRAW, ob); return OPERATOR_FINISHED; @@ -3926,7 +3927,7 @@ static int vertex_weight_copy_exec(bContext *C, wmOperator *UNUSED(op)) vgroup_copy_active_to_sel(ob, subset_type); - DAG_id_tag_update(&ob->id, OB_RECALC_DATA); + DEG_id_tag_update(&ob->id, OB_RECALC_DATA); WM_event_add_notifier(C, NC_OBJECT | ND_DRAW, ob); return OPERATOR_FINISHED; -- cgit v1.2.3