Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergey Sharybin <sergey.vfx@gmail.com>2019-07-31 15:56:17 +0300
committerSergey Sharybin <sergey.vfx@gmail.com>2019-07-31 16:11:38 +0300
commit64e029ea92071870b5004baaf6401fcf4b370fd8 (patch)
tree70f4105f06047679dc5f4f82a9382b9d5ae46db2 /source/blender/editors
parent9c0e7f7dd6465af491b3f9ad4c26b26fe891bddf (diff)
Animation: Remove depsgraph argument from a lot of API
Use explicit boolean flag to indicate whether flush to original data is needed or not. Makes it possible to avoid confusion on whether an evaluated or any depsgraph can be passed to the API. Allows to remove depsgraph from bAnimContext as well. Reviewers: brecht Differential Revision: https://developer.blender.org/D5379
Diffstat (limited to 'source/blender/editors')
-rw-r--r--source/blender/editors/animation/anim_channels_defines.c6
-rw-r--r--source/blender/editors/animation/anim_filter.c1
-rw-r--r--source/blender/editors/animation/keyframing.c5
-rw-r--r--source/blender/editors/animation/keyingsets.c2
-rw-r--r--source/blender/editors/armature/pose_transform.c2
-rw-r--r--source/blender/editors/include/ED_anim_api.h2
-rw-r--r--source/blender/editors/include/ED_keyframing.h1
-rw-r--r--source/blender/editors/interface/interface_anim.c2
-rw-r--r--source/blender/editors/object/object_modifier.c5
-rw-r--r--source/blender/editors/space_action/action_edit.c2
-rw-r--r--source/blender/editors/space_graph/graph_edit.c2
-rw-r--r--source/blender/editors/transform/transform_conversions.c4
12 files changed, 7 insertions, 27 deletions
diff --git a/source/blender/editors/animation/anim_channels_defines.c b/source/blender/editors/animation/anim_channels_defines.c
index 91448b2ecb9..3d7178a4114 100644
--- a/source/blender/editors/animation/anim_channels_defines.c
+++ b/source/blender/editors/animation/anim_channels_defines.c
@@ -4340,7 +4340,6 @@ static void achannel_setting_slider_cb(bContext *C, void *id_poin, void *fcu_poi
AnimData *adt = BKE_animdata_from_id(id);
FCurve *fcu = (FCurve *)fcu_poin;
- Depsgraph *depsgraph = CTX_data_depsgraph(C);
ReportList *reports = CTX_wm_reports(C);
Scene *scene = CTX_data_scene(C);
ToolSettings *ts = scene->toolsettings;
@@ -4356,7 +4355,7 @@ static void achannel_setting_slider_cb(bContext *C, void *id_poin, void *fcu_poi
/* Get NLA context for value remapping */
NlaKeyframingContext *nla_context = BKE_animsys_get_nla_keyframing_context(
- &nla_cache, depsgraph, &id_ptr, adt, (float)CFRA);
+ &nla_cache, &id_ptr, adt, (float)CFRA, false);
/* get current frame and apply NLA-mapping to it (if applicable) */
cfra = BKE_nla_tweakedit_remap(adt, (float)CFRA, NLATIME_CONVERT_UNMAP);
@@ -4395,7 +4394,6 @@ static void achannel_setting_slider_shapekey_cb(bContext *C, void *key_poin, voi
KeyBlock *kb = (KeyBlock *)kb_poin;
char *rna_path = BKE_keyblock_curval_rnapath_get(key, kb);
- Depsgraph *depsgraph = CTX_data_depsgraph(C);
ReportList *reports = CTX_wm_reports(C);
Scene *scene = CTX_data_scene(C);
ToolSettings *ts = scene->toolsettings;
@@ -4411,7 +4409,7 @@ static void achannel_setting_slider_shapekey_cb(bContext *C, void *key_poin, voi
/* Get NLA context for value remapping */
NlaKeyframingContext *nla_context = BKE_animsys_get_nla_keyframing_context(
- &nla_cache, depsgraph, &id_ptr, key->adt, (float)CFRA);
+ &nla_cache, &id_ptr, key->adt, (float)CFRA, false);
/* get current frame and apply NLA-mapping to it (if applicable) */
cfra = BKE_nla_tweakedit_remap(key->adt, (float)CFRA, NLATIME_CONVERT_UNMAP);
diff --git a/source/blender/editors/animation/anim_filter.c b/source/blender/editors/animation/anim_filter.c
index 2d16ce30d31..625a52fc800 100644
--- a/source/blender/editors/animation/anim_filter.c
+++ b/source/blender/editors/animation/anim_filter.c
@@ -412,7 +412,6 @@ bool ANIM_animdata_get_context(const bContext *C, bAnimContext *ac)
if (scene) {
ac->markers = ED_context_get_markers(C);
}
- ac->depsgraph = CTX_data_depsgraph(C);
ac->view_layer = CTX_data_view_layer(C);
ac->obact = (ac->view_layer->basact) ? ac->view_layer->basact->object : NULL;
ac->sa = sa;
diff --git a/source/blender/editors/animation/keyframing.c b/source/blender/editors/animation/keyframing.c
index 40b193f501e..de6e4c2fd0d 100644
--- a/source/blender/editors/animation/keyframing.c
+++ b/source/blender/editors/animation/keyframing.c
@@ -1323,7 +1323,6 @@ static bool insert_keyframe_fcurve_value(Main *bmain,
* index of -1 keys all array indices
*/
short insert_keyframe(Main *bmain,
- Depsgraph *depsgraph,
ReportList *reports,
ID *id,
bAction *act,
@@ -1381,7 +1380,7 @@ short insert_keyframe(Main *bmain,
if (adt && adt->action == act) {
/* Get NLA context for value remapping. */
nla_context = BKE_animsys_get_nla_keyframing_context(
- nla_cache ? nla_cache : &tmp_nla_cache, depsgraph, &id_ptr, adt, cfra);
+ nla_cache ? nla_cache : &tmp_nla_cache, &id_ptr, adt, cfra, false);
/* Apply NLA-mapping to frame. */
cfra = BKE_nla_tweakedit_remap(adt, cfra, NLATIME_CONVERT_UNMAP);
@@ -2348,7 +2347,6 @@ void ANIM_OT_keyframe_delete_v3d(wmOperatorType *ot)
static int insert_key_button_exec(bContext *C, wmOperator *op)
{
- Depsgraph *depsgraph = CTX_data_depsgraph(C);
Main *bmain = CTX_data_main(C);
Scene *scene = CTX_data_scene(C);
ToolSettings *ts = scene->toolsettings;
@@ -2436,7 +2434,6 @@ static int insert_key_button_exec(bContext *C, wmOperator *op)
}
success = insert_keyframe(bmain,
- depsgraph,
op->reports,
ptr.id.data,
NULL,
diff --git a/source/blender/editors/animation/keyingsets.c b/source/blender/editors/animation/keyingsets.c
index 0cb83c79c85..ccd0fc54611 100644
--- a/source/blender/editors/animation/keyingsets.c
+++ b/source/blender/editors/animation/keyingsets.c
@@ -1030,7 +1030,6 @@ static short keyingset_apply_keying_flags(const short base_flags,
int ANIM_apply_keyingset(
bContext *C, ListBase *dsources, bAction *act, KeyingSet *ks, short mode, float cfra)
{
- Depsgraph *depsgraph = CTX_data_depsgraph(C);
Main *bmain = CTX_data_main(C);
Scene *scene = CTX_data_scene(C);
ReportList *reports = CTX_wm_reports(C);
@@ -1125,7 +1124,6 @@ int ANIM_apply_keyingset(
/* action to take depends on mode */
if (mode == MODIFYKEY_MODE_INSERT) {
success += insert_keyframe(bmain,
- depsgraph,
reports,
ksp->id,
act,
diff --git a/source/blender/editors/armature/pose_transform.c b/source/blender/editors/armature/pose_transform.c
index 325e6eaee2a..224bbb1d79f 100644
--- a/source/blender/editors/armature/pose_transform.c
+++ b/source/blender/editors/armature/pose_transform.c
@@ -1217,7 +1217,7 @@ static int pose_clear_user_transforms_exec(bContext *C, wmOperator *op)
workob.adt = ob->adt;
workob.pose = dummyPose;
- BKE_animsys_evaluate_animdata(NULL, scene, &workob.id, workob.adt, cframe, ADT_RECALC_ANIM);
+ BKE_animsys_evaluate_animdata(scene, &workob.id, workob.adt, cframe, ADT_RECALC_ANIM, false);
/* copy back values, but on selected bones only */
for (pchan = dummyPose->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 f49d38e1276..a232e1376d3 100644
--- a/source/blender/editors/include/ED_anim_api.h
+++ b/source/blender/editors/include/ED_anim_api.h
@@ -85,8 +85,6 @@ typedef struct bAnimContext {
/** dopesheet data for editor (or which is being used) */
struct bDopeSheet *ads;
- /** active dependency graph */
- struct Depsgraph *depsgraph;
/** Current Main */
struct Main *bmain;
/** active scene */
diff --git a/source/blender/editors/include/ED_keyframing.h b/source/blender/editors/include/ED_keyframing.h
index 9851988edd4..8f197fa9afe 100644
--- a/source/blender/editors/include/ED_keyframing.h
+++ b/source/blender/editors/include/ED_keyframing.h
@@ -129,7 +129,6 @@ bool insert_keyframe_direct(struct ReportList *reports,
* using the current value being keyframed, in the relevant place. Returns success.
*/
short insert_keyframe(struct Main *bmain,
- struct Depsgraph *depsgraph,
struct ReportList *reports,
struct ID *id,
struct bAction *act,
diff --git a/source/blender/editors/interface/interface_anim.c b/source/blender/editors/interface/interface_anim.c
index f1ff23d4108..4d87cc22ef2 100644
--- a/source/blender/editors/interface/interface_anim.c
+++ b/source/blender/editors/interface/interface_anim.c
@@ -318,7 +318,6 @@ void ui_but_anim_autokey(bContext *C, uiBut *but, Scene *scene, float cfra)
/* TODO: this should probably respect the keyingset only option for anim */
if (autokeyframe_cfra_can_key(scene, id)) {
- Depsgraph *depsgraph = CTX_data_depsgraph(C);
ReportList *reports = CTX_wm_reports(C);
ToolSettings *ts = scene->toolsettings;
short flag = ANIM_get_keyframing_flags(scene, 1);
@@ -330,7 +329,6 @@ void ui_but_anim_autokey(bContext *C, uiBut *but, Scene *scene, float cfra)
* E.g., color wheels (see T42567). */
BLI_assert((fcu->array_index == but->rnaindex) || (but->rnaindex == -1));
insert_keyframe(bmain,
- depsgraph,
reports,
id,
action,
diff --git a/source/blender/editors/object/object_modifier.c b/source/blender/editors/object/object_modifier.c
index d1d910021a6..8bc68ea753c 100644
--- a/source/blender/editors/object/object_modifier.c
+++ b/source/blender/editors/object/object_modifier.c
@@ -2316,8 +2316,9 @@ static int ocean_bake_exec(bContext *C, wmOperator *op)
for (f = omd->bakestart; f <= omd->bakeend; f++) {
/* For now only simple animation of time value is supported, nothing else.
* No drivers or other modifier parameters. */
- BKE_animsys_evaluate_animdata(
- CTX_data_depsgraph(C), scene, (ID *)ob, ob->adt, f, ADT_RECALC_ANIM);
+ /* TODO(sergey): This operates on an original data, so no flush is needed. However, baking
+ * usually should happen on an evaluated objects, so this seems to be deeper issue here. */
+ BKE_animsys_evaluate_animdata(scene, (ID *)ob, ob->adt, f, ADT_RECALC_ANIM, false);
och->time[i] = omd->time;
i++;
diff --git a/source/blender/editors/space_action/action_edit.c b/source/blender/editors/space_action/action_edit.c
index 7fc84db3f75..944a0c74f4c 100644
--- a/source/blender/editors/space_action/action_edit.c
+++ b/source/blender/editors/space_action/action_edit.c
@@ -704,7 +704,6 @@ static void insert_action_keys(bAnimContext *ac, short mode)
bAnimListElem *ale;
int filter;
- struct Depsgraph *depsgraph = ac->depsgraph;
ReportList *reports = ac->reports;
Scene *scene = ac->scene;
ToolSettings *ts = scene->toolsettings;
@@ -741,7 +740,6 @@ static void insert_action_keys(bAnimContext *ac, short mode)
*/
if (ale->id && !ale->owner) {
insert_keyframe(ac->bmain,
- depsgraph,
reports,
ale->id,
NULL,
diff --git a/source/blender/editors/space_graph/graph_edit.c b/source/blender/editors/space_graph/graph_edit.c
index dc5837e3fd1..b624e21937f 100644
--- a/source/blender/editors/space_graph/graph_edit.c
+++ b/source/blender/editors/space_graph/graph_edit.c
@@ -604,7 +604,6 @@ static void insert_graph_keys(bAnimContext *ac, eGraphKeys_InsertKey_Types mode)
ReportList *reports = ac->reports;
SpaceGraph *sipo = (SpaceGraph *)ac->sl;
- struct Depsgraph *depsgraph = ac->depsgraph;
Scene *scene = ac->scene;
ToolSettings *ts = scene->toolsettings;
short flag = 0;
@@ -696,7 +695,6 @@ static void insert_graph_keys(bAnimContext *ac, eGraphKeys_InsertKey_Types mode)
*/
if (ale->id && !ale->owner && !fcu->driver) {
insert_keyframe(ac->bmain,
- depsgraph,
reports,
ale->id,
NULL,
diff --git a/source/blender/editors/transform/transform_conversions.c b/source/blender/editors/transform/transform_conversions.c
index 5626e9b5c81..d1bff81c4ae 100644
--- a/source/blender/editors/transform/transform_conversions.c
+++ b/source/blender/editors/transform/transform_conversions.c
@@ -6631,7 +6631,6 @@ void autokeyframe_object(bContext *C, Scene *scene, ViewLayer *view_layer, Objec
// TODO: this should probably be done per channel instead...
if (autokeyframe_cfra_can_key(scene, id)) {
- Depsgraph *depsgraph = CTX_data_depsgraph(C);
ReportList *reports = CTX_wm_reports(C);
ToolSettings *ts = scene->toolsettings;
KeyingSet *active_ks = ANIM_scene_get_active_keyingset(scene);
@@ -6662,7 +6661,6 @@ void autokeyframe_object(bContext *C, Scene *scene, ViewLayer *view_layer, Objec
for (fcu = adt->action->curves.first; fcu; fcu = fcu->next) {
fcu->flag &= ~FCURVE_SELECTED;
insert_keyframe(bmain,
- depsgraph,
reports,
id,
adt->action,
@@ -6777,7 +6775,6 @@ void autokeyframe_pose(bContext *C, Scene *scene, Object *ob, int tmode, short t
// TODO: this should probably be done per channel instead...
if (autokeyframe_cfra_can_key(scene, id)) {
- Depsgraph *depsgraph = CTX_data_depsgraph(C);
ReportList *reports = CTX_wm_reports(C);
ToolSettings *ts = scene->toolsettings;
KeyingSet *active_ks = ANIM_scene_get_active_keyingset(scene);
@@ -6825,7 +6822,6 @@ void autokeyframe_pose(bContext *C, Scene *scene, Object *ob, int tmode, short t
*/
if (pchanName && STREQ(pchanName, pchan->name)) {
insert_keyframe(bmain,
- depsgraph,
reports,
id,
act,