forked from bartvdbraak/blender
Depsgraph: Use proper scene to get frame from for pose constraints evaluaiton
Spotted by Luca, thanks!
This commit is contained in:
parent
dd356ec08d
commit
968d86afc3
@ -177,6 +177,7 @@ void BKE_pose_eval_bone(struct EvaluationContext *eval_ctx,
|
|||||||
struct bPoseChannel *pchan);
|
struct bPoseChannel *pchan);
|
||||||
|
|
||||||
void BKE_pose_constraints_evaluate(struct EvaluationContext *eval_ctx,
|
void BKE_pose_constraints_evaluate(struct EvaluationContext *eval_ctx,
|
||||||
|
struct Scene *scene,
|
||||||
struct Object *ob,
|
struct Object *ob,
|
||||||
struct bPoseChannel *pchan);
|
struct bPoseChannel *pchan);
|
||||||
|
|
||||||
|
@ -628,10 +628,10 @@ void BKE_pose_eval_bone(EvaluationContext *UNUSED(eval_ctx),
|
|||||||
}
|
}
|
||||||
|
|
||||||
void BKE_pose_constraints_evaluate(EvaluationContext *UNUSED(eval_ctx),
|
void BKE_pose_constraints_evaluate(EvaluationContext *UNUSED(eval_ctx),
|
||||||
|
Scene *scene,
|
||||||
Object *ob,
|
Object *ob,
|
||||||
bPoseChannel *pchan)
|
bPoseChannel *pchan)
|
||||||
{
|
{
|
||||||
Scene *scene = G.main->scene.first;
|
|
||||||
DEBUG_PRINT("%s on %s pchan %s\n", __func__, ob->id.name, pchan->name);
|
DEBUG_PRINT("%s on %s pchan %s\n", __func__, ob->id.name, pchan->name);
|
||||||
bArmature *arm = (bArmature *)ob->data;
|
bArmature *arm = (bArmature *)ob->data;
|
||||||
if (arm->flag & ARM_RESTPOS) {
|
if (arm->flag & ARM_RESTPOS) {
|
||||||
|
@ -130,7 +130,7 @@ struct DepsgraphNodeBuilder {
|
|||||||
void build_object(Scene *scene, Base *base, Object *ob);
|
void build_object(Scene *scene, Base *base, Object *ob);
|
||||||
void build_object_transform(Scene *scene, Object *ob);
|
void build_object_transform(Scene *scene, Object *ob);
|
||||||
void build_object_constraints(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_rigidbody(Scene *scene);
|
||||||
void build_particles(Scene *scene, Object *ob);
|
void build_particles(Scene *scene, Object *ob);
|
||||||
void build_cloth(Scene *scene, Object *object);
|
void build_cloth(Scene *scene, Object *object);
|
||||||
|
@ -64,11 +64,12 @@ extern "C" {
|
|||||||
|
|
||||||
namespace DEG {
|
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 */
|
/* create node for constraint stack */
|
||||||
add_operation_node(&ob->id, DEPSNODE_TYPE_BONE, pchan->name,
|
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);
|
DEG_OPCODE_BONE_CONSTRAINTS);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -201,7 +202,7 @@ void DepsgraphNodeBuilder::build_rig(Scene *scene, Object *ob)
|
|||||||
|
|
||||||
/* constraints */
|
/* constraints */
|
||||||
if (pchan->constraints.first != NULL) {
|
if (pchan->constraints.first != NULL) {
|
||||||
build_pose_constraints(ob, pchan);
|
build_pose_constraints(scene, ob, pchan);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
Reference in New Issue
Block a user