Animation: Add in Parent space alignment option to the Transform Orientation gizmo #104724

Merged
Nate Rupsis merged 47 commits from nrupsis/blender:parent-space into main 2023-04-20 17:40:31 +02:00
1 changed files with 7 additions and 6 deletions
Showing only changes of commit 46680d7a33 - Show all commits

View File

@ -590,13 +590,14 @@ static void handle_armature_parent_orientation(const Scene *scene,
{

Some style remarks:

  • Even for C++ the C-style of comments is preferred (ref)
  • End comments with a period.

And this one is more of a personal preference, but I'd remove the newline between the if and its body, as they form one 'unit' within the function. No strong feelings either way, so do with this one as you wish.

Some style remarks: - Even for C++ the C-style of comments is preferred ([ref](https://wiki.blender.org/wiki/Style_Guide/C_Cpp#C.2FC.2B.2B_Comments)) - End comments with a period. And this one is more of a personal preference, but I'd remove the newline between the `if` and its body, as they form one 'unit' within the function. No strong feelings either way, so do with this one as you wish.
bPoseChannel *active_pchan = BKE_pose_channel_active(ob, false);
// If Child bone has "Local Location" on, use local location orientation.
if (!(active_pchan->bone->flag & BONE_NO_LOCAL_LOCATION)) {
ED_getTransformOrientationMatrix(scene, view_layer, v3d, ob, obedit, pivot_point, r_mat);
return;
}
// Check if target bone is a child.
if (active_pchan->parent) {
// If Child bone has "Local Location" on, use local location orientation.
if (!(active_pchan->bone->flag & BONE_NO_LOCAL_LOCATION)) {
ED_getTransformOrientationMatrix(scene, view_layer, v3d, ob, obedit, pivot_point, r_mat);
return;
}
// If Child bone doesn't have "Local Location" use parent space.
transform_orientations_create_from_axis(r_mat, UNPACK3(active_pchan->parent->pose_mat));
return;