Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorScott Wilson <propersquid>2021-03-30 12:16:45 +0300
committerSybren A. Stüvel <sybren@blender.org>2021-03-30 12:40:26 +0300
commit74d5a93b2bf7806993d9baa24fd35228e52c4970 (patch)
treeffc33f5033d99abcb5c50d7ea20ec992a7393b16 /source/blender/draw
parent0d65d27386d649b42599952fed1532892ee03a35 (diff)
Armature: Add Display Axis Offset
Display the bone axes at the head (root) of the bone by default, instead of the tail (tip), and add a slider so that it's possible to adjust this position. Versioning code is in place to ensure existing files behave the same (axes shown at tail), whereas new Armatures will be using the new default (axes shown at head). Reviewed By: #animation_rigging, #user_interface, Severin, Sybren Differential Revision: https://developer.blender.org/D7685
Diffstat (limited to 'source/blender/draw')
-rw-r--r--source/blender/draw/engines/overlay/overlay_armature.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/source/blender/draw/engines/overlay/overlay_armature.c b/source/blender/draw/engines/overlay/overlay_armature.c
index 7042d095b56..54224071d23 100644
--- a/source/blender/draw/engines/overlay/overlay_armature.c
+++ b/source/blender/draw/engines/overlay/overlay_armature.c
@@ -1293,11 +1293,15 @@ static void draw_axes(ArmatureDrawContext *ctx,
float length = pchan->bone->length;
copy_m4_m4(axis_mat, pchan->custom_tx ? pchan->custom_tx->pose_mat : pchan->pose_mat);
rescale_m4(axis_mat, (float[3]){length, length, length});
+ translate_m4(axis_mat, 0.0, arm->axes_position - 1.0, 0.0);
drw_shgroup_bone_axes(ctx, axis_mat, final_col);
}
else {
- drw_shgroup_bone_axes(ctx, BONE_VAR(eBone, pchan, disp_mat), final_col);
+ float disp_mat[4][4];
+ copy_m4_m4(disp_mat, BONE_VAR(eBone, pchan, disp_mat));
+ translate_m4(disp_mat, 0.0, arm->axes_position - 1.0, 0.0);
+ drw_shgroup_bone_axes(ctx, disp_mat, final_col);
}
}