GG Zombies FBX Working In Blender

Level design, models, animations, physics, etc.
10 posts Page 1 of 1
Steve_Yorkshire
Posts: 299
Joined: Tue Feb 03, 2015 10:30 pm
 
  by Steve_Yorkshire » Wed Apr 25, 2018 3:09 pm
I finally managed to get the GG Zombies imported into Blender 2.78c and exported again as DAE, and fully working into Torque.

First up, you need the asset packs and source art off github:

https://github.com/GarageGames/ContentP ... GameAssets
https://github.com/GarageGames/ContentP ... _SourceArt

Stick the game assets into Torque and get everything preloaded so we have the material files set up. Now back to Blender.

Blender does have it's own FBX importer which is a bit hit-and-miss with file importing (see my other thread about using FBX with VS here), but Blender's stock FBX import works perfectly with the GG art packs, animations and all! :o

The 2 files we will be working with are:
Zombie_TP_Animation_Master_AutodeskFBX2012.fbx - for the ambient animation which contains all the zombies animations (including the spawn animation not included with the stock exported zombies)
Zombie_Skin_Master_LODs_AutodeskFBX2012.fbx - for all the zombie body part meshes (think the MegaZombie file). Also contains an animation for testing the bones.

These files are from MAX and so have lots of helper empties and stuff Blender doesn't need.

First up, let's sort out the animation file Zombie_TP_Animation_Master_AutodeskFBX2012.fbx. It contains the animations, a test zombie model (which is huge and has wrong rotation if unparented from the armature), some head models, bounds box and lots of empty helpers.

Import the FBX file using Blenders standard FBX importer. This may take a while as there's a lot of stuff for Blender to read.

The most important thing to do here ... is fix the broken rotation and position on the bounds box mesh or else it will fubar all rotations in the animations because DAE always inherits. Just select it and in Object editor set XYZ and Rotations all to ZERO, leave scale as 0.010. If you don't do this the meshes will appear outside the bounds and offset from the objects original inside Torque.

Next get rid of the empties. Just leave the meshes, Bip001, Bip001Action (the big animation) and bounds mesh (leave the zombie_base and heads it makes it easier to see what the bones are doing in Blender). You can also select bounds and remove the pointless animation attached to it (dope sheet->actions editor->select bounds->choose the animation->press F to pay respects->press X to kill). Now it's gonna look something like this:
Image

To export select Bip001 and Bounds (we just want the animations, no zombie mesh or heads), use export to Collada (default).dae. When the export options come up check box "selection only" or the camera and light come through (you can stop them on the import options inside Torque but why not get rid now). Export using the name "zombieBlenderAllAnims.dae".

Now load up Torque and import the dae (art/shapes/actors/GG_Zombies/Anims). It should look like this (note I've added the zombie_base just as a test). I did notice that the bones got renamed (even though they aren't called that in the dae file) but everything still works.

Image
Note the strangely named bones ... but hey ... also testing zombie_base here.

Okay next up, Zombie_Skin_Master_LODs_AutodeskFBX2012.fbx which is the megazombie. Do the same (remember bounds position and rotation needs resetting to ZERO!) and delete everything that's an empty (and get rid of the silly animation too if you want - it's not connected to the armature by default so shouldn't export). Place all the meshes for each type of LOD (300,200,100,2) into seperate layers! This is important for Torque to create LODs using trailing number on import. When you export select the armature, all the meshes and bounds. Remember to export "selected only" and name the file "megaZombieBlender". When importing to Torque, make sure you select "trailing number" for LODs.

Image

Here's a Blender version of zombieBlender1 which I made by deleting the other meshes (I looked in stock zombie1 dae file to see which meshes were used). After exporting from Blender and importing into Torque (art/shapes/actors/GG_Zombies) I set up the animtions as such:
singleton TSShapeConstructor(ZombieBlender1Dae)
{
   baseShape = "./zombieBlender1.dae";
   lodType = "TrailingNumber";
   loadLights = "0";
};

function ZombieBlender1Dae::onLoad(%this)
{
   %this.addSequence("./Anims/zombieBlenderAllAnims.DAE", "Attack1", "840", "900", "1", "0");
   %this.setSequenceCyclic("Attack1", "0");
   %this.addSequence("./Anims/zombieBlenderAllAnims.DAE", "Attack2", "930", "990", "1", "0");
   %this.setSequenceCyclic("Attack2", "0");
   %this.addSequence("./Anims/zombieBlenderAllAnims.DAE", "Death1", "1020", "1080", "1", "0");
   %this.setSequenceCyclic("Death1", "0");
   %this.addSequence("./Anims/zombieBlenderAllAnims.DAE", "Death2", "1110", "1160", "1", "0");
   %this.setSequenceCyclic("Death2", "0");
   %this.addSequence("./Anims/zombieBlenderAllAnims.DAE", "sprint2", "791", "810", "1", "0");
   %this.addSequence("./Anims/zombieBlenderAllAnims.DAE", "sprint_forward", "741", "759", "1", "0");
   %this.addSequence("./Anims/zombieBlenderAllAnims.DAE", "run2", "621", "710", "1", "0");
   %this.addSequence("./Anims/zombieBlenderAllAnims.DAE", "Run", "501", "590", "1", "0");
   %this.addSequence("./Anims/zombieBlenderAllAnims.DAE", "root", "31", "150", "1", "0");
   %this.addSequence("./Anims/zombieBlenderAllAnims.DAE", "root2", "181", "300", "1", "0");
   %this.addSequence("./Anims/zombieBlenderAllAnims.DAE", "root3", "331", "450", "1", "0");
   %this.addSequence("./Anims/zombieBlenderAllAnims.DAE", "Spawn", "1187", "1431", "1", "0");
   %this.setSequenceCyclic("Spawn", "0");
}
So there you go. Blender editable zombies with animations. :D

