Jump to content



Recommended Posts

So there is a new version of Blender out, with some wholesale changes ... like left and right mouse buttons have been inverted for selection, space plays animations, 'A' is no longer a toggle but only select all and you have to use 'ALT A' to deselect all ...

But let's stick to the important stuff ... getting a rigged model, multiple meshes for LODs and an animation exported via COLLADA.

First up install Blender 3D version 2.8. I installed mine into a different directory than the previous 2.78c. This didn't matter as 2.8 deleted my older version anyway ... which was just f******* great.


So, in the good old days, you'd have your armature, your LOD meshes parented to this armature via 'CTRL P' and select 'armature deform' so the meshes would be able to move with the armature bones via their vertex. This would automatically add the armature connection with vertex groups into the modifiers for the mesh.


And it would look something kinda like that. SO let's export via the standard COLLADA exporter, apply modifiers and see how that works ...


Okay maybe not ... :o

Let's try again without apply the modifier.


Well, that's an ... improvement ..kinda ... :?

The obvious issue is some sort of magnification of scaling and rotation of nodes. :ugeek:

The solution is not to have the meshes parented to the armature, and just use the armature modifier for each mesh on it's own.


But there's still a problem. There is a SECOND armature being exported. Torque renames this "armatureB" and it just sits on the model not doing anything.


The solution to this is to go into the exporter's "extras" tab and select 'Sort By Object Name'.


And then it all comes through as it should do ... hopefully. :mrgreen:


The case is solve-ed!


Link to comment
Share on other sites

  • 2 weeks later...

A note on exporting animations.

