From 7fbe91e300bb1fa5cbea2a1fcf64bb8513697aab Mon Sep 17 00:00:00 2001 From: Joshua Leung Date: Fri, 29 Jan 2016 01:20:33 +1300 Subject: Version patching fixes for the new bbone settings --- source/blender/blenloader/intern/versioning_270.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) 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); + } + } } -- cgit v1.2.3