3D animation export help

3D animation export help

Postby JTE » Tue Mar 19, 2019 1:40 am

I'm working on a Game which involves a reasonably high detail player model (around 2,500 tris) which requires skeletal animation because I want to attach things to several bones which exist solely as attachment points (eg. a temporary hat attaches to the "hat bone", which is attached to the head bone where the head mesh is attached)

The attachments are simple .obj files for maximum compatibility and work correctly. The player model does not, however.

To begin with I had reasonable luck with exports to DirectX format (Default coordinate system: Left-handed), except that the model is rotated to face backwards in-game (towards the camera instead of away). But then when I went to attach things, I found that the attached models are treating the skeleton as though it were completely upside-down. So my hat is bobbing down and up about two blocks below the floor, while the player's head bobs up and down an equal distance above it. The file size comes out to around 6 MB, which is pretty steep, but I haven't had much luck reducing it.

Did a lot of optimizations trying to see if I could fix the model, rotating the armature itself around, etc. but nothing really worked. Changed the coordinate system to "Right-handed", suddenly everything appears to work correctly... except the entire model is now horizontally flipped, animations and all. @@; Trying to un-flip it with negative scale resulted in all the normals getting flipped as well and the attachment bones going backwards in-game, so that won't work... ugh.

I tried other model formats too. The B3D exporter at https://github.com/minetest/B3DExport/ produces a 20 MB large file somehow, which can't even load because the engine crashes if a server attempts to send any file larger than around 16 MB. I tried old Blender version 7.3 (the current version from when the B3DExport plug-in was made) but saw no functional difference.

I looked up Irrlicht's documentation (since Minetest's own documentation says "for supported file formats, go see Irrlicht") and found out there is a third skeletal animation format supported nowadays, from MilkShape3D. Unfortunately Minetest currently doesn't recognise .ms3d files as valid resources, so it doesn't send them to clients. (regardless of whether or not clients would have a recent enough Irrlicht version to render them) If Minetest did support ms3d models though, this one would only be 684 KB large apparently. That can't be right, can it..?

I seem to have exhausted everything I could try. :( Got any tips?

Edit: nevermind... it figures just after I finally give up and decide to post where I'm at, I'd manage to correctly optimize the b3d file down to 7 MB and it works now. Still larger than an .x file, but at least it's consistent with the rest of the engine now.

I'm guessing that the "Left-handed" DirectX model was correct, considering the B3D model has to be rotated the same way, so the attachment point being flipped below the floor must be a bug? Throw that on top of the bug with attachments being invisible if attached while in third-person mode (already fixed in a pull request) and attachments to the player sometimes (randomly) deciding to attach to the server's representation of your player model rather than the client-side prediction of the player model... Messy business.
Posts: 14
Joined: Sun Sep 07, 2014 2:59 pm

Return to Modding Discussion

Who is online

Users browsing this forum: Yandex Bot [Bot] and 0 guests