blender to ogre animation distortion

The place for artists, modellers, level designers et al to discuss their approaches for creating content for OGRE.
Post Reply
sheph3rd
Gnoblar
Posts: 3
Joined: Thu Jul 18, 2013 3:47 pm

blender to ogre animation distortion

Post by sheph3rd »

Hi,

My friend and I are working on a game project. I have this model which I modelled, animated, rigged, textured, etc. It looks fine ( fine enough for me at least, for now :D ) in Blender, but after exporting using blender2ogre, and walking with-in our game application, a certain part of our guy deforms. I've been Googling my peanuts off trying different ideas mentioned by people, but apparently I am missing something or failing to properly attempt something. If anyone could help me problem solve this, it'd be great. Especially so I can learn how to do the models right and avoid this problem with future models.

Here is a video of the animation in Blender - seems all normal:
http://www.youtube.com/watch?v=YJuaD-Di ... e=youtu.be

Here is a video of the animation in our game app ( using Ogre3D ) - looks like a speed-up video of the development of his beer-belly, or a chest-burster is about to pop out:
http://www.youtube.com/watch?v=r8tqhaRS ... e=youtu.be

Ogre Byatis (1.8.1)
Blender ( 2.66a )
blender2ogre ( 0.6.0 )

Here are a few of the things I tried:
1. Apply location, rotation, scale to mesh.
2. Apply location, rotation, scale to armature.
3. Set mesh's origin point to bottom of mesh.
4. Set armatures origin point to bottom of mesh.
5. Armature and Meshs origin are in same place.
6. Uncheck bone envelopes on armature modifier.
7. Apply all modifiers except for armature.
8. Solved problems with vertices that were not bound or assigned to too many bones.

blender2ogre doesn't spout any errors at all upon exporting.

Many thanks for the interest and time put into helping me solve my issue.
Best regards,
Shepherd
sheph3rd
Gnoblar
Posts: 3
Joined: Thu Jul 18, 2013 3:47 pm

Re: blender to ogre animation distortion

Post by sheph3rd »

Bump. Also would be willing to provide the .blend for anyone that could help me solve this ( in a way that I can avoid the problem in the future ) :D.
Skwint
Gnoblar
Posts: 9
Joined: Mon May 21, 2012 3:51 pm
x 2

Re: blender to ogre animation distortion

Post by Skwint »

Same sort of problem here.
Blender 2.62 exporting to more than one version of Ogre (and more than one application).
Some bits animate fine, and some bits screw up completely.

Working in Blender: https://sites.google.com/site/squirmy/b ... ects=0&d=1
dislocating shoulders and tail in Ogre: https://sites.google.com/site/squirmy/b ... ects=0&d=1

I think I have a clue, however. My animation consists of bone rotations - there is no scaling and no translating. The animations which appear to be wrong are those in which the axis around which the rotation occurs is the vertical one (which is Z in ogre, and Y in blender). The base of the tail and the arms rotate around this - the head, legs, feet, and end tail segments do not and appear close to correct. I am exporting with swap axis: xz-y

as per previous post - I'm willing to upload the .blend file if it will help, or try to create a simple one that duplicates it.
sheph3rd
Gnoblar
Posts: 3
Joined: Thu Jul 18, 2013 3:47 pm

Re: blender to ogre animation distortion

Post by sheph3rd »

Hi again guys, I solved my problem. It was the translate entries for an IK track bone in one of his hands in the .skeleton file for just one of the bones, that really have nothing to do with the chest or pelvis ( or so I think ).

This is what it looked like -

