• Welcome to Battlezone Universe.
 

News:

Welcome to the BZU Archive dated December 24, 2009. Topics and posts are in read-only mode. Those with accounts will be able to login and browse anything the account had access granted to at the time. No changes to permissions will be made to be given access to particular content. If you have any questions, please reach out to squirrelof09/Rapazzini.

Main Menu

Animation questions

Started by gegc, August 24, 2009, 11:06:38 PM

Previous topic - Next topic

gegc

I am using OvermindDL1's Blender exporter to make a deploy animated model, but I can't get it to work in game (no errors, it just won't show up). It was originally supposed to be an aircraft but I've tested the model as at turret ingame and the animation still doesn't play. The model shows up properly, skinned and all, but the animation is simply not there. No errors either, it just doesn't do anything.
I've looked at Fishbone's website but that didn't really help much, as it only provides a basic example of an SI_AnimationKey and doesn't really explain how to use it if I want to do the animation freehand. So can anyone either a) teach me how to do animations in Notepad, including whether it's possible to do several motions (say translation and rotation) at the same time, or b) explain how to make it all work with OvermindDL1's exporter without getting into notepad copy-pasting (probably impossible, but worth asking), or c) a combination of the two. Links to tutorials where this is explained in an understandable fashion are also greatly appreciated.
Thanks!

mrtwosheds

Don't know anything about the blender exporter. Post xsi animation section and odf animation entry's here.
a. yes, yes
b. no.
c. don't know of any tutorials.
+d. don't save animated models with threed.

gegc

Ok, here's the AnimationSet portion of the XSI. There's four moving parts - two wing struts that just rotate and two wings that move and rotate at the same time. I've also included a picture of what the model is supposed to look like in its deployed/undeployed state. Also, the animation is untouched from how it exported from Blender.



AnimationSet {
   Animation anim-wing_strut_l {
      {frm-wing_strut_l}
      SI_AnimationKey {
         3;
         4;
         1; 3; 0, 0, -1;;,
         31; 3; 0, 0, -1;;,
         1; 3; 0, 0, 0;;,
         31; 3; 0, 0, -7;;;
      }
   }
   Animation anim-wing_l {
      {frm-wing_l}
      SI_AnimationKey {
         3;
         6;
         1; 3; 1, 1, -1;;,
         14; 3; 2, 2, -1;;,
         31; 3; 1, 2, -1;;,
         1; 3; 0, 0, 0;;,
         14; 3; 0, 0, 5;;,
         31; 3; 0, 0, 14;;;
      }
   }
   Animation anim-wing_strut_r {
      {frm-wing_strut_r}
      SI_AnimationKey {
         3;
         4;
         1; 3; 0, 0, -1;;,
         31; 3; 0, 0, -1;;,
         1; 3; 0, 0, 0;;,
         31; 3; 0, 0, 7;;;
      }
   }
   Animation anim-wing_r {
      {frm-wing_r}
      SI_AnimationKey {
         3;
         6;
         1; 3; -1, 1, -1;;,
         14; 3; -2, 2, -1;;,
         31; 3; -1, 2, -1;;,
         1; 3; 0, 0, 0;;,
         14; 3; 0, 0, -5;;,
         31; 3; 0, 0, -14;;;
      }
   }
}


The ODF entry is just:
animCount = 1
animName1 = "deploy"
animFile1 = "ivlbbra.xsi" <-- this being the correct filename


Also, the blender exporter was exporting the model as UV Wrapped (mode 4) instead of unwrapped (mode 3), so I saved it it Threed (Which fixed it) and copy-pasted the material data from the threed'd file into the original (this made it work properly in game).

bigbadbogie

