Changeset View
Changeset View
Standalone View
Standalone View
source/blender/depsgraph/intern/builder/deg_builder_relations.cc
| Show First 20 Lines • Show All 1,011 Lines • ▼ Show 20 Lines | else if (cti->get_constraint_targets) { | ||||
| DEG_NODE_TYPE_TRANSFORM); | DEG_NODE_TYPE_TRANSFORM); | ||||
| add_relation(target_transform_key, constraint_op_key, cti->name); | add_relation(target_transform_key, constraint_op_key, cti->name); | ||||
| } | } | ||||
| else if ((ct->tar->type == OB_ARMATURE) && (ct->subtarget[0])) { | else if ((ct->tar->type == OB_ARMATURE) && (ct->subtarget[0])) { | ||||
| eDepsOperation_Code opcode; | eDepsOperation_Code opcode; | ||||
| /* relation to bone */ | /* relation to bone */ | ||||
| opcode = bone_target_opcode(&ct->tar->id, ct->subtarget, | opcode = bone_target_opcode(&ct->tar->id, ct->subtarget, | ||||
| id, component_subdata, root_map); | id, component_subdata, root_map); | ||||
| OperationKey target_key(&ct->tar->id, | /* Armature constraint always wants the final position and chan_mat. */ | ||||
| DEG_NODE_TYPE_BONE, | if (ELEM(con->type, CONSTRAINT_TYPE_ARMATURE)) { | ||||
| ct->subtarget, | opcode = DEG_OPCODE_BONE_DONE; | ||||
| opcode); | } | ||||
| add_relation(target_key, constraint_op_key, cti->name); | |||||
| /* if needs bbone shape, also reference handles */ | /* if needs bbone shape, also reference handles */ | ||||
| if (BKE_constraint_target_uses_bbone(con, ct)) { | if (BKE_constraint_target_uses_bbone(con, ct)) { | ||||
| bPoseChannel *pchan = BKE_pose_channel_find_name(ct->tar->pose, ct->subtarget); | bPoseChannel *pchan = BKE_pose_channel_find_name(ct->tar->pose, ct->subtarget); | ||||
| /* actually a bbone */ | /* actually a bbone */ | ||||
| if (pchan && pchan->bone && pchan->bone->segments > 1) { | if (pchan && pchan->bone && pchan->bone->segments > 1) { | ||||
| bPoseChannel *prev, *next; | opcode = DEG_OPCODE_BONE_SEGMENTS; | ||||
| BKE_pchan_get_bbone_handles(pchan, &prev, &next); | |||||
| /* add handle links */ | |||||
| if (prev) { | |||||
| opcode = bone_target_opcode(&ct->tar->id, prev->name, | |||||
| id, component_subdata, root_map); | |||||
| OperationKey prev_key(&ct->tar->id, | |||||
| DEG_NODE_TYPE_BONE, | |||||
| prev->name, | |||||
| opcode); | |||||
| add_relation(prev_key, constraint_op_key, cti->name); | |||||
| } | } | ||||
| if (next) { | } | ||||
| opcode = bone_target_opcode(&ct->tar->id, next->name, | OperationKey target_key(&ct->tar->id, | ||||
| id, component_subdata, root_map); | |||||
| OperationKey next_key(&ct->tar->id, | |||||
| DEG_NODE_TYPE_BONE, | DEG_NODE_TYPE_BONE, | ||||
| next->name, | ct->subtarget, | ||||
| opcode); | opcode); | ||||
| add_relation(next_key, constraint_op_key, cti->name); | add_relation(target_key, constraint_op_key, cti->name); | ||||
| } | |||||
| } | |||||
| } | |||||
| } | } | ||||
| else if (ELEM(ct->tar->type, OB_MESH, OB_LATTICE) && | else if (ELEM(ct->tar->type, OB_MESH, OB_LATTICE) && | ||||
| (ct->subtarget[0])) | (ct->subtarget[0])) | ||||
| { | { | ||||
| /* Vertex group. */ | /* Vertex group. */ | ||||
| /* NOTE: for now, we don't need to represent vertex groups | /* NOTE: for now, we don't need to represent vertex groups | ||||
| * separately. | * separately. | ||||
| */ | */ | ||||
| ▲ Show 20 Lines • Show All 1,486 Lines • Show Last 20 Lines | |||||