Changeset View
Changeset View
Standalone View
Standalone View
source/blender/blenkernel/intern/armature.c
| Show First 20 Lines • Show All 2,383 Lines • ▼ Show 20 Lines | else if (pchan->bone->layer & layer_protected) { | ||||
| * we get the libs direct linked in this blend. | * we get the libs direct linked in this blend. | ||||
| */ | */ | ||||
| BKE_constraints_proxylocal_extract(&proxylocal_constraints, &pchan->constraints); | BKE_constraints_proxylocal_extract(&proxylocal_constraints, &pchan->constraints); | ||||
| BKE_constraints_copy(&pchanw.constraints, &pchanp->constraints, false); | BKE_constraints_copy(&pchanw.constraints, &pchanp->constraints, false); | ||||
| BLI_movelisttolist(&pchanw.constraints, &proxylocal_constraints); | BLI_movelisttolist(&pchanw.constraints, &proxylocal_constraints); | ||||
| /* constraints - set target ob pointer to own object */ | /* constraints - set target ob pointer to own object */ | ||||
| for (con = pchanw.constraints.first; con; con = con->next) { | for (con = pchanw.constraints.first; con; con = con->next) { | ||||
| const bConstraintTypeInfo *cti = BKE_constraint_typeinfo_get(con); | |||||
| ListBase targets = {NULL, NULL}; | ListBase targets = {NULL, NULL}; | ||||
| bConstraintTarget *ct; | bConstraintTarget *ct; | ||||
| if (cti && cti->get_constraint_targets) { | if (BKE_constraint_targets_get(con, &targets)) { | ||||
| cti->get_constraint_targets(con, &targets); | |||||
| for (ct = targets.first; ct; ct = ct->next) { | for (ct = targets.first; ct; ct = ct->next) { | ||||
| if (ct->tar == from) { | if (ct->tar == from) { | ||||
| ct->tar = ob; | ct->tar = ob; | ||||
| } | } | ||||
| } | } | ||||
| if (cti->flush_constraint_targets) { | BKE_constraint_targets_flush(con, &targets, 0); | ||||
| cti->flush_constraint_targets(con, &targets, 0); | |||||
| } | |||||
| } | } | ||||
| } | } | ||||
| /* free stuff from current channel */ | /* free stuff from current channel */ | ||||
| BKE_pose_channel_free(pchan); | BKE_pose_channel_free(pchan); | ||||
| /* copy data in temp back over to the cleaned-out (but still allocated) original channel */ | /* copy data in temp back over to the cleaned-out (but still allocated) original channel */ | ||||
| *pchan = pchanw; | *pchan = pchanw; | ||||
| ▲ Show 20 Lines • Show All 521 Lines • Show Last 20 Lines | |||||