New animation system is finally in

Improving the artwork in Warzone2100 - not for mod discussions
User avatar
astorian
Trained
Trained
Posts: 159
Joined: 29 Jun 2009, 12:26

Re: New animation system is finally in

Post by astorian »

Jorzi wrote: 17 Feb 2019, 20:58 Hi
I tried animating the factory fan using a blender script, but since the fan is slightly tilted, animation will be around all three axes.
Unfortunately I can't get the Euler angles right, so the fan ends up being wobbly :P . Also, my version of WMIT flips the model on the x axis when exporting to pie, which certainly doesn't help. Overall, getting the coordinate system right is pure hell.
Please help :)
Hello Jorzi, i wanted to ask how did you animate the fan in blender. The script is exporting the object location/rotation/scale of the objects center/origin.
So it is possible to use armature, even with a single bone, to animate the object, as long as you animate the object and NOT the mesh.
regards, Astorian

EDIT: i have installed the game version 3.2.1 and replaced with your blfact0.pie but the game is not loading it - saying the blfact0.pie is missing.
Works fine with original file. Do i have the wrong version?
Jorzi
Regular
Regular
Posts: 2063
Joined: 11 Apr 2010, 00:14

Re: New animation system is finally in

Post by Jorzi »

Hi Astorian, the new animation system is for the 3.3.0 beta, so the files won't work with 3.2.1 I think.
As for your question, you can use any armature , parenting and constraints, as long as you animate the object and not the mesh. My script takes the transforms from obj.matrix_world.decompose() which is the final result, after all the other stuff has been applied.
ImageImage
-insert deep philosophical statement here-
User avatar
astorian
Trained
Trained
Posts: 159
Joined: 29 Jun 2009, 12:26

Re: New animation system is finally in

Post by astorian »

Jorzi wrote: 21 Feb 2019, 10:20 Hi Astorian, the new animation system is for the 3.3.0 beta, so the files won't work with 3.2.1 I think.
As for your question, you can use any armature , parenting and constraints, as long as you animate the object and not the mesh. My script takes the transforms from obj.matrix_world.decompose() which is the final result, after all the other stuff has been applied.
That would explain it :D i have to install 3.3.0 then. I remember the script, but i meant how did you animate it since you wrote: "Unfortunately I can't get the Euler angles right, so the fan ends up being wobbly"
User avatar
astorian
Trained
Trained
Posts: 159
Joined: 29 Jun 2009, 12:26

Re: New animation system is finally in

Post by astorian »

Hi again, i was able to compile the 3.3.0beta1. I have been able to load your model. The texture was not right, but that was probably not the point of animation testing.
I can now also try to animate! YAY!
User avatar
MaNGusT
Art contributor
Posts: 1154
Joined: 22 Sep 2006, 10:31
Location: Russia

Re: New animation system is finally in

Post by MaNGusT »

Jorzi wrote: 17 Feb 2019, 20:58Also, my version of WMIT flips the model on the x axis when exporting to pie, which certainly doesn't help
latest build :)
Image
User avatar
astorian
Trained
Trained
Posts: 159
Joined: 29 Jun 2009, 12:26

Re: New animation system is finally in

Post by astorian »

Hello to all,
i have been playing with the animation concept in blender. I started by making simple factory model and snapped a circle on the top to align the object.
After resetting the circle object origin pivot to xyz 0 , I have used a single bone armature and parented the circle object to the bone without snapping to bone.
First key frame locrotscale on frame 0 , last key-frame on frame 40 with 360 degrees rotation on bone axis.
Aligned and and working. Blender file cannot be attached, here http://gofile.me/6vz7G/d7E1osPkV is the link. Download, open and hit Alt+A.
Right click between the circle and bone during animation shows you object origin rotation and bone axial data.
Jorzi
Regular
Regular
Posts: 2063
Joined: 11 Apr 2010, 00:14

Re: New animation system is finally in

Post by Jorzi »