The new (it's actually still the old 1.4.1) Blender3D 2.8 COLLADA exporter has a whole lot of new options.


Some of these options work better than others ...

Under the "Animation" tab, deselect "Include All Actions" as you only want a single "ambient" animation exporting, and tick "Keep Keyframes" or your animation isn't going anywhere.

Under the "Extra" tab, select "Sort By Object Name" to prevent duplicate armatures appearing, and select "Keep Bind Info" to prevent the above mangling from occuring.

And hopefully all will be well once it gets into Torque.



Link to comment
Share on other sites

Just a note on animations:

I export the character model without any animations. Select the armature, set the TimeLine to 0, go into the Dope Sheet->Action Editor and hit "x" to disable/deselect the current action, in armature Properties->Object Data put it in the Rest Position, then from the Viewport select Pose Mode, select all bones, in Pose tab Apply->Apply Visual Transform To Pose, back to the Properties->Object Data and deseclt Rest Position by pressing Pose Position button, and then select all objects that I want exporting and export. This way the character model exports without an ambient animation.

For export you only need selected the base01-start01-armature-bounds, no meshes, no LODs.

For each animation, I select it in the Dope Sheet->Action Editor. In the Timeline select the start and end frames - this is new to Blender 2.8 and it will either cut off your animation if it is too short or add empty frames if too long.

NOTE: keyframe 0 is the Rest Position, so animations start at 1. This helps with transforms, especially for blend animations. For a blend animation the root pose is 2, and the blend animation starts at 3.

For cyclic animations like run, 0 is the Rest Position, 1 is the start of the loop animation and the last frame is a copy of this. In tsShapeConstructor the start and end frames are selected, so for looping animations the end frame is the last minus 1.

So ehre's what the tsShapeConstructor looks like; note animations start at 1, thus missing the Rest Pose to help transforms, blends start at 2 to miss Rest Pose and Root pose reference, looping animations end at the frame before they finish so not to replay it, all other animations end at -1, the finish.

There are no Death, Head, Headside, or Look animations because this is set up for a topdown character who only shoots forwards.


singleton TSShapeConstructor(GunGirlPlayerDae)
   baseShape = "./gunGirlPlayer.dae";
   lodType = "TrailingNumber";
   loadLights = "0";
function GunGirlPlayerDae::onLoad(%this)
   %this.addSequence("./anims/gunGirlPlayer_landx.dae", "land", "1", "-1", "1", "0");
   %this.setSequenceCyclic("land", "0");
   %this.setSequencePriority("Land", "0");
   %this.addSequence("./anims/gunGirlPlayer_fallx.dae", "fall", "1", "-1", "1", "0");
   %this.setSequencePriority("Fall", "1");
   %this.addSequence("./anims/gunGirlPlayer_sprint_backwardx.dae", "sprint_backward", "1", "24", "1", "0");
   %this.setSequencePriority("sprint_backward", "2");
   %this.addSequence("./anims/gunGirlPlayer_sprint_left_sidex.dae", "sprint_side", "1", "24", "1", "0");
   %this.setSequencePriority("sprint_side", "3");
   %this.addSequence("./anims/gunGirlPlayer_sprint_right_sidex.dae", "sprint_right", "1", "24", "1", "0");
   %this.setSequencePriority("sprint_right", "4");
   %this.addSequence("./anims/gunGirlPlayer_sprint_forwardx_static.dae", "sprint_forward", "1", "16", "1", "0");
   %this.setSequencePriority("sprint_forward", "5");
   %this.addSequence("./anims/gunGirlPlayer_backx.dae", "back", "1", "98", "1", "0");
   %this.setSequencePriority("Back", "6");
   %this.addSequence("./anims/gunGirlPlayer_side_leftx.dae", "side", "1", "50", "1", "0");
   %this.setSequencePriority("Side", "7");
   %this.addSequence("./anims/gunGirlPlayer_side_rightx.dae", "side_right", "1", "50", "1", "0");
   %this.setSequencePriority("Side_Right", "8");
   %this.addSequence("./anims/gunGirlPlayer_runx.dae", "run", "1", "98", "1", "0");
   %this.setSequencePriority("Run", "9");
   %this.addSequence("./anims/gunGirlPlayer_rootBase.dae", "root", "1", "60", "1", "0");
   %this.setSequencePriority("root", "10");
   %this.addSequence("./anims/gunGirlPlayer_heavy_recoilx.dae", "heavy_recoil", "2", "-1", "1", "0");
   %this.setSequenceCyclic("heavy_recoil", "0");
   %this.setSequencePriority("heavy_recoil", "11");
   %this.setSequenceBlend("heavy_recoil", "1", "root", "0");
   %this.addSequence("./anims/gunGirlPlayer_medium_recoilx.dae", "medium_recoil", "2", "-1", "1", "0");
   %this.setSequenceCyclic("medium_recoil", "0");
   %this.setSequencePriority("medium_recoil", "12");
   %this.setSequenceBlend("medium_recoil", "1", "root", "0");
   %this.addSequence("./anims/gunGirlPlayer_light_recoilx.dae", "light_recoil", "2", "-1", "1", "0");
   %this.setSequenceCyclic("light_recoil", "0");
   %this.setSequencePriority("light_recoil", "13");
   %this.setSequenceBlend("light_recoil", "1", "root", "0");


Now note I use sequencePriorities just to make sure things don't have to think too much about what should be playing. These are based on what the engine would expect to play in order. eg: if Land comes before Fall because if you have landed you are no longer falling, etc


0 Death, Land, Head, Headside, Look
1 Fall
2 Jump
3 Crouch_Back
4 Crouch_Side
5 Crouch_Right
6 Crouch_Forward
7 Crouch_Root
8 Sprinting_Back
9 Sprinting_Side
10 Sprinting_Right
11 Sprinting_Forward
12 (Standing_)Back
13 (Standing_)Side
14 (Standing_)Right
15 (Standing_)Run
16 (Standing_)Root
17 Light_Recoil
18 Medium_Recoil
19 Heavy_Recoil
20+ Others after this...


So why export animations seperately?

If you export a single ambient animation, either on it's own, or with the character model, Torque has to load the entire animation EVERY TIME you want to add or modify a single animation and this takes time, even on my i7 there are seconds of twiddling thumbs while it loads it EVERY TIME. By having smaller, more numerous animations it's over in an instant, and you barely see the "loading collada animation" popup.

Secondly, if you have seperate animations you can reuse them for other character which have the same armature set up rather than loading the same files over and over again.

Hopefully this helps and isn't too complicated. :?

Link to comment
Share on other sites

  • 2 months later...


Apparently @Bloodknight was having some issues with his workflow for importing FBX with collision meshes via assimp (Preview 4.0 Build 5) whilst he upgraded to the latest version of Blender.

It appears that when importing FBX format naming is more required than when just using DAE. Anyhow I had a play around with exporting FBX from Blender and here's what I found.

1: It really likes the DAE heirarchy if you want working collision meshes when exporting FBX. :|


2: If you import as SingleSize your object meshes require trailingNumber LOD else the collision meshes will not work. :o Weird right? :?

3: It will import working collision meshes when using DetectDTS or TrailingNumber (even when you have no trailingNumber) without trailing numbers for LOD. :shock: Did I mention trailing number in that sentence at all? :?

4: FBX is HUUUUUUUUUUUUUUUUUGE. :o Importing at scale 0.01 is the same as importing a DAE at 1.0.

It still feels like there are some sort of shennanigans going on with FBX - or at least FBX from Blender 2.8 but I'm not entirely certain what ... :ugeek:

Link to comment
Share on other sites

  • 8 months later...

Just to note I had the issue with the DAE exporter adding a "phantom" duplicate armature again recently. I fixed this by parenting the meshes to the armature (without parent via deform) and keeping the armature modifier. This seemed to resolve everything and the exporter did not add a duplicate armature.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...