QuoteAnimationSet {
   Animation anim-wing_strut_l {
      {frm-wing_strut_l}
      SI_AnimationKey {
         3;
         4;
         1; 3; 0, 0, -1;;,
         31; 3; 0, 0, -1;;,
         1; 3; 0, 0, 0;;,
         31; 3; 0, 0, -7;;;
      }
   }

You have the same frame numbers twice.
Others would merely say it was good humour.


My BZ2 mods:

QF2: Essence to a Thief - Development is underway.

Fleshstorm 2: The Harvest - Released on the 6th of November 2009. Got to www.bz2md.com for details.

QF Mod - My first mod, finished over a year ago. It can be found on BZ2MD.com

gegc

I tried fixing that by changing the animation data to AnimationSet {
   Animation anim-wing_strut_l {
      {frm-wing_strut_l}
      SI_AnimationKey {
         3;
         2;
         1; 3; 0, 0, 0;;,
         31; 3; 0, 0, -7;;;
      }
   }
   Animation anim-wing_strut_r {
      {frm-wing_strut_r}
      SI_AnimationKey {
         3;
         2;
         1; 3; 0, 0, 0;;,
         31; 3; 0, 0, 7;;;
      }
   }
}


and it still wouldn't show up in game (I cleared my BinData folder even though I don't think that's necessary when using the editor). I removed the other two parts of the animation (for the wings) entirely for testing purposes, since I think the double keyframes are a result of the exporter trying to put both the rotation and translation in a single AnimationKey, and the wing struts are only supposed to rotate (whereas the wings move and rotate). I have no clue what's going on with this, and I've as yet been unable to successfully make a completely custom animation :-( (I have mastered the art of the power turbine, but that got boring very quickly).

VSMIT

If you're doing rotation animations, you may need to also have position keys where there are rotation keys, even if the objects don't move in relation to the parent objects.
I find that if I don't have a signature, some people disregard the last couple of lines of a long post.
Quote from: Lizard
IQ's have really dropped around here just recently, must be something in the water.

mrtwosheds

#6
What is probably stopping it from working is this

     SI_AnimationKey {
        3;

Bz2 only uses

     SI_AnimationKey {
        0;
The number 0 tells bz2 that this is a rotation animation.
OR

     SI_AnimationKey {
        2;
The number 2 tells bz2 that this is a translation animation.

The example below is of a working rotation and translation anim.

AnimationSet {
  Animation anim-hp_lfoot {
     {frm-hp_lfoot}
     SI_AnimationKey {
        2;
        8;
        1; 3; 2.0, 0, 0;;,
        3; 3; 2.25, 0, 0;;,
        6; 3; 2.5, 0, 0;;,
        9; 3; 2.75, 0, 0;;,
        12; 3; 3.0, 0, 0;;,
        15; 3; 3.25, 0, 0;;,
        18; 3; 3.5, 0, 0;;,
        21; 3; 3.75, 0, 0;;;
     }
     SI_AnimationKey {
        0;
        8;
        1; 4; 1, 0, 0, 0;;,
        3; 4; 1, 0, 0, -0.025;;,
        6; 4; 1, 0, 0, -0.05;;,
        9; 4; 1, 0, 0, -0.1;;,
        12; 4; 1, 0, 0, -0.15;;,
        15; 4; 1, 0, 0, -0.2;;,
        18; 4; 1, 0, 0, -0.25;;,
        21; 4; 1, 0, 0, -0.3;;;

     }
  }

Bz2 will not recognise the 3 value as a type of animation it can do.

Notice that the rotation part has 4 values per line.
I do all my anims in notepad, you just paste in another section like the above and adjust to achieve the desired effect.

gegc

It worked! :-D Thanks for the help! That makes a lot of sense and would explain why none of my other animations worked either - the Blender exporter appears to export everything with the 3.

gegc

After a bit of research, I have found an explanation of how BZ2's rotation works, along with an applet for converting from XYZ (Euler) rotation to the BZ2 format.

Java applet is here: http://www.euclideanspace.com/maths/geometry/rotations/conversions/eulerToQuaternion/program/index.htm

Complicated math is here: http://www.euclideanspace.com/maths/geometry/rotations/conversions/eulerToQuaternion/index.htm

Hopefully if anyone needs this information they will find these links useful.

mrtwosheds

I am so glad you did not ask me to explain it, +1 karma!
That first link causes firefox to stop responding...

gegc

The link worked fine for me, but the thing is a java applet, so it may be a java-related problem. It says you need at least Java 1.3 and to have to have Java code enabled in the browser, but I guess putting that on the same page as the applet is somewhat fail on their part.

Nielk1

When I was programming Java 2 years ago we had Java 5 so...

FF sometimes freezes with Java applets.

Click on the image...

mrtwosheds

QuoteIt says you need at least Java 1.3
Ah yes, now I recall, deleting a whole bunch of java folders, in an attempt to free up disc space on my c drive... :-D. yes I know! Damn automatic downloads! Why can't the ask me where I want it to go!

Nielk1

That would have been your core Java API... The thing that does everything.

Click on the image...

mrtwosheds

#14
Well if they had the decency not to keep uploading partial upgrades (1.1, 1.2 1.3 etc) onto my small c drive without asking whether I want it there, then I would not have had to delete the older ones, hoping that the newer ones contained all required, clearly they don't...Never mind, when I find its a problem I,ll fix it  somehow.

edit: uninstalled all Java stuff, down loaded java again and installed, recovered about 400Mb of disk space, still have to install to c:...