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/blenloader/intern/versioning_290.c
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/blenloader/intern/versioning_290.c')
-rw-r--r--source/blender/blenloader/intern/versioning_290.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/source/blender/blenloader/intern/versioning_290.c b/source/blender/blenloader/intern/versioning_290.c
index aae5a2ec190..2449e35055e 100644
--- a/source/blender/blenloader/intern/versioning_290.c
+++ b/source/blender/blenloader/intern/versioning_290.c
@@ -27,6 +27,7 @@
#include "BLI_utildefines.h"
#include "DNA_anim_types.h"
+#include "DNA_armature_types.h"
#include "DNA_brush_types.h"
#include "DNA_cachefile_types.h"
#include "DNA_collection_types.h"
@@ -1948,5 +1949,12 @@ void blo_do_versions_290(FileData *fd, Library *UNUSED(lib), Main *bmain)
*/
{
/* Keep this block, even when empty. */
+
+ if (!DNA_struct_elem_find(fd->filesdna, "bArmature", "float", "axes_position")) {
+ /* Convert the axes draw position to its old default (tip of bone). */
+ LISTBASE_FOREACH (struct bArmature *, arm, &bmain->armatures) {
+ arm->axes_position = 1.0;
+ }
+ }
}
}