Depsgraph: Use proper scene to get frame from for pose constraints evaluaiton

Spotted by Luca, thanks!
This commit is contained in:
Sergey Sharybin 2017-04-18 11:31:45 +02:00
parent dd356ec08d
commit 968d86afc3
4 changed files with 7 additions and 5 deletions

View File

@ -177,6 +177,7 @@ void BKE_pose_eval_bone(struct EvaluationContext *eval_ctx,
struct bPoseChannel *pchan);
void BKE_pose_constraints_evaluate(struct EvaluationContext *eval_ctx,
struct Scene *scene,
struct Object *ob,
struct bPoseChannel *pchan);

View File

@ -628,10 +628,10 @@ void BKE_pose_eval_bone(EvaluationContext *UNUSED(eval_ctx),
}
void BKE_pose_constraints_evaluate(EvaluationContext *UNUSED(eval_ctx),
Scene *scene,
Object *ob,
bPoseChannel *pchan)
{
Scene *scene = G.main->scene.first;
DEBUG_PRINT("%s on %s pchan %s\n", __func__, ob->id.name, pchan->name);
bArmature *arm = (bArmature *)ob->data;
if (arm->flag & ARM_RESTPOS) {

View File

@ -130,7 +130,7 @@ struct DepsgraphNodeBuilder {
void build_object(Scene *scene, Base *base, Object *ob);
void build_object_transform(Scene *scene, Object *ob);
void build_object_constraints(Scene *scene, Object *ob);
void build_pose_constraints(Object *ob, bPoseChannel *pchan);
void build_pose_constraints(Scene *scene, Object *ob, bPoseChannel *pchan);
void build_rigidbody(Scene *scene);
void build_particles(Scene *scene, Object *ob);
void build_cloth(Scene *scene, Object *object);

View File

@ -64,11 +64,12 @@ extern "C" {
namespace DEG {
void DepsgraphNodeBuilder::build_pose_constraints(Object *ob, bPoseChannel *pchan)
void DepsgraphNodeBuilder::build_pose_constraints(Scene *scene, Object *ob, bPoseChannel *pchan)
{
/* create node for constraint stack */
add_operation_node(&ob->id, DEPSNODE_TYPE_BONE, pchan->name,
DEPSOP_TYPE_EXEC, function_bind(BKE_pose_constraints_evaluate, _1, ob, pchan),
DEPSOP_TYPE_EXEC,
function_bind(BKE_pose_constraints_evaluate, _1, scene, ob, pchan),
DEG_OPCODE_BONE_CONSTRAINTS);
}
@ -201,7 +202,7 @@ void DepsgraphNodeBuilder::build_rig(Scene *scene, Object *ob)
/* constraints */
if (pchan->constraints.first != NULL) {
build_pose_constraints(ob, pchan);
build_pose_constraints(scene, ob, pchan);
}
/**