Code: Select all

        <track bone="Hand_IK_R" >
          <keyframes >
            <keyframe time="0.0" >
              <translate z="-1.165968" x="-1.369709" y="0.094264" />
              <rotate angle="0.000000" >
                <axis z="-0.000000" x="-0.000000" y="-0.000000" />
              </rotate>
              <scale z="1.000000" x="1.000000" y="1.000000" />
            </keyframe>
            <keyframe time="0.041666666666666664" >
              <translate z="-1.140858" x="-1.351032" y="0.089906" />
              <rotate angle="0.000000" >
                <axis z="-0.000000" x="-0.000000" y="-0.000000" />
              </rotate>
              <scale z="1.000000" x="1.000000" y="1.000000" />
            </keyframe>
            <keyframe time="0.08333333333333333" >
              <translate z="-1.063952" x="-1.295353" y="0.076615" />
              <rotate angle="0.000000" >
                <axis z="-0.000000" x="-0.000000" y="-0.000000" />
              </rotate>
              <scale z="1.000000" x="1.000000" y="1.000000" />
            </keyframe>
            <keyframe time="0.125" >
              <translate z="-0.937798" x="-1.207826" y="0.054996" />
              <rotate angle="0.000000" >
                <axis z="-0.000000" x="-0.000000" y="-0.000000" />
              </rotate>
              <scale z="1.000000" x="1.000000" y="1.000000" />
            </keyframe>
            <keyframe time="0.16666666666666666" >
              <translate z="-0.773915" x="-1.101340" y="0.027347" />
              <rotate angle="0.000000" >
                <axis z="-0.000000" x="-0.000000" y="-0.000000" />
              </rotate>
              <scale z="1.000000" x="1.000000" y="1.000000" />
            </keyframe>
            <keyframe time="0.20833333333333334" >
              <translate z="-0.592286" x="-0.994931" y="-0.002485" />
              <rotate angle="0.000000" >
                <axis z="-0.000000" x="-0.000000" y="-0.000000" />
              </rotate>
              <scale z="1.000000" x="1.000000" y="1.000000" />
            </keyframe>
            <keyframe time="0.25" >
              <translate z="-0.415377" x="-0.907580" y="-0.030322" />
              <rotate angle="0.000000" >
                <axis z="-0.000000" x="-0.000000" y="-0.000000" />
              </rotate>
              <scale z="1.000000" x="1.000000" y="1.000000" />
            </keyframe>
            <keyframe time="0.2916666666666667" >
              <translate z="-0.260835" x="-0.852066" y="-0.053061" />
              <rotate angle="0.000000" >
                <axis z="-0.000000" x="-0.000000" y="-0.000000" />
              </rotate>
              <scale z="1.000000" x="1.000000" y="1.000000" />
            </keyframe>
            <keyframe time="0.3333333333333333" >
              <translate z="-0.138371" x="-0.833454" y="-0.069185" />
              <rotate angle="0.000000" >
                <axis z="-0.000000" x="-0.000000" y="-0.000000" />
              </rotate>
              <scale z="1.000000" x="1.000000" y="1.000000" />
            </keyframe>
            <keyframe time="0.375" >
              <translate z="-0.028929" x="-0.837076" y="-0.080528" />
              <rotate angle="0.000000" >
                <axis z="-0.000000" x="-0.000000" y="-0.000000" />
              </rotate>
              <scale z="1.000000" x="1.000000" y="1.000000" />
            </keyframe>
            <keyframe time="0.4166666666666667" >
              <translate z="0.086918" x="-0.847884" y="-0.089100" />
              <rotate angle="0.000000" >
                <axis z="-0.000000" x="-0.000000" y="-0.000000" />
              </rotate>
              <scale z="1.000000" x="1.000000" y="1.000000" />
            </keyframe>
            <keyframe time="0.4583333333333333" >
              <translate z="0.203103" x="-0.864895" y="-0.094888" />
              <rotate angle="0.000000" >
                <axis z="-0.000000" x="-0.000000" y="-0.000000" />
              </rotate>
              <scale z="1.000000" x="1.000000" y="1.000000" />
            </keyframe>
            <keyframe time="0.5" >
              <translate z="0.310722" x="-0.885614" y="-0.098343" />
              <rotate angle="0.000000" >
                <axis z="-0.000000" x="-0.000000" y="-0.000000" />
              </rotate>
              <scale z="1.000000" x="1.000000" y="1.000000" />
            </keyframe>
            <keyframe time="0.5416666666666666" >
              <translate z="0.400217" x="-0.906329" y="-0.100411" />
              <rotate angle="0.000000" >
                <axis z="-0.000000" x="-0.000000" y="-0.000000" />
              </rotate>
              <scale z="1.000000" x="1.000000" y="1.000000" />
            </keyframe>
            <keyframe time="0.5833333333333334" >
              <translate z="0.464778" x="-0.923334" y="-0.102248" />
              <rotate angle="0.000000" >
                <axis z="-0.000000" x="-0.000000" y="-0.000000" />
              </rotate>
              <scale z="1.000000" x="1.000000" y="1.000000" />
            </keyframe>
            <keyframe time="0.625" >
              <translate z="0.502174" x="-0.934136" y="-0.104816" />
              <rotate angle="0.000000" >
                <axis z="-0.000000" x="-0.000000" y="-0.000000" />
              </rotate>
              <scale z="1.000000" x="1.000000" y="1.000000" />
            </keyframe>
            <keyframe time="0.6666666666666666" >
              <translate z="0.513935" x="-0.937755" y="-0.108684" />
              <rotate angle="0.000000" >
                <axis z="-0.000000" x="-0.000000" y="-0.000000" />
              </rotate>
              <scale z="1.000000" x="1.000000" y="1.000000" />
            </keyframe>
            <keyframe time="0.7083333333333334" >
              <translate z="0.505278" x="-0.934136" y="-0.113687" />
              <rotate angle="0.000000" >
                <axis z="-0.000000" x="-0.000000" y="-0.000000" />
              </rotate>
              <scale z="1.000000" x="1.000000" y="1.000000" />
            </keyframe>
            <keyframe time="0.75" >
              <translate z="0.477135" x="-0.923334" y="-0.119361" />
              <rotate angle="0.000000" >
                <axis z="-0.000000" x="-0.000000" y="-0.000000" />
              </rotate>
              <scale z="1.000000" x="1.000000" y="1.000000" />
            </keyframe>
            <keyframe time="0.7916666666666666" >
              <translate z="0.427131" x="-0.906329" y="-0.125388" />
              <rotate angle="0.000000" >
                <axis z="-0.000000" x="-0.000000" y="-0.000000" />
              </rotate>
              <scale z="1.000000" x="1.000000" y="1.000000" />
            </keyframe>
            <keyframe time="0.8333333333333334" >
              <translate z="0.355377" x="-0.885614" y="-0.131244" />
              <rotate angle="0.000000" >
                <axis z="-0.000000" x="-0.000000" y="-0.000000" />
              </rotate>
              <scale z="1.000000" x="1.000000" y="1.000000" />
            </keyframe>
            <keyframe time="0.875" >
              <translate z="0.265538" x="-0.864896" y="-0.136303" />
              <rotate angle="0.000000" >
                <axis z="-0.000000" x="-0.000000" y="-0.000000" />
              </rotate>
              <scale z="1.000000" x="1.000000" y="1.000000" />
            </keyframe>
            <keyframe time="0.9166666666666666" >
              <translate z="0.163994" x="-0.847884" y="-0.140062" />
              <rotate angle="0.000000" >
                <axis z="-0.000000" x="-0.000000" y="-0.000000" />
              </rotate>
              <scale z="1.000000" x="1.000000" y="1.000000" />
            </keyframe>
            <keyframe time="0.9583333333333334" >
              <translate z="0.057480" x="-0.837076" y="-0.142287" />
              <rotate angle="0.000000" >
                <axis z="-0.000000" x="-0.000000" y="-0.000000" />
              </rotate>
              <scale z="1.000000" x="1.000000" y="1.000000" />
            </keyframe>
            <keyframe time="1.0" >
              <translate z="-0.048826" x="-0.833454" y="-0.142998" />
              <rotate angle="0.000000" >
                <axis z="-0.000000" x="-0.000000" y="-0.000000" />
              </rotate>
              <scale z="1.000000" x="1.000000" y="1.000000" />
            </keyframe>
            <keyframe time="1.0416666666666667" >
              <translate z="-0.174398" x="-0.852066" y="-0.134765" />
              <rotate angle="0.000000" >
                <axis z="-0.000000" x="-0.000000" y="-0.000000" />
              </rotate>
              <scale z="1.000000" x="1.000000" y="1.000000" />
            </keyframe>
            <keyframe time="1.0833333333333333" >
              <translate z="-0.338157" x="-0.907580" y="-0.110191" />
              <rotate angle="0.000000" >
                <axis z="-0.000000" x="-0.000000" y="-0.000000" />
              </rotate>
              <scale z="1.000000" x="1.000000" y="1.000000" />
            </keyframe>
            <keyframe time="1.125" >
              <translate z="-0.529514" x="-0.994931" y="-0.071509" />
              <rotate angle="0.000000" >
                <axis z="-0.000000" x="-0.000000" y="-0.000000" />
              </rotate>
              <scale z="1.000000" x="1.000000" y="1.000000" />
            </keyframe>
            <keyframe time="1.1666666666666667" >
              <translate z="-0.728752" x="-1.101340" y="-0.024388" />
              <rotate angle="0.000000" >
                <axis z="-0.000000" x="-0.000000" y="-0.000000" />
              </rotate>
              <scale z="1.000000" x="1.000000" y="1.000000" />
            </keyframe>
            <keyframe time="1.2083333333333333" >
              <translate z="-0.910367" x="-1.207826" y="0.022739" />
              <rotate angle="0.000000" >
                <axis z="-0.000000" x="-0.000000" y="-0.000000" />
              </rotate>
              <scale z="1.000000" x="1.000000" y="1.000000" />
            </keyframe>
            <keyframe time="1.25" >
              <translate z="-1.051252" x="-1.295353" y="0.061437" />
              <rotate angle="0.000000" >
                <axis z="-0.000000" x="-0.000000" y="-0.000000" />
              </rotate>
              <scale z="1.000000" x="1.000000" y="1.000000" />
            </keyframe>
            <keyframe time="1.2916666666666667" >
              <translate z="-1.137643" x="-1.351032" y="0.086024" />
              <rotate angle="0.000000" >
                <axis z="-0.000000" x="-0.000000" y="-0.000000" />
              </rotate>
              <scale z="1.000000" x="1.000000" y="1.000000" />
            </keyframe>
            <keyframe time="1.3333333333333333" >
              <translate z="-1.165968" x="-1.369709" y="0.094264" />
              <rotate angle="0.000000" >
                <axis z="-0.000000" x="-0.000000" y="-0.000000" />
              </rotate>
              <scale z="1.000000" x="1.000000" y="1.000000" />
            </keyframe>
          </keyframes>
        </track>
