diff options
author | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2009-11-24 14:48:16 +0300 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2009-11-24 14:48:16 +0300 |
commit | 2e7dbdf02574a3cf6a9787cba82f118263d3c623 (patch) | |
tree | 2dd5f3507e3cc8bc5cf32fd4052e20398eabfca0 /source/blender/editors | |
parent | 397b52bdc7b85831ee6b706133f76ffea83f6d59 (diff) |
Depsgraph/Drivers
* Removed ED_anim_dag_flush_update and ED_anim_object_flush_update. These
were wrapping DAG_* calls and were intended be used instead of them when
doing a DAG update from editors. That goes against the design in my opinion,
no matter who calls the DAG, that should update the editors correctly, so
any special checks in such functions for editors should be avoided.
* Driver RNA properties now do updates again, including DAG scene sorting,
text buttons no longer update as you type anymore, so this should be
safe I think.
* Remove scene.update() RNA function, all properties/functions should do this
automatically, if changing some property or calling a function/operator
does not do the correct update, that should be fixed.
Diffstat (limited to 'source/blender/editors')
-rw-r--r-- | source/blender/editors/animation/anim_deps.c | 14 | ||||
-rw-r--r-- | source/blender/editors/animation/drivers.c | 4 | ||||
-rw-r--r-- | source/blender/editors/animation/keyframing.c | 10 | ||||
-rw-r--r-- | source/blender/editors/animation/keyingsets.c | 4 | ||||
-rw-r--r-- | source/blender/editors/armature/poseobject.c | 8 | ||||
-rw-r--r-- | source/blender/editors/include/ED_anim_api.h | 5 | ||||
-rw-r--r-- | source/blender/editors/object/object_add.c | 6 | ||||
-rw-r--r-- | source/blender/editors/object/object_edit.c | 5 | ||||
-rw-r--r-- | source/blender/editors/object/object_relations.c | 18 | ||||
-rw-r--r-- | source/blender/editors/object/object_transform.c | 4 | ||||
-rw-r--r-- | source/blender/editors/space_graph/graph_buttons.c | 8 | ||||
-rw-r--r-- | source/blender/editors/space_view3d/view3d_snap.c | 8 |
12 files changed, 38 insertions, 56 deletions
diff --git a/source/blender/editors/animation/anim_deps.c b/source/blender/editors/animation/anim_deps.c index 9d39911548b..7a96c3b32a3 100644 --- a/source/blender/editors/animation/anim_deps.c +++ b/source/blender/editors/animation/anim_deps.c @@ -55,20 +55,6 @@ #include "WM_api.h" #include "WM_types.h" -/* ***************** depsgraph calls and anim updates ************* */ -/* ***************** only these can be called from editors ******** */ - -void ED_anim_dag_flush_update(const bContext *C) -{ - DAG_ids_flush_update(0); -} - -/* flushes changes from object to all relations in scene */ -void ED_anim_object_flush_update(const bContext *C, Object *ob) -{ - DAG_id_update_flags(&ob->id); -} - /* **************************** pose <-> action syncing ******************************** */ /* Summary of what needs to be synced between poses and actions: * 1) Flags diff --git a/source/blender/editors/animation/drivers.c b/source/blender/editors/animation/drivers.c index a91e67ffc91..e731faaf103 100644 --- a/source/blender/editors/animation/drivers.c +++ b/source/blender/editors/animation/drivers.c @@ -398,7 +398,7 @@ static int add_driver_button_exec (bContext *C, wmOperator *op) if (success) { /* send updates */ - ED_anim_dag_flush_update(C); + DAG_ids_flush_update(0); /* for now, only send ND_KEYS for KeyingSets */ WM_event_add_notifier(C, ND_KEYS, NULL); // XXX @@ -462,7 +462,7 @@ static int remove_driver_button_exec (bContext *C, wmOperator *op) if (success) { /* send updates */ - ED_anim_dag_flush_update(C); + DAG_ids_flush_update(0); /* for now, only send ND_KEYS for KeyingSets */ WM_event_add_notifier(C, ND_KEYS, NULL); // XXX diff --git a/source/blender/editors/animation/keyframing.c b/source/blender/editors/animation/keyframing.c index 1854f602761..bc706271359 100644 --- a/source/blender/editors/animation/keyframing.c +++ b/source/blender/editors/animation/keyframing.c @@ -1023,7 +1023,7 @@ static int insert_key_exec (bContext *C, wmOperator *op) } /* send updates */ - ED_anim_dag_flush_update(C); + DAG_ids_flush_update(0); return OPERATOR_FINISHED; } @@ -1210,7 +1210,7 @@ static int delete_key_exec (bContext *C, wmOperator *op) } /* send updates */ - ED_anim_dag_flush_update(C); + DAG_ids_flush_update(0); return OPERATOR_FINISHED; } @@ -1277,7 +1277,7 @@ static int delete_key_v3d_exec (bContext *C, wmOperator *op) CTX_DATA_END; /* send updates */ - ED_anim_dag_flush_update(C); + DAG_ids_flush_update(0); WM_event_add_notifier(C, NC_OBJECT|ND_KEYS, NULL); @@ -1367,7 +1367,7 @@ static int insert_key_button_exec (bContext *C, wmOperator *op) if (success) { /* send updates */ - ED_anim_dag_flush_update(C); + DAG_ids_flush_update(0); /* for now, only send ND_KEYS for KeyingSets */ WM_event_add_notifier(C, ND_KEYS, NULL); @@ -1437,7 +1437,7 @@ static int delete_key_button_exec (bContext *C, wmOperator *op) if(success) { /* send updates */ - ED_anim_dag_flush_update(C); + DAG_ids_flush_update(0); /* for now, only send ND_KEYS for KeyingSets */ WM_event_add_notifier(C, ND_KEYS, NULL); diff --git a/source/blender/editors/animation/keyingsets.c b/source/blender/editors/animation/keyingsets.c index d7406a7bcfd..39dd652e649 100644 --- a/source/blender/editors/animation/keyingsets.c +++ b/source/blender/editors/animation/keyingsets.c @@ -366,7 +366,7 @@ static int add_keyingset_button_exec (bContext *C, wmOperator *op) if (success) { /* send updates */ - ED_anim_dag_flush_update(C); + DAG_ids_flush_update(0); /* for now, only send ND_KEYS for KeyingSets */ WM_event_add_notifier(C, NC_SCENE|ND_KEYINGSET, NULL); @@ -444,7 +444,7 @@ static int remove_keyingset_button_exec (bContext *C, wmOperator *op) if (success) { /* send updates */ - ED_anim_dag_flush_update(C); + DAG_ids_flush_update(0); /* for now, only send ND_KEYS for KeyingSets */ WM_event_add_notifier(C, NC_SCENE|ND_KEYINGSET, NULL); diff --git a/source/blender/editors/armature/poseobject.c b/source/blender/editors/armature/poseobject.c index 18750d96f86..846e6fcc23b 100644 --- a/source/blender/editors/armature/poseobject.c +++ b/source/blender/editors/armature/poseobject.c @@ -241,10 +241,10 @@ void ED_pose_recalculate_paths(bContext *C, Scene *scene, Object *ob) /* hack: for unsaved files, set OB_RECALC so that paths can get calculated */ if ((ob->recalc & OB_RECALC)==0) { ob->recalc |= OB_RECALC; - ED_anim_object_flush_update(C, ob); + DAG_id_update_flags(&ob->id); } else - ED_anim_object_flush_update(C, ob); + DAG_id_update_flags(&ob->id); /* calculate path over requested range */ for (CFRA=sfra; CFRA<=efra; CFRA++) { @@ -355,10 +355,10 @@ static int pose_calculate_paths_exec (bContext *C, wmOperator *op) /* hack: for unsaved files, set OB_RECALC so that paths can get calculated */ if ((ob->recalc & OB_RECALC)==0) { ob->recalc |= OB_RECALC; - ED_anim_object_flush_update(C, ob); + DAG_id_update_flags(&ob->id); } else - ED_anim_object_flush_update(C, ob); + DAG_id_update_flags(&ob->id); /* alloc the path cache arrays */ for (pchan= ob->pose->chanbase.first; pchan; pchan= pchan->next) { diff --git a/source/blender/editors/include/ED_anim_api.h b/source/blender/editors/include/ED_anim_api.h index 9e6a757baa2..af24402f3ca 100644 --- a/source/blender/editors/include/ED_anim_api.h +++ b/source/blender/editors/include/ED_anim_api.h @@ -481,11 +481,6 @@ void ED_nla_postop_refresh(bAnimContext *ac); /* --------- anim_deps.c, animation updates -------- */ - /* generic update flush, does tagged objects only, reads from Context screen (layers) and scene */ -void ED_anim_dag_flush_update(const struct bContext *C); - /* only flush object */ -void ED_anim_object_flush_update(const struct bContext *C, struct Object *ob); - /* pose <-> action syncing */ void ANIM_action_to_pose_sync(struct Object *ob); void ANIM_pose_to_action_sync(struct Object *ob, struct ScrArea *sa); diff --git a/source/blender/editors/object/object_add.c b/source/blender/editors/object/object_add.c index e58170ebab6..16be0e32e17 100644 --- a/source/blender/editors/object/object_add.c +++ b/source/blender/editors/object/object_add.c @@ -755,7 +755,7 @@ static int object_delete_exec(bContext *C, wmOperator *op) if(islamp) reshadeall_displist(scene); /* only frees displist */ DAG_scene_sort(scene); - ED_anim_dag_flush_update(C); + DAG_ids_flush_update(0); WM_event_add_notifier(C, NC_SCENE|ND_OB_ACTIVE, CTX_data_scene(C)); @@ -951,7 +951,7 @@ static int object_duplicates_make_real_exec(bContext *C, wmOperator *op) CTX_DATA_END; DAG_scene_sort(scene); - ED_anim_dag_flush_update(C); + DAG_ids_flush_update(0); WM_event_add_notifier(C, NC_SCENE, scene); return OPERATOR_FINISHED; @@ -1480,7 +1480,7 @@ static int duplicate_exec(bContext *C, wmOperator *op) copy_object_set_idnew(C, dupflag); DAG_scene_sort(scene); - ED_anim_dag_flush_update(C); + DAG_ids_flush_update(0); WM_event_add_notifier(C, NC_SCENE|ND_OB_SELECT, scene); diff --git a/source/blender/editors/object/object_edit.c b/source/blender/editors/object/object_edit.c index 3f731696ef8..ecb9226e5f7 100644 --- a/source/blender/editors/object/object_edit.c +++ b/source/blender/editors/object/object_edit.c @@ -1062,7 +1062,7 @@ void flip_subdivison(Scene *scene, View3D *v3d, int level) } } - ED_anim_dag_flush_update(C); + DAG_ids_flush_update(0); } static void copymenu_properties(Scene *scene, View3D *v3d, Object *ob) @@ -1549,8 +1549,7 @@ void copy_attr(Scene *scene, View3D *v3d, short event) if(do_scene_sort) DAG_scene_sort(scene); - ED_anim_dag_flush_update(C); - + DAG_ids_flush_update(0); } void copy_attr_menu(Scene *scene, View3D *v3d) diff --git a/source/blender/editors/object/object_relations.c b/source/blender/editors/object/object_relations.c index ac7e76abc13..c0979e410fd 100644 --- a/source/blender/editors/object/object_relations.c +++ b/source/blender/editors/object/object_relations.c @@ -458,7 +458,7 @@ static int parent_clear_exec(bContext *C, wmOperator *op) CTX_DATA_END; DAG_scene_sort(CTX_data_scene(C)); - ED_anim_dag_flush_update(C); + DAG_ids_flush_update(0); WM_event_add_notifier(C, NC_OBJECT|ND_TRANSFORM, NULL); return OPERATOR_FINISHED; @@ -684,7 +684,7 @@ static int parent_set_exec(bContext *C, wmOperator *op) CTX_DATA_END; DAG_scene_sort(scene); - ED_anim_dag_flush_update(C); + DAG_ids_flush_update(0); WM_event_add_notifier(C, NC_OBJECT|ND_TRANSFORM, NULL); return OPERATOR_FINISHED; @@ -772,7 +772,7 @@ static int parent_noinv_set_exec(bContext *C, wmOperator *op) CTX_DATA_END; DAG_scene_sort(CTX_data_scene(C)); - ED_anim_dag_flush_update(C); + DAG_ids_flush_update(0); WM_event_add_notifier(C, NC_OBJECT|ND_TRANSFORM, NULL); return OPERATOR_FINISHED; @@ -812,7 +812,7 @@ static int object_slow_parent_clear_exec(bContext *C, wmOperator *op) } CTX_DATA_END; - ED_anim_dag_flush_update(C); + DAG_ids_flush_update(0); WM_event_add_notifier(C, NC_SCENE, scene); return OPERATOR_FINISHED; @@ -850,7 +850,7 @@ static int object_slow_parent_set_exec(bContext *C, wmOperator *op) } CTX_DATA_END; - ED_anim_dag_flush_update(C); + DAG_ids_flush_update(0); WM_event_add_notifier(C, NC_SCENE, scene); return OPERATOR_FINISHED; @@ -899,8 +899,8 @@ static int object_track_clear_exec(bContext *C, wmOperator *op) } CTX_DATA_END; + DAG_ids_flush_update(0); DAG_scene_sort(CTX_data_scene(C)); - ED_anim_dag_flush_update(C); return OPERATOR_FINISHED; } @@ -992,7 +992,7 @@ static int track_set_exec(bContext *C, wmOperator *op) CTX_DATA_END; } DAG_scene_sort(scene); - ED_anim_dag_flush_update(C); + DAG_ids_flush_update(0); return OPERATOR_FINISHED; } @@ -1172,7 +1172,7 @@ static int make_links_scene_exec(bContext *C, wmOperator *op) } CTX_DATA_END; - ED_anim_dag_flush_update(C); + DAG_ids_flush_update(0); /* one day multiple scenes will be visible, then we should have some update function for them */ return OPERATOR_FINISHED; @@ -1240,7 +1240,7 @@ static int make_links_data_exec(bContext *C, wmOperator *op) } CTX_DATA_END; - ED_anim_dag_flush_update(C); + DAG_ids_flush_update(0); WM_event_add_notifier(C, NC_SPACE|ND_SPACE_VIEW3D, CTX_wm_view3d(C)); return OPERATOR_FINISHED; } diff --git a/source/blender/editors/object/object_transform.c b/source/blender/editors/object/object_transform.c index cb66384b1f8..c8f1bb55136 100644 --- a/source/blender/editors/object/object_transform.c +++ b/source/blender/editors/object/object_transform.c @@ -341,7 +341,7 @@ static int object_origin_clear_exec(bContext *C, wmOperator *op) CTX_DATA_END; if(armature_clear==0) /* in this case flush was done */ - ED_anim_dag_flush_update(C); + DAG_ids_flush_update(0); WM_event_add_notifier(C, NC_OBJECT|ND_TRANSFORM, NULL); @@ -1010,7 +1010,7 @@ static int object_center_set_exec(bContext *C, wmOperator *op) CTX_DATA_END; if (tot_change) { - ED_anim_dag_flush_update(C); + DAG_ids_flush_update(0); } /* Warn if any errors occured */ diff --git a/source/blender/editors/space_graph/graph_buttons.c b/source/blender/editors/space_graph/graph_buttons.c index a13df292990..97b3dd29ef9 100644 --- a/source/blender/editors/space_graph/graph_buttons.c +++ b/source/blender/editors/space_graph/graph_buttons.c @@ -235,13 +235,13 @@ static void do_graph_region_driver_buttons(bContext *C, void *arg, int event) DAG_scene_sort(scene); /* force an update of depsgraph */ - ED_anim_dag_flush_update(C); + DAG_ids_flush_update(0); } break; } /* default for now */ - WM_event_add_notifier(C, NC_SCENE, scene); // XXX does this always work? + WM_event_add_notifier(C, NC_SCENE|ND_FRAME, scene); // XXX could use better notifier } /* callback to remove the active driver */ @@ -342,7 +342,7 @@ static void graph_panel_drivers(const bContext *C, Panel *pa) /* show expression box if doing scripted drivers, and/or error messages when invalid drivers exist */ if (driver->type == DRIVER_TYPE_PYTHON) { /* expression */ - uiItemR(col, "Expr:", 0, &driver_ptr, "expression", 0); + uiItemR(col, "Expr", 0, &driver_ptr, "expression", 0); /* errors? */ if (driver->flag & DRIVER_FLAG_INVALID) @@ -377,7 +377,7 @@ static void graph_panel_drivers(const bContext *C, Panel *pa) uiItemR(row, "", 0, &dtar_ptr, "name", 0); /* remove button */ - but= uiDefIconBut(block, BUT, B_REDR, ICON_X, 290, 0, UI_UNIT_X, UI_UNIT_Y, NULL, 0.0, 0.0, 0.0, 0.0, "Delete target variable."); + but= uiDefIconBut(block, BUT, B_IPO_DEPCHANGE, ICON_X, 290, 0, UI_UNIT_X, UI_UNIT_Y, NULL, 0.0, 0.0, 0.0, 0.0, "Delete target variable."); uiButSetFunc(but, driver_delete_var_cb, driver, dtar); diff --git a/source/blender/editors/space_view3d/view3d_snap.c b/source/blender/editors/space_view3d/view3d_snap.c index 933b12ae679..a23163f4a5c 100644 --- a/source/blender/editors/space_view3d/view3d_snap.c +++ b/source/blender/editors/space_view3d/view3d_snap.c @@ -543,7 +543,8 @@ static int snap_sel_to_grid(bContext *C, wmOperator *op) } CTX_DATA_END; } - ED_anim_dag_flush_update(C); + + DAG_ids_flush_update(0); WM_event_add_notifier(C, NC_OBJECT|ND_TRANSFORM, NULL); return OPERATOR_FINISHED; @@ -667,7 +668,8 @@ static int snap_sel_to_curs(bContext *C, wmOperator *op) } CTX_DATA_END; } - ED_anim_dag_flush_update(C); + + DAG_ids_flush_update(0); WM_event_add_notifier(C, NC_OBJECT|ND_TRANSFORM, NULL); return OPERATOR_FINISHED; @@ -1058,7 +1060,7 @@ static int snap_selected_to_center(bContext *C, wmOperator *op) CTX_DATA_END; } - ED_anim_dag_flush_update(C); + DAG_ids_flush_update(0); WM_event_add_notifier(C, NC_OBJECT|ND_TRANSFORM, NULL); return OPERATOR_FINISHED; |