diff options
author | Joshua Leung <aligorith@gmail.com> | 2016-01-28 15:20:33 +0300 |
---|---|---|
committer | Joshua Leung <aligorith@gmail.com> | 2016-05-17 17:28:44 +0300 |
commit | 7fbe91e300bb1fa5cbea2a1fcf64bb8513697aab (patch) | |
tree | eb66bbb5f61b253eff17beb09a015bef4d6a13ba | |
parent | 70c9af3b382177c34a3b8c6fb491f6a615294392 (diff) |
Version patching fixes for the new bbone settings
-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); + } + } } |