diff options
author | Brecht Van Lommel <brechtvanlommel@gmail.com> | 2018-04-06 13:07:27 +0300 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@gmail.com> | 2018-04-16 20:55:33 +0300 |
commit | 34ab90f546f097cada951b2c9ca22bf271996980 (patch) | |
tree | ebcdb3d37120ac1d8fb16462b9104badd1800329 /source/blender/collada/AnimationExporter.cpp | |
parent | 0c495005dd83913864acb510c1d4194a2275dbb0 (diff) |
Depsgraph: remove EvaluationContext, pass Depsgraph instead.
The depsgraph was always created within a fixed evaluation context. Passing
both risks the depsgraph and evaluation context not matching, and it
complicates the Python API where we'd have to expose both which is not so
easy to understand.
This also removes the global evaluation context in main, which assumed there
to be a single active scene and view layer.
Differential Revision: https://developer.blender.org/D3152
Diffstat (limited to 'source/blender/collada/AnimationExporter.cpp')
-rw-r--r-- | source/blender/collada/AnimationExporter.cpp | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/source/blender/collada/AnimationExporter.cpp b/source/blender/collada/AnimationExporter.cpp index 2f692cb0f33..439f48897f6 100644 --- a/source/blender/collada/AnimationExporter.cpp +++ b/source/blender/collada/AnimationExporter.cpp @@ -38,7 +38,7 @@ bool AnimationExporter::exportAnimations(Scene *sce) { bool has_animations = hasAnimations(sce); if (has_animations) { - this->eval_ctx = eval_ctx; + this->depsgraph = depsgraph; this->scene = sce; openLibrary(); @@ -215,7 +215,7 @@ void AnimationExporter::export_sampled_matrix_animation(Object *ob, std::vector< for (std::vector<float>::iterator ctime = ctimes.begin(); ctime != ctimes.end(); ++ctime) { float fmat[4][4]; - bc_update_scene(eval_ctx, scene, *ctime); + bc_update_scene(depsgraph, scene, *ctime); BKE_object_matrix_local_get(ob, fmat); if (this->export_settings->limit_precision) bc_sanitize_mat(fmat, 6); @@ -247,7 +247,7 @@ void AnimationExporter::export_sampled_transrotloc_animation(Object *ob, std::ve float fsize[3]; float feul[3]; - bc_update_scene(eval_ctx, scene, *ctime); + bc_update_scene(depsgraph, scene, *ctime); BKE_object_matrix_local_get(ob, fmat); mat4_decompose(floc, fquat, fsize, fmat); quat_to_eul(feul, fquat); @@ -722,7 +722,7 @@ void AnimationExporter::sample_and_write_bone_animation_matrix(Object *ob_arm, B if (flag & ARM_RESTPOS) { arm->flag &= ~ARM_RESTPOS; - BKE_pose_where_is(eval_ctx, scene, ob_arm); + BKE_pose_where_is(depsgraph, scene, ob_arm); } if (fra.size()) { @@ -731,7 +731,7 @@ void AnimationExporter::sample_and_write_bone_animation_matrix(Object *ob_arm, B if (flag & ARM_RESTPOS) arm->flag = flag; - BKE_pose_where_is(eval_ctx, scene, ob_arm); + BKE_pose_where_is(depsgraph, scene, ob_arm); } void AnimationExporter::dae_baked_animation(std::vector<float> &fra, Object *ob_arm, Bone *bone) @@ -1022,7 +1022,7 @@ void AnimationExporter::evaluate_anim_with_constraints(Object *ob, float ctime) if (obtar) { BKE_animsys_evaluate_animdata(scene, &obtar->id, obtar->adt, ctime, ADT_RECALC_ANIM); - BKE_object_where_is_calc_time(this->eval_ctx, scene, obtar, ctime); + BKE_object_where_is_calc_time(this->depsgraph, scene, obtar, ctime); } } @@ -1030,7 +1030,7 @@ void AnimationExporter::evaluate_anim_with_constraints(Object *ob, float ctime) cti->flush_constraint_targets(con, &targets, 1); } } - BKE_object_where_is_calc_time(this->eval_ctx, scene, ob, ctime); + BKE_object_where_is_calc_time(this->depsgraph, scene, ob, ctime); } /* @@ -1316,16 +1316,16 @@ std::string AnimationExporter::create_4x4_source(std::vector<float> &frames, Obj float frame = *it; float ctime = BKE_scene_frame_get_from_ctime(scene, frame); - bc_update_scene(eval_ctx, scene, ctime); + bc_update_scene(depsgraph, scene, ctime); if (is_bone_animation) { if (pchan->flag & POSE_CHAIN) { enable_fcurves(ob->adt->action, NULL); BKE_animsys_evaluate_animdata(scene, &ob->id, ob->adt, ctime, ADT_RECALC_ALL); - BKE_pose_where_is(eval_ctx, scene, ob); + BKE_pose_where_is(depsgraph, scene, ob); } else { - BKE_pose_where_is_bone(eval_ctx, scene, ob, pchan, ctime, 1); + BKE_pose_where_is_bone(depsgraph, scene, ob, pchan, ctime, 1); } // compute bone local mat @@ -1843,7 +1843,7 @@ void AnimationExporter::sample_and_write_bone_animation(Object *ob_arm, Bone *bo // exit rest position if (flag & ARM_RESTPOS) { arm->flag &= ~ARM_RESTPOS; - BKE_pose_where_is(eval_ctx, scene, ob_arm); + BKE_pose_where_is(depsgraph, scene, ob_arm); } //v array will hold all values which will be exported. if (fra.size()) { @@ -1873,7 +1873,7 @@ void AnimationExporter::sample_and_write_bone_animation(Object *ob_arm, Bone *bo // restore restpos if (flag & ARM_RESTPOS) arm->flag = flag; - BKE_pose_where_is(eval_ctx, scene, ob_arm); + BKE_pose_where_is(depsgraph, scene, ob_arm); } void AnimationExporter::sample_animation(float *v, std::vector<float> &frames, int type, Bone *bone, Object *ob_arm, bPoseChannel *pchan) @@ -1898,7 +1898,7 @@ void AnimationExporter::sample_animation(float *v, std::vector<float> &frames, i BKE_animsys_evaluate_animdata(scene, &ob_arm->id, ob_arm->adt, ctime, ADT_RECALC_ANIM); - BKE_pose_where_is_bone(eval_ctx, scene, ob_arm, pchan, ctime, 1); + BKE_pose_where_is_bone(depsgraph, scene, ob_arm, pchan, ctime, 1); // compute bone local mat if (bone->parent) { |