diff options
-rw-r--r-- | source/blender/blenloader/intern/versioning_270.c | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/source/blender/blenloader/intern/versioning_270.c b/source/blender/blenloader/intern/versioning_270.c index efd167d49d5..a10f15874f9 100644 --- a/source/blender/blenloader/intern/versioning_270.c +++ b/source/blender/blenloader/intern/versioning_270.c @@ -34,6 +34,7 @@ /* allow readfile to use deprecated functionality */ #define DNA_DEPRECATED_ALLOW +#include "DNA_armature_types.h" #include "DNA_brush_types.h" #include "DNA_camera_types.h" #include "DNA_cloth_types.h" @@ -161,6 +162,16 @@ static void do_version_action_editor_properties_region(ListBase *regionbase) } } +static void do_version_bones_super_bbone(ListBase *lb) +{ + for (Bone *bone = lb->first; bone; bone = bone->next) { + bone->scaleIn = 1.0f; + bone->scaleOut = 1.0f; + + do_version_bones_super_bbone(&bone->childbase); + } +} + void blo_do_versions_270(FileData *fd, Library *UNUSED(lib), Main *main) { if (!MAIN_VERSION_ATLEAST(main, 270, 0)) { @@ -1151,4 +1162,12 @@ void blo_do_versions_270(FileData *fd, Library *UNUSED(lib), Main *main) } } } + + + if (!DNA_struct_elem_find(fd->filesdna, "Bone", "float", "scaleIn")) { + printf("fixing bones\n"); + for (bArmature *arm = main->armature.first; arm; arm = arm->id.next) { + do_version_bones_super_bbone(&arm->bonebase); + } + } } |