Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

AppGameKit Classic Chat / Exporting animated models in Blender 3.1

Author
Message
Santman
10
Years of Service
User Offline
Joined: 15th Sep 2011
Location: Inverness
Posted: 6th Apr 2022 21:32
Hi all.

After much headache, I have managed to find the settings to export animated models in Blender 3.1 that allow the model to be exported as an FBX model and loaded into AGK. Some may knwo this, but whenever I tried I got corrupted models, animation or both. Having historically stuck to .X models, since Blender removed that support I've been relying on exporting as .OBJ files, importing them into MilkShape, then animating and exporting as a .X. This worked ok, but anytime I needed to change the model it was apian, and Blender has far better animation tools now, so as AppGameKit can no longer import a Blender model I have been trying to find the solution. As it happens, a Blender exported FBX files does work in AppGameKit, if the below settings are used. It also works for multi mesh models. Note, I do not know if some variatiosn of these will work, but the below settings worked fine for me.

Also note, that ALL vertices in ALL meshes need to have a bone assigned to them, even if the do nothing - but that applys to any animated model as without a bone the default AppGameKit shader will not render any vertices not assigned to a bone. Also, if you use the auto weighting of the bones I have found Blender to be very inaccurate here, and a lot of animation errors seem to stem from here, so I would split the model into as many seperate meshes as you need for diffferent areas of the animation, manually paint the weightings, then joing the meshes back together. This works fine, and maks getting non connecting joint animation really easy.

(imagine all options are expended - I cannot attach an image here, so in Blender expand all the options and they will match up in teh FBX export options pane)
Path mode: Auto
Batch mode: off

<INCLUDE>
Limit to: this is optional, you can use as you please
Object types: use Armature and mesh

<TRANSFORM>
Scale: 1.00
Apply scalings: All local
Forward: Z Forward
Up: Y Up
Apply unit: ticked
Use space transform: ticked
Apply transform: unticked (very important)

<GEOMETRY>
Smoothing: normals only
Export subdivision surface: unticked
Apply modifiers: ticked
Loose edges: unticked
Tangent space: unticked

<ARMATURE>
Primary bone axis: Y axis
Secondary bone axis: X axis
Armature FBXNode type: null
Only deform bones: unticked
Add leaf bones: ticked (not sure if needed)

<BAKE ANIMATION>
Key all bones: ticked
NLA strips: unticked
All actions: unticked
Force start/end keying: ticked
Sampling rate: 1.00
Simplify: 1.00
Ortu
DBPro Master
14
Years of Service
User Offline
Joined: 21st Nov 2007
Location: Austin, TX
Posted: 9th Apr 2022 14:38
Thanks Santman, I've had some success with .dae but I'd love to get .fbx working properly I'll give this a try

Blender's auto-weight can give you a starting point but it needs a lot of manual cleanup in general whether you are exporting for AppGameKit or not. A couple of things you can do to help here: The weight paint mode menus have options to limit the max number of bones assigned to each vertex, for export you will need to limit this to 4 however I tend to use 2 as a starting point and go to 3 as needed. keeping it low produces a smaller file size, bakes/exports faster, and you lose very little in the visuals of the animation its rare for more than 3 bones to have any major influence on a single vertex.

you should also use the 'normalize all weights' option after you do any painting or changing of weights this will ensure that each bone's weights total up to exactly 1.0 across all the assigned bones.

http://games.joshkirklin.com/sulium

A single player RPG featuring a branching, player driven storyline of meaningful choices and multiple endings alongside challenging active combat and intelligent AI.
Santman
10
Years of Service
User Offline
Joined: 15th Sep 2011
Location: Inverness
Posted: 10th Apr 2022 22:38
Sadly it's not working - after two full days of playing I think I have foudn the problem, but not sure if it is a Blender or AppGameKit problem. When I build an armature with an initital bone, then set up otehrs they seem to work fine. However if you rotate the core bone and that changes the physical position of a child bone, Blender does not show it as having any cooridinates as it is still at offset 0,0,0 to the root bone. However when loaded into AppGameKit, the child bone does not move at al. Oddly, this is only affected if the child bone is rotated....if it is not rotated, then it moves correctly. Ao I am assuming that it is an AKG error.
Santman
10
Years of Service
User Offline
Joined: 15th Sep 2011
Location: Inverness
Posted: 16th Apr 2022 10:43
Ortu - how did you get DAE to work? I am exporting them with all settings, but the animation is lost every single time....or at least, AppGameKit isn't loading in any animation.

Login to post a reply

Server time is: 2022-08-19 05:39:07
Your offset time is: 2022-08-19 05:39:07