Guys, after endless banging my head against the wall, I present to you a script that successfully transfers the blender transformation matrix to warzone animation framer and gets the eulers right.
Some notes about the coordinate systems before things get forgotten:
In blender, y is forward and z is up (right handed), when I export to WMIT as obj, I choose -z forward and y up (right handed), since this is the warzone standard for pie vertices.
For the translations in the animation script, I had to invert x and y (-y forward, z up, right handed)
Then, after 4 hours of trial and error, and 1 hour of digging through the warzone code, I discovered that the order of euler evaluation is y, z, x (because apparently x, y, z is boring) <- Not blaming Per here, as he had to retain compatibility with how it was originally done.

TL:DR?
mesh coordinates: -z forward, y up, right handed.
connectors: -y forward, z up, right handed.
animation: -y forward, z up, right handed, euler order is y,z,x

Edit: got the connectors wrong, corrected
You do not have the required permissions to view the files attached to this post.
ImageImage
-insert deep philosophical statement here-
Jorzi
Regular
Regular
Posts: 2063
Joined: 11 Apr 2010, 00:14

Re: New animation system is finally in

Post by Jorzi »

MaNGusT wrote: 25 Feb 2019, 00:53
Jorzi wrote: 17 Feb 2019, 20:58Also, my version of WMIT flips the model on the x axis when exporting to pie, which certainly doesn't help
latest build :)
Hi
I tried this build, and the problem is still there. The model looks fine in WMIT, but it's flipped in warzone
You do not have the required permissions to view the files attached to this post.
ImageImage
-insert deep philosophical statement here-
User avatar
MaNGusT
Art contributor
Posts: 1154
Joined: 22 Sep 2006, 10:31
Location: Russia

Re: New animation system is finally in

Post by MaNGusT »

Confirm. Wmit flips model by x-axis on import but saves unflipped version. As a temporary solution we should flip a model again before export to wz(mirroring options). I think I-Nod could fix this in a near future. :-)
Image
User avatar
MaNGusT
Art contributor
Posts: 1154
Joined: 22 Sep 2006, 10:31
Location: Russia

Re: New animation system is finally in

Post by MaNGusT »

Now WMIT works correctly. download :)
Image
i-NoD
Code contributor
Code contributor
Posts: 318
Joined: 30 Nov 2008, 00:42
Location: In the middle of nowhere

Re: New animation system is finally in

Post by i-NoD »

Latest WMIT is capable of previewing regular model animation (one that is defined with ANIMOBJECT).

I'm not sure what is the workflow to merge blender's script output into a PIE model... I suspect it involves a notepad :lol2:

Is there a need (or utility) to allow merging .ani file into PIE model? I assume that .ani file is ordered same way as corresponding OBJ or PIE model, so that should be doable.
Jorzi
Regular
Regular
Posts: 2063
Joined: 11 Apr 2010, 00:14

Re: New animation system is finally in

Post by Jorzi »

Hi, interesting bug, the factory is turned the right way, but subsequent appended meshes are still flipped
You do not have the required permissions to view the files attached to this post.
ImageImage
-insert deep philosophical statement here-
User avatar
MaNGusT
Art contributor
Posts: 1154
Joined: 22 Sep 2006, 10:31
Location: Russia

Re: New animation system is finally in

Post by MaNGusT »

Ah, we forgot to scale by -1,1,1 appended models. Will be fixed in next version. if you'll open animated factory from AR repo, everything should work fine.
Image
Jorzi
Regular
Regular
Posts: 2063
Joined: 11 Apr 2010, 00:14

Re: New animation system is finally in

Post by Jorzi »

Yeah, everything else seems to work nicely, WMIT is really becoming a great tool :)
A suggestion: Add a menu for attaching animation data to pie levels (see the .ani files in my zip)
ImageImage
-insert deep philosophical statement here-
i-NoD
Code contributor
Code contributor
Posts: 318
Joined: 30 Nov 2008, 00:42
Location: In the middle of nowhere

Re: New animation system is finally in

Post by i-NoD »

Jorzi wrote: 01 May 2019, 19:57 Yeah, everything else seems to work nicely, WMIT is really becoming a great tool :)
A suggestion: Add a menu for attaching animation data to pie levels (see the .ani files in my zip)
Available in latest version :)
It took a while to figure out that your .pie factory has fans at center of universe... Ones in .obj format are at real location, but animation goes wild for those :lol2: I think that "Center mesh" button will make life easier in a future, but for now keep that quirk in mind when importing animation.