And this is what I changed it too -

Code: Select all

        <track bone="Hand_IK_R" >
          <keyframes >
            <keyframe time="0.0" >
              <rotate angle="0.000000" >
                <axis z="-0.000000" x="-0.000000" y="-0.000000" />
              </rotate>
              <scale z="1.000000" x="1.000000" y="1.000000" />
            </keyframe>
            <keyframe time="0.041666666666666664" >
              <rotate angle="0.000000" >
                <axis z="-0.000000" x="-0.000000" y="-0.000000" />
              </rotate>
              <scale z="1.000000" x="1.000000" y="1.000000" />
            </keyframe>
            <keyframe time="0.08333333333333333" >
              <rotate angle="0.000000" >
                <axis z="-0.000000" x="-0.000000" y="-0.000000" />
              </rotate>
              <scale z="1.000000" x="1.000000" y="1.000000" />
            </keyframe>
            <keyframe time="0.125" >
              <rotate angle="0.000000" >
                <axis z="-0.000000" x="-0.000000" y="-0.000000" />
              </rotate>
              <scale z="1.000000" x="1.000000" y="1.000000" />
            </keyframe>
            <keyframe time="0.16666666666666666" >
              <rotate angle="0.000000" >
                <axis z="-0.000000" x="-0.000000" y="-0.000000" />
              </rotate>
              <scale z="1.000000" x="1.000000" y="1.000000" />
            </keyframe>
            <keyframe time="0.20833333333333334" >
              <rotate angle="0.000000" >
                <axis z="-0.000000" x="-0.000000" y="-0.000000" />
              </rotate>
              <scale z="1.000000" x="1.000000" y="1.000000" />
            </keyframe>
            <keyframe time="0.25" >
              <rotate angle="0.000000" >
                <axis z="-0.000000" x="-0.000000" y="-0.000000" />
              </rotate>
              <scale z="1.000000" x="1.000000" y="1.000000" />
            </keyframe>
            <keyframe time="0.2916666666666667" >
              <rotate angle="0.000000" >
                <axis z="-0.000000" x="-0.000000" y="-0.000000" />
              </rotate>
              <scale z="1.000000" x="1.000000" y="1.000000" />
            </keyframe>
            <keyframe time="0.3333333333333333" >
              <rotate angle="0.000000" >
                <axis z="-0.000000" x="-0.000000" y="-0.000000" />
              </rotate>
              <scale z="1.000000" x="1.000000" y="1.000000" />
            </keyframe>
            <keyframe time="0.375" >
              <rotate angle="0.000000" >
                <axis z="-0.000000" x="-0.000000" y="-0.000000" />
              </rotate>
              <scale z="1.000000" x="1.000000" y="1.000000" />
            </keyframe>
            <keyframe time="0.4166666666666667" >
              <rotate angle="0.000000" >
                <axis z="-0.000000" x="-0.000000" y="-0.000000" />
              </rotate>
              <scale z="1.000000" x="1.000000" y="1.000000" />
            </keyframe>
            <keyframe time="0.4583333333333333" >
              <rotate angle="0.000000" >
                <axis z="-0.000000" x="-0.000000" y="-0.000000" />
              </rotate>
              <scale z="1.000000" x="1.000000" y="1.000000" />
            </keyframe>
            <keyframe time="0.5" >
              <rotate angle="0.000000" >
                <axis z="-0.000000" x="-0.000000" y="-0.000000" />
              </rotate>
              <scale z="1.000000" x="1.000000" y="1.000000" />
            </keyframe>
            <keyframe time="0.5416666666666666" >
              <rotate angle="0.000000" >
                <axis z="-0.000000" x="-0.000000" y="-0.000000" />
              </rotate>
              <scale z="1.000000" x="1.000000" y="1.000000" />
            </keyframe>
            <keyframe time="0.5833333333333334" >
              <rotate angle="0.000000" >
                <axis z="-0.000000" x="-0.000000" y="-0.000000" />
              </rotate>
              <scale z="1.000000" x="1.000000" y="1.000000" />
            </keyframe>
            <keyframe time="0.625" >
              <rotate angle="0.000000" >
                <axis z="-0.000000" x="-0.000000" y="-0.000000" />
              </rotate>
              <scale z="1.000000" x="1.000000" y="1.000000" />
            </keyframe>
            <keyframe time="0.6666666666666666" >
              <rotate angle="0.000000" >
                <axis z="-0.000000" x="-0.000000" y="-0.000000" />
              </rotate>
              <scale z="1.000000" x="1.000000" y="1.000000" />
            </keyframe>
            <keyframe time="0.7083333333333334" >
              <rotate angle="0.000000" >
                <axis z="-0.000000" x="-0.000000" y="-0.000000" />
              </rotate>
              <scale z="1.000000" x="1.000000" y="1.000000" />
            </keyframe>
            <keyframe time="0.75" >
              <rotate angle="0.000000" >
                <axis z="-0.000000" x="-0.000000" y="-0.000000" />
              </rotate>
              <scale z="1.000000" x="1.000000" y="1.000000" />
            </keyframe>
            <keyframe time="0.7916666666666666" >
              <rotate angle="0.000000" >
                <axis z="-0.000000" x="-0.000000" y="-0.000000" />
              </rotate>
              <scale z="1.000000" x="1.000000" y="1.000000" />
            </keyframe>
            <keyframe time="0.8333333333333334" >
              <rotate angle="0.000000" >
                <axis z="-0.000000" x="-0.000000" y="-0.000000" />
              </rotate>
              <scale z="1.000000" x="1.000000" y="1.000000" />
            </keyframe>
            <keyframe time="0.875" >
              <rotate angle="0.000000" >
                <axis z="-0.000000" x="-0.000000" y="-0.000000" />
              </rotate>
              <scale z="1.000000" x="1.000000" y="1.000000" />
            </keyframe>
            <keyframe time="0.9166666666666666" >
              <rotate angle="0.000000" >
                <axis z="-0.000000" x="-0.000000" y="-0.000000" />
              </rotate>
              <scale z="1.000000" x="1.000000" y="1.000000" />
            </keyframe>
            <keyframe time="0.9583333333333334" >
              <rotate angle="0.000000" >
                <axis z="-0.000000" x="-0.000000" y="-0.000000" />
              </rotate>
              <scale z="1.000000" x="1.000000" y="1.000000" />
            </keyframe>
            <keyframe time="1.0" >
              <rotate angle="0.000000" >
                <axis z="-0.000000" x="-0.000000" y="-0.000000" />
              </rotate>
              <scale z="1.000000" x="1.000000" y="1.000000" />
            </keyframe>
            <keyframe time="1.0416666666666667" >
              <rotate angle="0.000000" >
                <axis z="-0.000000" x="-0.000000" y="-0.000000" />
              </rotate>
              <scale z="1.000000" x="1.000000" y="1.000000" />
            </keyframe>
            <keyframe time="1.0833333333333333" >
              <rotate angle="0.000000" >
                <axis z="-0.000000" x="-0.000000" y="-0.000000" />
              </rotate>
              <scale z="1.000000" x="1.000000" y="1.000000" />
            </keyframe>
            <keyframe time="1.125" >
              <rotate angle="0.000000" >
                <axis z="-0.000000" x="-0.000000" y="-0.000000" />
              </rotate>
              <scale z="1.000000" x="1.000000" y="1.000000" />
            </keyframe>
            <keyframe time="1.1666666666666667" >
              <rotate angle="0.000000" >
                <axis z="-0.000000" x="-0.000000" y="-0.000000" />
              </rotate>
              <scale z="1.000000" x="1.000000" y="1.000000" />
            </keyframe>
            <keyframe time="1.2083333333333333" >
              <rotate angle="0.000000" >
                <axis z="-0.000000" x="-0.000000" y="-0.000000" />
              </rotate>
              <scale z="1.000000" x="1.000000" y="1.000000" />
            </keyframe>
            <keyframe time="1.25" >
              <rotate angle="0.000000" >
                <axis z="-0.000000" x="-0.000000" y="-0.000000" />
              </rotate>
              <scale z="1.000000" x="1.000000" y="1.000000" />
            </keyframe>
            <keyframe time="1.2916666666666667" >
              <rotate angle="0.000000" >
                <axis z="-0.000000" x="-0.000000" y="-0.000000" />
              </rotate>
              <scale z="1.000000" x="1.000000" y="1.000000" />
            </keyframe>
            <keyframe time="1.3333333333333333" >
              <rotate angle="0.000000" >
                <axis z="-0.000000" x="-0.000000" y="-0.000000" />
              </rotate>
              <scale z="1.000000" x="1.000000" y="1.000000" />
            </keyframe>
          </keyframes>
        </track>
Any idea why that could have caused a mess up in my animation? as of now, he APPEARS ok, but could I have possibly messed something up? Could this be related to IK in ogre? I haven't read much about it, nor do I know much about Ogre or Blender at this point... just learning by trial and error as I go. ( This is my first model, texture, armature, and animation )

Thanks again
Skwint
Gnoblar
Posts: 9
Joined: Mon May 21, 2012 3:51 pm
x 2

Re: blender to ogre animation distortion

Post by Skwint »

I've tried to reply, but I linked videos of me having the same problem and it hasn't shown up.
All my translations are 0.0000 0.0000 0.0000 so I doubt deleting them all will have any affect for me :/
Post Reply