diff options
-rw-r--r-- | source/blender/editors/animation/anim_channels_edit.c | 4 | ||||
-rw-r--r-- | source/blender/editors/animation/anim_deps.c | 4 | ||||
-rw-r--r-- | source/blender/editors/animation/drivers.c | 5 | ||||
-rw-r--r-- | source/blender/editors/animation/keyframing.c | 4 | ||||
-rw-r--r-- | source/blender/editors/object/object_constraint.c | 5 | ||||
-rw-r--r-- | source/blender/editors/object/object_edit.c | 13 | ||||
-rw-r--r-- | source/blender/editors/object/object_modifier.c | 9 | ||||
-rw-r--r-- | source/blender/editors/space_node/node_draw.c | 9 | ||||
-rw-r--r-- | source/blender/freestyle/intern/blender_interface/BlenderStrokeRenderer.cpp | 4 | ||||
-rw-r--r-- | source/blender/makesrna/intern/rna_animation.c | 1 | ||||
-rw-r--r-- | source/blender/makesrna/intern/rna_camera.c | 9 | ||||
-rw-r--r-- | source/blender/makesrna/intern/rna_object.c | 1 |
12 files changed, 55 insertions, 13 deletions
diff --git a/source/blender/editors/animation/anim_channels_edit.c b/source/blender/editors/animation/anim_channels_edit.c index 67485248bf1..fd7551abab3 100644 --- a/source/blender/editors/animation/anim_channels_edit.c +++ b/source/blender/editors/animation/anim_channels_edit.c @@ -34,6 +34,7 @@ #include "MEM_guardedalloc.h" +#include "BKE_depsgraph.h" #include "BLI_blenlib.h" #include "BLI_utildefines.h" #include "BLI_listbase.h" @@ -1707,7 +1708,8 @@ static int animchannels_delete_exec(bContext *C, wmOperator *UNUSED(op)) /* send notifier that things have changed */ WM_event_add_notifier(C, NC_ANIMATION | ND_ANIMCHAN | NA_EDITED, NULL); - + DAG_relations_tag_update(CTX_data_main(C)); + return OPERATOR_FINISHED; } diff --git a/source/blender/editors/animation/anim_deps.c b/source/blender/editors/animation/anim_deps.c index eb57907c9ec..a38f5dbc8ea 100644 --- a/source/blender/editors/animation/anim_deps.c +++ b/source/blender/editors/animation/anim_deps.c @@ -73,8 +73,10 @@ void ANIM_list_elem_update(Scene *scene, bAnimListElem *ale) /* tag AnimData for refresh so that other views will update in realtime with these changes */ adt = BKE_animdata_from_id(id); - if (adt) + if (adt) { adt->recalc |= ADT_RECALC_ANIM; + DAG_id_tag_update(id, OB_RECALC_TIME); + } /* update data */ fcu = (ale->datatype == ALE_FCURVE) ? ale->key_data : NULL; diff --git a/source/blender/editors/animation/drivers.c b/source/blender/editors/animation/drivers.c index 08e0daf8eb9..b2a34d7c317 100644 --- a/source/blender/editors/animation/drivers.c +++ b/source/blender/editors/animation/drivers.c @@ -42,6 +42,7 @@ #include "DNA_texture_types.h" #include "BKE_animsys.h" +#include "BKE_depsgraph.h" #include "BKE_fcurve.h" #include "BKE_context.h" #include "BKE_report.h" @@ -450,7 +451,7 @@ static int add_driver_button_exec(bContext *C, wmOperator *op) if (success) { /* send updates */ UI_context_update_anim_flag(C); - + DAG_relations_tag_update(CTX_data_main(C)); WM_event_add_notifier(C, NC_ANIMATION | ND_FCURVES_ORDER, NULL); // XXX } @@ -504,7 +505,7 @@ static int remove_driver_button_exec(bContext *C, wmOperator *op) if (success) { /* send updates */ UI_context_update_anim_flag(C); - + DAG_relations_tag_update(CTX_data_main(C)); WM_event_add_notifier(C, NC_ANIMATION | ND_FCURVES_ORDER, NULL); // XXX } diff --git a/source/blender/editors/animation/keyframing.c b/source/blender/editors/animation/keyframing.c index 092408d7de5..cd7a326ffd5 100644 --- a/source/blender/editors/animation/keyframing.c +++ b/source/blender/editors/animation/keyframing.c @@ -152,6 +152,10 @@ bAction *verify_adt_action(ID *id, short add) * to the wrong places */ adt->action->idroot = GS(id->name); + + /* tag depsgraph to be rebuilt to include time dependency */ + /* XXX: we probably should have bmain passed down, but that involves altering too many API's */ + DAG_relations_tag_update(G.main); } /* return the action */ diff --git a/source/blender/editors/object/object_constraint.c b/source/blender/editors/object/object_constraint.c index 22db0936e39..e14674ef517 100644 --- a/source/blender/editors/object/object_constraint.c +++ b/source/blender/editors/object/object_constraint.c @@ -1260,7 +1260,10 @@ static int constraint_delete_exec(bContext *C, wmOperator *UNUSED(op)) /* there's no active constraint now, so make sure this is the case */ BKE_constraints_active_set(&ob->constraints, NULL); ED_object_constraint_update(ob); /* needed to set the flags on posebones correctly */ - + + /* relatiols */ + DAG_relations_tag_update(CTX_data_main(C)); + /* notifiers */ WM_event_add_notifier(C, NC_OBJECT | ND_CONSTRAINT | NA_REMOVED, ob); diff --git a/source/blender/editors/object/object_edit.c b/source/blender/editors/object/object_edit.c index 706ca5fbdfe..5e2bd438031 100644 --- a/source/blender/editors/object/object_edit.c +++ b/source/blender/editors/object/object_edit.c @@ -65,6 +65,7 @@ #include "BKE_curve.h" #include "BKE_effect.h" #include "BKE_depsgraph.h" +#include "BKE_global.h" #include "BKE_image.h" #include "BKE_lattice.h" #include "BKE_library.h" @@ -318,7 +319,7 @@ void OBJECT_OT_hide_render_set(wmOperatorType *ot) * Load EditMode data back into the object, * optionally freeing the editmode data. */ -static bool ED_object_editmode_load_ex(Object *obedit, const bool freedata) +static bool ED_object_editmode_load_ex(Main *bmain, Object *obedit, const bool freedata) { if (obedit == NULL) { return false; @@ -348,6 +349,11 @@ static bool ED_object_editmode_load_ex(Object *obedit, const bool freedata) ED_armature_from_edit(obedit->data); if (freedata) ED_armature_edit_free(obedit->data); + /* TODO(sergey): Pose channels might have been changed, so need + * to inform dependency graph about this. But is it really the + * best place to do this? + */ + DAG_relations_tag_update(bmain); } else if (ELEM(obedit->type, OB_CURVE, OB_SURF)) { load_editNurb(obedit); @@ -376,7 +382,8 @@ static bool ED_object_editmode_load_ex(Object *obedit, const bool freedata) bool ED_object_editmode_load(Object *obedit) { - return ED_object_editmode_load_ex(obedit, false); + /* TODO(sergey): use proper main here? */ + return ED_object_editmode_load_ex(G.main, obedit, false); } void ED_object_editmode_exit(bContext *C, int flag) @@ -389,7 +396,7 @@ void ED_object_editmode_exit(bContext *C, int flag) if (flag & EM_WAITCURSOR) waitcursor(1); - if (ED_object_editmode_load_ex(obedit, freedata) == false) { + if (ED_object_editmode_load_ex(CTX_data_main(C), obedit, freedata) == false) { /* in rare cases (background mode) its possible active object * is flagged for editmode, without 'obedit' being set [#35489] */ if (UNLIKELY(scene->basact && (scene->basact->object->mode & OB_MODE_EDIT))) { diff --git a/source/blender/editors/object/object_modifier.c b/source/blender/editors/object/object_modifier.c index 1cee54c33fa..c88f1257936 100644 --- a/source/blender/editors/object/object_modifier.c +++ b/source/blender/editors/object/object_modifier.c @@ -152,10 +152,10 @@ ModifierData *ED_object_modifier_add(ReportList *reports, Main *bmain, Scene *sc ob->pd = object_add_collision_fields(0); ob->pd->deflect = 1; - DAG_relations_tag_update(bmain); } - else if (type == eModifierType_Surface) - DAG_relations_tag_update(bmain); + else if (type == eModifierType_Surface) { + /* pass */ + } else if (type == eModifierType_Multires) { /* set totlvl from existing MDISPS layer if object already had it */ multiresModifier_set_levels_from_disps((MultiresModifierData *)new_md, ob); @@ -172,6 +172,7 @@ 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); return new_md; } @@ -319,6 +320,8 @@ static bool object_modifier_remove(Main *bmain, Object *ob, ModifierData *md, ob->mode &= ~OB_MODE_PARTICLE_EDIT; } + DAG_relations_tag_update(bmain); + BLI_remlink(&ob->modifiers, md); modifier_free(md); diff --git a/source/blender/editors/space_node/node_draw.c b/source/blender/editors/space_node/node_draw.c index e27cb041dc5..c89bf8dd13a 100644 --- a/source/blender/editors/space_node/node_draw.c +++ b/source/blender/editors/space_node/node_draw.c @@ -123,7 +123,14 @@ void ED_node_tag_update_id(ID *id) bNodeTree *ntree = node_tree_from_ID(id); if (id == NULL || ntree == NULL) return; - + + /* TODO(sergey): With the new dependency graph it + * should be just enough to ony tag ntree itself, + * all the users of this tree will have update + * flushed from the tree, + */ + DAG_id_tag_update(&ntree->id, 0); + if (ntree->type == NTREE_SHADER) { DAG_id_tag_update(id, 0); diff --git a/source/blender/freestyle/intern/blender_interface/BlenderStrokeRenderer.cpp b/source/blender/freestyle/intern/blender_interface/BlenderStrokeRenderer.cpp index 1ddc311b1ae..cfa0c45b1e3 100644 --- a/source/blender/freestyle/intern/blender_interface/BlenderStrokeRenderer.cpp +++ b/source/blender/freestyle/intern/blender_interface/BlenderStrokeRenderer.cpp @@ -127,6 +127,7 @@ BlenderStrokeRenderer::BlenderStrokeRenderer(Render *re, int render_count) : Str // Camera Object *object_camera = BKE_object_add(freestyle_bmain, freestyle_scene, OB_CAMERA, NULL); + DAG_relations_tag_update(freestyle_bmain); Camera *camera = (Camera *)object_camera->data; camera->type = CAM_ORTHO; @@ -506,6 +507,7 @@ void BlenderStrokeRenderer::RenderStrokeRepBasic(StrokeRep *iStrokeRep) const // If still no material, create one if (!has_mat) { Material *ma = BKE_material_add(freestyle_bmain, "stroke_material"); + DAG_relations_tag_update(freestyle_bmain); ma->mode |= MA_VERTEXCOLP; ma->mode |= MA_TRANSP; ma->mode |= MA_SHLESS; @@ -668,6 +670,7 @@ void BlenderStrokeRenderer::GenerateStrokeMesh(StrokeGroup *group, bool hasTex) { #if 0 Object *object_mesh = BKE_object_add(freestyle_bmain, freestyle_scene, OB_MESH); + DAG_relations_tag_update(freestyle_bmain); #else Object *object_mesh = NewMesh(); #endif @@ -938,6 +941,7 @@ Object *BlenderStrokeRenderer::NewMesh() const ob->lay = 1; base = BKE_scene_base_add(freestyle_scene, ob); + DAG_relations_tag_update(freestyle_bmain); #if 0 BKE_scene_base_deselect_all(scene); BKE_scene_base_select(scene, base); diff --git a/source/blender/makesrna/intern/rna_animation.c b/source/blender/makesrna/intern/rna_animation.c index df1e6dd55dd..ac30c615438 100644 --- a/source/blender/makesrna/intern/rna_animation.c +++ b/source/blender/makesrna/intern/rna_animation.c @@ -112,6 +112,7 @@ static void rna_AnimData_action_set(PointerRNA *ptr, PointerRNA value) adt = BKE_animdata_from_id(ownerId); if (adt) { adt->recalc |= ADT_RECALC_ANIM; + DAG_id_tag_update(ownerId, OB_RECALC_TIME); } } diff --git a/source/blender/makesrna/intern/rna_camera.c b/source/blender/makesrna/intern/rna_camera.c index 2baaa5f7cec..16f74a05f7b 100644 --- a/source/blender/makesrna/intern/rna_camera.c +++ b/source/blender/makesrna/intern/rna_camera.c @@ -87,6 +87,13 @@ static void rna_Camera_update(Main *UNUSED(bmain), Scene *UNUSED(scene), Pointer DAG_id_tag_update(&camera->id, 0); } +static void rna_Camera_dependency_update(Main *bmain, Scene *UNUSED(scene), PointerRNA *ptr) +{ + Camera *camera = (Camera *)ptr->id.data; + DAG_relations_tag_update(bmain); + DAG_id_tag_update(&camera->id, 0); +} + #else static void rna_def_camera_stereo_data(BlenderRNA *brna) @@ -356,7 +363,7 @@ void RNA_def_camera(BlenderRNA *brna) RNA_def_property_pointer_sdna(prop, NULL, "dof_ob"); RNA_def_property_flag(prop, PROP_EDITABLE); RNA_def_property_ui_text(prop, "DOF Object", "Use this object to define the depth of field focal point"); - RNA_def_property_update(prop, NC_OBJECT | ND_DRAW, NULL); + RNA_def_property_update(prop, NC_OBJECT | ND_DRAW, "rna_Camera_dependency_update"); prop = RNA_def_property(srna, "gpu_dof", PROP_POINTER, PROP_NONE); RNA_def_property_struct_type(prop, "GPUDOFSettings"); diff --git a/source/blender/makesrna/intern/rna_object.c b/source/blender/makesrna/intern/rna_object.c index 8bb3e9c265b..2ef5c6ec12e 100644 --- a/source/blender/makesrna/intern/rna_object.c +++ b/source/blender/makesrna/intern/rna_object.c @@ -949,6 +949,7 @@ static void rna_MaterialSlot_update(Main *bmain, Scene *scene, PointerRNA *ptr) WM_main_add_notifier(NC_OBJECT | ND_OB_SHADING, ptr->id.data); WM_main_add_notifier(NC_MATERIAL | ND_SHADING_LINKS, NULL); + DAG_relations_tag_update(bmain); } static char *rna_MaterialSlot_path(PointerRNA *ptr) |