Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/transform/transform_orientations.c
| Show First 20 Lines • Show All 507 Lines • ▼ Show 20 Lines | short ED_transform_calc_orientation_from_type_ex(const Scene *scene, | ||||
| const int pivot_point, | const int pivot_point, | ||||
| float r_mat[3][3]) | float r_mat[3][3]) | ||||
| { | { | ||||
| switch (orientation_index) { | switch (orientation_index) { | ||||
| case V3D_ORIENT_GIMBAL: { | case V3D_ORIENT_GIMBAL: { | ||||
| if (ob) { | if (ob) { | ||||
| if (ob->mode & OB_MODE_POSE) { | if (ob->mode & OB_MODE_POSE) { | ||||
| const bPoseChannel *pchan = BKE_pose_channel_active(ob); | const bPoseChannel *pchan = BKE_pose_channel_active_if_layer_visible(ob); | ||||
| if (pchan && gimbal_axis_pose(ob, pchan, r_mat)) { | if (pchan && gimbal_axis_pose(ob, pchan, r_mat)) { | ||||
| break; | break; | ||||
| } | } | ||||
| } | } | ||||
| else { | else { | ||||
| if (gimbal_axis_object(ob, r_mat)) { | if (gimbal_axis_object(ob, r_mat)) { | ||||
| break; | break; | ||||
| } | } | ||||
| ▲ Show 20 Lines • Show All 694 Lines • ▼ Show 20 Lines | #undef SEL_F3 | ||||
| } | } | ||||
| } | } | ||||
| else if (ob && (ob->mode & OB_MODE_POSE)) { | else if (ob && (ob->mode & OB_MODE_POSE)) { | ||||
| bArmature *arm = ob->data; | bArmature *arm = ob->data; | ||||
| bPoseChannel *pchan; | bPoseChannel *pchan; | ||||
| float imat[3][3], mat[3][3]; | float imat[3][3], mat[3][3]; | ||||
| bool ok = false; | bool ok = false; | ||||
| if (activeOnly && (pchan = BKE_pose_channel_active(ob))) { | if (activeOnly && (pchan = BKE_pose_channel_active_if_layer_visible(ob))) { | ||||
| add_v3_v3(normal, pchan->pose_mat[2]); | add_v3_v3(normal, pchan->pose_mat[2]); | ||||
| add_v3_v3(plane, pchan->pose_mat[1]); | add_v3_v3(plane, pchan->pose_mat[1]); | ||||
| ok = true; | ok = true; | ||||
| } | } | ||||
| else { | else { | ||||
| int transformed_len; | int transformed_len; | ||||
| transformed_len = armature_bone_transflags_update_recursive(arm, &arm->bonebase, true); | transformed_len = armature_bone_transflags_update_recursive(arm, &arm->bonebase, true); | ||||
| if (transformed_len) { | if (transformed_len) { | ||||
| ▲ Show 20 Lines • Show All 118 Lines • Show Last 20 Lines | |||||