Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/transform/transform_convert_armature.c
| Show First 20 Lines • Show All 343 Lines • ▼ Show 20 Lines | if (con->type == CONSTRAINT_TYPE_KINEMATIC && (con->flag & CONSTRAINT_OFF) == 0) { | ||||
| if (pchan_iter->protectflag & OB_LOCK_ROTY) { | if (pchan_iter->protectflag & OB_LOCK_ROTY) { | ||||
| pchan_iter->ikflag |= BONE_IK_NO_YDOF_TEMP; | pchan_iter->ikflag |= BONE_IK_NO_YDOF_TEMP; | ||||
| } | } | ||||
| if (pchan_iter->protectflag & OB_LOCK_ROTZ) { | if (pchan_iter->protectflag & OB_LOCK_ROTZ) { | ||||
| pchan_iter->ikflag |= BONE_IK_NO_ZDOF_TEMP; | pchan_iter->ikflag |= BONE_IK_NO_ZDOF_TEMP; | ||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| /* Return early (as in: don't actually create a temporary constraint here), since adding | |||||
| * will take place later in add_pose_transdata() for targetless constraints. */ | |||||
| return 0; | |||||
| } | } | ||||
| } | } | ||||
| if ((con->flag & CONSTRAINT_DISABLE) == 0 && (con->enforce != 0.0f)) { | if ((con->flag & CONSTRAINT_DISABLE) == 0 && (con->enforce != 0.0f)) { | ||||
| return 0; | return 0; | ||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| ▲ Show 20 Lines • Show All 337 Lines • ▼ Show 20 Lines | if (data) { | ||||
| } | } | ||||
| td->loc = data->grabtarget; | td->loc = data->grabtarget; | ||||
| copy_v3_v3(td->iloc, td->loc); | copy_v3_v3(td->iloc, td->loc); | ||||
| data->flag |= CONSTRAINT_IK_AUTO; | data->flag |= CONSTRAINT_IK_AUTO; | ||||
| /* Add a temporary auto IK constraint here, as we will only temporarily active this | /* Add a temporary auto IK constraint here, as we will only temporarily active this | ||||
| * targetless bone during transform. (Targetless IK constraints are treated as if they are | * targetless bone during transform. (Targetless IK constraints are treated as if they are | ||||
| * disabled unless they are transformed). */ | * disabled unless they are transformed). | ||||
| * Only do this for targetless IK though, AutoIK already added a constraint in | |||||
| * pose_grab_with_ik_add() beforehand. */ | |||||
| if ((data->flag & CONSTRAINT_IK_TEMP) == 0) { | |||||
| add_temporary_ik_constraint(pchan, data); | add_temporary_ik_constraint(pchan, data); | ||||
| Main *bmain = CTX_data_main(t->context); | Main *bmain = CTX_data_main(t->context); | ||||
| update_deg_with_temporary_ik(bmain, ob); | update_deg_with_temporary_ik(bmain, ob); | ||||
| } | |||||
| /* only object matrix correction */ | /* only object matrix correction */ | ||||
| copy_m3_m3(td->mtx, omat); | copy_m3_m3(td->mtx, omat); | ||||
| pseudoinverse_m3_m3(td->smtx, td->mtx, PSEUDOINVERSE_EPSILON); | pseudoinverse_m3_m3(td->smtx, td->mtx, PSEUDOINVERSE_EPSILON); | ||||
| } | } | ||||
| } | } | ||||
| /* store reference to first constraint */ | /* store reference to first constraint */ | ||||
| ▲ Show 20 Lines • Show All 628 Lines • ▼ Show 20 Lines | if (t->mode == TFM_TRANSLATION) { | ||||
| } | } | ||||
| mul_v3_m4v3(data->grabtarget, flip_mtx, td->loc); | mul_v3_m4v3(data->grabtarget, flip_mtx, td->loc); | ||||
| if (pid) { | if (pid) { | ||||
| /* TODO(germano): Realitve Mirror support */ | /* TODO(germano): Realitve Mirror support */ | ||||
| } | } | ||||
| data->flag |= CONSTRAINT_IK_AUTO; | data->flag |= CONSTRAINT_IK_AUTO; | ||||
| /* Add a temporary auto IK constraint here, as we will only temporarily active this | /* Add a temporary auto IK constraint here, as we will only temporarily active this | ||||
| * target-less bone during transform. (Target-less IK constraints are treated as if they are | * target-less bone during transform. (Target-less IK constraints are treated as if they are | ||||
| * disabled unless they are transformed) */ | * disabled unless they are transformed). | ||||
| * Only do this for targetless IK though, AutoIK already added a constraint in | |||||
| * pose_grab_with_ik_add() beforehand. */ | |||||
| if ((data->flag & CONSTRAINT_IK_TEMP) == 0) { | |||||
| add_temporary_ik_constraint(pchan, data); | add_temporary_ik_constraint(pchan, data); | ||||
| Main *bmain = CTX_data_main(t->context); | Main *bmain = CTX_data_main(t->context); | ||||
| update_deg_with_temporary_ik(bmain, ob); | update_deg_with_temporary_ik(bmain, ob); | ||||
| } | } | ||||
| } | |||||
| if (pid) { | if (pid) { | ||||
| pid++; | pid++; | ||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| static void pose_mirror_info_restore(const PoseInitData_Mirror *pid) | static void pose_mirror_info_restore(const PoseInitData_Mirror *pid) | ||||
| ▲ Show 20 Lines • Show All 425 Lines • Show Last 20 Lines | |||||