Changeset View
Changeset View
Standalone View
Standalone View
source/blender/depsgraph/intern/builder/deg_builder_relations_rig.cc
| Show First 20 Lines • Show All 316 Lines • ▼ Show 20 Lines | void DepsgraphRelationBuilder::build_rig(Object *object) | ||||
| * | * | ||||
| * Unsolved Issues: | * Unsolved Issues: | ||||
| * - Care is needed to ensure that multi-headed trees work out the same as | * - Care is needed to ensure that multi-headed trees work out the same as | ||||
| * in ik-tree building | * in ik-tree building | ||||
| * - Animated chain-lengths are a problem. */ | * - Animated chain-lengths are a problem. */ | ||||
| RootPChanMap root_map; | RootPChanMap root_map; | ||||
| bool pose_depends_on_local_transform = false; | bool pose_depends_on_local_transform = false; | ||||
| LISTBASE_FOREACH (bPoseChannel *, pchan, &object->pose->chanbase) { | LISTBASE_FOREACH (bPoseChannel *, pchan, &object->pose->chanbase) { | ||||
| const BuilderStack::ScopedEntry stack_entry = stack_.trace(*pchan); | |||||
| LISTBASE_FOREACH (bConstraint *, con, &pchan->constraints) { | LISTBASE_FOREACH (bConstraint *, con, &pchan->constraints) { | ||||
| const BuilderStack::ScopedEntry stack_entry = stack_.trace(*con); | |||||
| switch (con->type) { | switch (con->type) { | ||||
| case CONSTRAINT_TYPE_KINEMATIC: | case CONSTRAINT_TYPE_KINEMATIC: | ||||
| build_ik_pose(object, pchan, con, &root_map); | build_ik_pose(object, pchan, con, &root_map); | ||||
| pose_depends_on_local_transform = true; | pose_depends_on_local_transform = true; | ||||
| break; | break; | ||||
| case CONSTRAINT_TYPE_SPLINEIK: | case CONSTRAINT_TYPE_SPLINEIK: | ||||
| build_splineik_pose(object, pchan, con, &root_map); | build_splineik_pose(object, pchan, con, &root_map); | ||||
| pose_depends_on_local_transform = true; | pose_depends_on_local_transform = true; | ||||
| Show All 17 Lines | if (pose_depends_on_local_transform) { | ||||
| /* TODO(sergey): Once partial updates are possible use relation between | /* TODO(sergey): Once partial updates are possible use relation between | ||||
| * object transform and solver itself in its build function. */ | * object transform and solver itself in its build function. */ | ||||
| ComponentKey pose_key(&object->id, NodeType::EVAL_POSE); | ComponentKey pose_key(&object->id, NodeType::EVAL_POSE); | ||||
| ComponentKey local_transform_key(&object->id, NodeType::TRANSFORM); | ComponentKey local_transform_key(&object->id, NodeType::TRANSFORM); | ||||
| add_relation(local_transform_key, pose_key, "Local Transforms"); | add_relation(local_transform_key, pose_key, "Local Transforms"); | ||||
| } | } | ||||
| /* Links between operations for each bone. */ | /* Links between operations for each bone. */ | ||||
| LISTBASE_FOREACH (bPoseChannel *, pchan, &object->pose->chanbase) { | LISTBASE_FOREACH (bPoseChannel *, pchan, &object->pose->chanbase) { | ||||
| const BuilderStack::ScopedEntry stack_entry = stack_.trace(*pchan); | |||||
| build_idproperties(pchan->prop); | build_idproperties(pchan->prop); | ||||
| OperationKey bone_local_key( | OperationKey bone_local_key( | ||||
| &object->id, NodeType::BONE, pchan->name, OperationCode::BONE_LOCAL); | &object->id, NodeType::BONE, pchan->name, OperationCode::BONE_LOCAL); | ||||
| OperationKey bone_pose_key( | OperationKey bone_pose_key( | ||||
| &object->id, NodeType::BONE, pchan->name, OperationCode::BONE_POSE_PARENT); | &object->id, NodeType::BONE, pchan->name, OperationCode::BONE_POSE_PARENT); | ||||
| OperationKey bone_ready_key( | OperationKey bone_ready_key( | ||||
| &object->id, NodeType::BONE, pchan->name, OperationCode::BONE_READY); | &object->id, NodeType::BONE, pchan->name, OperationCode::BONE_READY); | ||||
| OperationKey bone_done_key(&object->id, NodeType::BONE, pchan->name, OperationCode::BONE_DONE); | OperationKey bone_done_key(&object->id, NodeType::BONE, pchan->name, OperationCode::BONE_DONE); | ||||
| ▲ Show 20 Lines • Show All 94 Lines • Show Last 20 Lines | |||||