Here are my Blend files:

http://www.filedropper.com/zombieblenderallanims (99megs)
http://www.filedropper.com/megazombieblender (14megs)
http://www.filedropper.com/zombieblender1 (5megs)

Feel free to host these elsewhere and link below. ;)

EDIT: FIXED THE LINKS
Last edited by Steve_Yorkshire on Sun Apr 29, 2018 7:26 pm, edited 1 time in total.
Steve_Yorkshire
Posts: 299
Joined: Tue Feb 03, 2015 10:30 pm
 
by Steve_Yorkshire » Wed Apr 25, 2018 5:40 pm
Are you boys related?
Image
Stock GG Zombie on left, Blender exported zombie on right

Just to note the armature includes a load of bones called "nubs" which do not do anything in Blender (I think that they're helpers for Max). I removed them in a test with both animation and mesh and everything still worked fine with both reimported.

Original zombie has 135 bones (phew-ee, that's MMD Miku levels of bones), whilst Blender zombie has a slightly more reasonable 82.
And for a test I reworked vertexes and then deleted bones for fingers, tongue, ponytail (which is not in use anyhow) and nubs, and that brought it down to 49.
Steve_Yorkshire
Posts: 299
Joined: Tue Feb 03, 2015 10:30 pm
 
  by Steve_Yorkshire » Thu Apr 26, 2018 10:02 pm
Okay found a few issues/causes:

First up the weird bone naming of Bip001A, Bip001B, etc are because the bone names have spaces but the IDs of the names have underscores, so all them need changing. :roll:

Image
Rename the bones from "Bip001 Pelvis" to "Bip001_Pelvis" and the names will come through into Torque.

Issue:
All animations play EXCEPT root. Root plays fine in the shapeEditor but no root animation plays on zombie AIplayers. Using %obj.setActionThread(root); returns 0 as a fail. All other animtions including renaming the "root" animation play fine. Sometimes console says it can't read the animation dae - so maybe it's too big, the stock GG animations are all single files rather than the giant ambient. :x

I shall endeavour to investigate further. :ugeek:
Duion
Posts: 1128
Joined: Sun Feb 08, 2015 1:51 am
 
by Duion » Thu Apr 26, 2018 10:04 pm
They probably had big plans to make their models future proof by naming them Bip001, so they can have up to 999 more skelettons and bones without messing up the naming by adding another character.
Steve_Yorkshire
Posts: 299
Joined: Tue Feb 03, 2015 10:30 pm
 
by Steve_Yorkshire » Fri Apr 27, 2018 1:02 am
Well, I'm out of ideas for the moment.
When a Blender Zombie AI spawns it just sits in the pose state (not rootpose, a different one which it has in the editor).
When a movement animation ends the Blender zombie stays in the last frame until a new movement animation triggers.
Run works, Sprint_Forward works, Death1/2 work when they get killed, root is the only thing which doesn't fire via movement triggers/input commands (or lack of movement triggers). :cry:

Alternatively there is the old "do it the way [GG]Mich does in the Zombie resource" where all animations are manually set with %obj.setActionThread("anim"); but that is a horrible hack. *shudders* :|
Steve_Yorkshire
Posts: 299
Joined: Tue Feb 03, 2015 10:30 pm
 
by Steve_Yorkshire » Fri Apr 27, 2018 1:40 am
Well, I'm out of ideas for the moment.
That wasn't a very long moment ... :lol:

I imported the animation into the Blender Zombie and deleted everything but the first 150 frames (GG stock zombies have root 30-150) and imported it as a standard "ambient" animation. I then took this internal anim and made the root animation from it (root 26-150 for perfect seamless looping). I then added the other movement animations from the giant Blender Animation file which only has the anim, Bip001, and bounds. Restarted Torque (cos my Ai datablock had already been loaded) and it worked. Everyone played nice together. Local root played, non-local run/sprint played and returned to local root at the end of their movement triggers.

Hurray. :mrgreen:
Steve_Yorkshire
Posts: 299
Joined: Tue Feb 03, 2015 10:30 pm
 
by Steve_Yorkshire » Fri Apr 27, 2018 2:34 am
Oh and pro-tip: always export the bounds with the movement animations or else the armature runs off for 10 feet before jarring back! :?
Steve_Yorkshire
Posts: 299
Joined: Tue Feb 03, 2015 10:30 pm
 
by Steve_Yorkshire » Sun Apr 29, 2018 7:25 pm
http://www.filedropper.com/soldierallanimsnamed
Soldier dae for blender with nodes/bones correctly named and a mount0 added
Jason Campbell
Posts: 271
Joined: Fri Feb 13, 2015 2:51 am
 
by Jason Campbell » Tue May 01, 2018 12:47 am
Nice work Steve! Thank you.
Steve_Yorkshire
Posts: 299
Joined: Tue Feb 03, 2015 10:30 pm
 
by Steve_Yorkshire » Mon May 21, 2018 12:04 am
After some work I managed to get the extended soldier death animations working with the zombies. Zombie arm bones are different to soldier so they kinda come out as a terrible misshapen mess. I ended up having to pose the arms manually which was a bit of a pain (trust GG not to stick with one source skeleton). I missed off fixing the arms for the last 2 or 3 anims cos I didn't really like them and there's some additional mount nodes and finger bones are missing cos my current project doesn't need them - but none of that should cause issues.
zipped dae file, Blender importable, armature and bounds and animation cycle http://yorkshirerifles.com/downloads/zombDeathAnims.zip
10 posts Page 1 of 1

Who is online

Users browsing this forum: No registered users and 1 guest