diff options
author | Campbell Barton <ideasman42@gmail.com> | 2011-02-06 12:01:01 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2011-02-06 12:01:01 +0300 |
commit | c82da98f3d5cb43a9cae446df5529a1fd5566ad5 (patch) | |
tree | 603eb91e727b20fcce897fa06c75d9b4016a0707 /source/blender/blenloader | |
parent | 967299ad976a669f763d728d5a8a0f030636a740 (diff) |
bugfix [#25824] Quats + Camera + Fly = Madness
ensure quat, delta rotation is set to a unit quaternion on older files.
Diffstat (limited to 'source/blender/blenloader')
-rw-r--r-- | source/blender/blenloader/intern/readfile.c | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c index 085ec92e209..f53d59135c3 100644 --- a/source/blender/blenloader/intern/readfile.c +++ b/source/blender/blenloader/intern/readfile.c @@ -11323,12 +11323,24 @@ static void do_versions(FileData *fd, Library *lib, Main *main) /* fix for bones that didn't have arm_roll before */ bArmature* arm; Bone* bone; + Object *ob; for (arm = main->armature.first; arm; arm = arm->id.next) for (bone = arm->bonebase.first; bone; bone = bone->next) do_version_bone_roll_256(bone); + + /* fix for objects which have zero dquat's + * since this is multiplied with the quat rather then added */ + for(ob= main->object.first; ob; ob= ob->id.next) { + if(is_zero_v4(ob->dquat)) { + unit_qt(ob->dquat); + } + if(is_zero_v3(ob->drotAxis) && ob->drotAngle == 0.0f) { + unit_axis_angle(ob->drotAxis, &ob->drotAngle); + } + } } - + /* put compatibility code here until next subversion bump */ { |