Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/armature/armature_add.c
| Show First 20 Lines • Show All 416 Lines • ▼ Show 20 Lines | static void updateDuplicateActionConstraintSettings( | ||||
| EditBone *dup_bone, EditBone *orig_bone, Object *ob, bPoseChannel *pchan, bConstraint *curcon) | EditBone *dup_bone, EditBone *orig_bone, Object *ob, bPoseChannel *pchan, bConstraint *curcon) | ||||
| { | { | ||||
| bActionConstraint *act_con = (bActionConstraint *)curcon->data; | bActionConstraint *act_con = (bActionConstraint *)curcon->data; | ||||
| bAction *act = (bAction *)act_con->act; | bAction *act = (bAction *)act_con->act; | ||||
| float mat[4][4]; | float mat[4][4]; | ||||
| bConstraintOb cob = {.depsgraph = NULL, .scene = NULL, .ob = ob, .pchan = pchan}; | bConstraintOb cob = {.depsgraph = NULL, .scene = NULL, .ob = ob, .pchan = pchan}; | ||||
| BKE_constraint_custom_object_space_get(cob.space_obj_world_matrix, curcon); | BKE_constraint_custom_object_space_init(&cob, curcon); | ||||
| unit_m4(mat); | unit_m4(mat); | ||||
| bPoseChannel *target_pchan = BKE_pose_channel_find_name(ob->pose, act_con->subtarget); | bPoseChannel *target_pchan = BKE_pose_channel_find_name(ob->pose, act_con->subtarget); | ||||
| BKE_constraint_mat_convertspace( | BKE_constraint_mat_convertspace( | ||||
| ob, target_pchan, &cob, mat, curcon->tarspace, CONSTRAINT_SPACE_LOCAL, false); | ob, target_pchan, &cob, mat, curcon->tarspace, CONSTRAINT_SPACE_LOCAL, false); | ||||
| float max_axis_val = 0; | float max_axis_val = 0; | ||||
| int max_axis = 0; | int max_axis = 0; | ||||
| ▲ Show 20 Lines • Show All 137 Lines • ▼ Show 20 Lines | static void updateDuplicateLocRotConstraintSettings(Object *ob, | ||||
| max_vec[0] = limit->xmax; | max_vec[0] = limit->xmax; | ||||
| max_vec[1] = limit->ymax; | max_vec[1] = limit->ymax; | ||||
| max_vec[2] = limit->zmax; | max_vec[2] = limit->zmax; | ||||
| unit_m4(local_mat); | unit_m4(local_mat); | ||||
| bConstraintOb cob = {.depsgraph = NULL, .scene = NULL, .ob = ob, .pchan = pchan}; | bConstraintOb cob = {.depsgraph = NULL, .scene = NULL, .ob = ob, .pchan = pchan}; | ||||
| BKE_constraint_custom_object_space_get(cob.space_obj_world_matrix, curcon); | BKE_constraint_custom_object_space_init(&cob, curcon); | ||||
| BKE_constraint_mat_convertspace( | BKE_constraint_mat_convertspace( | ||||
| ob, pchan, &cob, local_mat, curcon->ownspace, CONSTRAINT_SPACE_LOCAL, false); | ob, pchan, &cob, local_mat, curcon->ownspace, CONSTRAINT_SPACE_LOCAL, false); | ||||
| if (curcon->type == CONSTRAINT_TYPE_ROTLIMIT) { | if (curcon->type == CONSTRAINT_TYPE_ROTLIMIT) { | ||||
| /* Zero out any location translation */ | /* Zero out any location translation */ | ||||
| local_mat[3][0] = local_mat[3][1] = local_mat[3][2] = 0; | local_mat[3][0] = local_mat[3][1] = local_mat[3][2] = 0; | ||||
| } | } | ||||
| Show All 38 Lines | static void updateDuplicateTransformConstraintSettings(Object *ob, | ||||
| bPoseChannel *pchan, | bPoseChannel *pchan, | ||||
| bConstraint *curcon) | bConstraint *curcon) | ||||
| { | { | ||||
| bTransformConstraint *trans = (bTransformConstraint *)curcon->data; | bTransformConstraint *trans = (bTransformConstraint *)curcon->data; | ||||
| float target_mat[4][4], own_mat[4][4], imat[4][4]; | float target_mat[4][4], own_mat[4][4], imat[4][4]; | ||||
| bConstraintOb cob = {.depsgraph = NULL, .scene = NULL, .ob = ob, .pchan = pchan}; | bConstraintOb cob = {.depsgraph = NULL, .scene = NULL, .ob = ob, .pchan = pchan}; | ||||
| BKE_constraint_custom_object_space_get(cob.space_obj_world_matrix, curcon); | BKE_constraint_custom_object_space_init(&cob, curcon); | ||||
| unit_m4(own_mat); | unit_m4(own_mat); | ||||
| BKE_constraint_mat_convertspace( | BKE_constraint_mat_convertspace( | ||||
| ob, pchan, &cob, own_mat, curcon->ownspace, CONSTRAINT_SPACE_LOCAL, false); | ob, pchan, &cob, own_mat, curcon->ownspace, CONSTRAINT_SPACE_LOCAL, false); | ||||
| /* ###Source map mirroring### */ | /* ###Source map mirroring### */ | ||||
| float old_min, old_max; | float old_min, old_max; | ||||
| ▲ Show 20 Lines • Show All 1,077 Lines • Show Last 20 Lines | |||||