Changeset View
Changeset View
Standalone View
Standalone View
source/blender/depsgraph/intern/builder/deg_builder_relations_rig.cc
| Show First 20 Lines • Show All 458 Lines • ▼ Show 20 Lines | else { | ||||
| add_relation(bone_pose_key, bone_ready_key, "Pose -> Ready"); | add_relation(bone_pose_key, bone_ready_key, "Pose -> Ready"); | ||||
| } | } | ||||
| /* Bone ready -> Bone done. | /* Bone ready -> Bone done. | ||||
| * NOTE: For bones without IK, this is all that's needed. | * NOTE: For bones without IK, this is all that's needed. | ||||
| * For IK chains however, an additional rel is created from IK | * For IK chains however, an additional rel is created from IK | ||||
| * to done, with transitive reduction removing this one.. | * to done, with transitive reduction removing this one.. | ||||
| */ | */ | ||||
| add_relation(bone_ready_key, bone_done_key, "Ready -> Done"); | add_relation(bone_ready_key, bone_done_key, "Ready -> Done"); | ||||
| /* B-Bone shape is the real final step after Done if present. */ | |||||
| if (pchan->bone != NULL && pchan->bone->segments > 1) { | |||||
| OperationKey bone_segments_key(&object->id, | |||||
| DEG_NODE_TYPE_BONE, | |||||
| pchan->name, | |||||
| DEG_OPCODE_BONE_SEGMENTS); | |||||
| /* B-Bone shape depends on the final position of the bone. */ | |||||
| add_relation(bone_done_key, bone_segments_key, "Done -> B-Bone Segments"); | |||||
| /* B-Bone shape depends on final position of handle bones. */ | |||||
| bPoseChannel *prev, *next; | |||||
| BKE_pchan_get_bbone_handles(pchan, &prev, &next); | |||||
| if (prev) { | |||||
| OperationKey prev_key(&object->id, | |||||
| DEG_NODE_TYPE_BONE, | |||||
| prev->name, | |||||
| DEG_OPCODE_BONE_DONE); | |||||
| add_relation(prev_key, bone_segments_key, "Prev Handle -> B-Bone Segments"); | |||||
| } | |||||
| if (next) { | |||||
| OperationKey next_key(&object->id, | |||||
| DEG_NODE_TYPE_BONE, | |||||
| next->name, | |||||
| DEG_OPCODE_BONE_DONE); | |||||
| add_relation(next_key, bone_segments_key, "Next Handle -> B-Bone Segments"); | |||||
| } | |||||
| /* Pose requires the B-Bone shape. */ | |||||
| add_relation(bone_segments_key, pose_done_key, "PoseEval Result-Bone Link"); | |||||
| add_relation(bone_segments_key, pose_cleanup_key, "Cleanup dependency"); | |||||
| } | |||||
| else { | |||||
| /* assume that all bones must be done for the pose to be ready | /* assume that all bones must be done for the pose to be ready | ||||
| * (for deformers) | * (for deformers) | ||||
| */ | */ | ||||
| add_relation(bone_done_key, pose_done_key, "PoseEval Result-Bone Link"); | add_relation(bone_done_key, pose_done_key, "PoseEval Result-Bone Link"); | ||||
| add_relation(bone_done_key, pose_cleanup_key, "Cleanup dependency"); | add_relation(bone_done_key, pose_cleanup_key, "Cleanup dependency"); | ||||
| } | |||||
| /* Custom shape. */ | /* Custom shape. */ | ||||
| if (pchan->custom != NULL) { | if (pchan->custom != NULL) { | ||||
| build_object(NULL, pchan->custom); | build_object(NULL, pchan->custom); | ||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| void DepsgraphRelationBuilder::build_proxy_rig(Object *object) | void DepsgraphRelationBuilder::build_proxy_rig(Object *object) | ||||
| ▲ Show 20 Lines • Show All 58 Lines • Show Last 20 Lines | |||||