Garry's Mod

Garry's Mod

Unreal Gold SNPCs + SWEPs
Snow Silver 21 Jun, 2022 @ 11:20am
Dembones
Do you mind sharing your workflow on how you managed to get the vertex mesh into bone based meshes?

This tool would help the Unreal community a ton with updating models! Somehow missed this existing haha.
< >
Showing 1-15 of 25 comments
kwaHliveD  [developer] 21 Jun, 2022 @ 12:18pm 
of course we will. i am mid-way writing a comprehensive guide on to how to get it to work for unreal. it requires the exact tools with the exact version, took me very long time and research from archived forum pages to get it working. i have to document it so it is easier to access for anyone else that wants to follow the same procedure.

while i write the documentation, here are the tools you need:

1-) blender 2.83.8 (must exactly be 2.83.8)
2-) umodel (extract mesh with anims)
3-) u3dbinread (extract all animations as .obj frames)
4-) stop motion obj (2.0.2 - newer versions are incompatible with blender 2.83.8 - crucial for importing obj sequences with u3dbinread)
5-) dembones (the magic wand which will do the conversion)

and to import the model in blender again:

6-) blender source tools (any version that's compatible with blender 2.83.8)

workflow:

1-) extract the mesh you want with umodel
2-) extract the animation to separated frames with u3dbinread, using "save all frames" option
3-) in blender 2.83.8, import your mesh frames with "Add -> Mesh -> Mesh Sequence" and load mesh sequence from the right menu
4-) after importing the mesh with frames, define how many frames you have from the frame menu below
5-) from "Add Modifier" menu, add "Array", with count of "1". do not "apply" the array
6-) from export menu, export as FBX with following options: scale 0.01, "bake animation" unticked. this will export reference mesh. name exported file as "mesh.fbx"
7-) from export menu, export as ABC with following options: "renderable objects only" unticked, "visible objects only" ticked. name exported file as "mesh.abc"
8-) run dembones with following options: dembones.exe -i="mesh.fbx" -a="mesh.abc" -b=120 -o="mesh-bones"

now you can import your mesh in any blender version you want.
9-) import "mesh-bones.fbx with following options: scale: 100
10-) export your mesh with blender source tools, or with any exporter you want.

keep in mind those limitations:

1-) none of the bones exactly have a parent. they move regardless of their parent bone, as you may have expected. for example, if you spin a mercenary's hand around by its elbow, only the elbow will rotate and the hand will not. this makes editing animations difficult.

2-) the exported animations will have openings around its mesh, based on how many vertices are supposed to be manipulated with boneweights, something that the dembones can't easily calculate. this is mostly noticed with skaarj and nali.

3-) some animations may be heavily based on vertex animation, like creatures decapitating, tentacle deploying, skaarj trooper shield, weapon firing muzzle flash effects or any object that's shrinking or inflating. they don't animate properly with dembones, especially when they are limited to only three or four triangles. if you choose your reference mesh properly in step 6, you can reduce most of the calculation errors.
Snow Silver 21 Jun, 2022 @ 12:32pm 
This is incredibly helpful! Thank you for taking the time to post this!
kwaHliveD  [developer] 21 Jun, 2022 @ 12:37pm 
no problem. always write back here in case you stumble upon a bug, cannot find the exact tool, something's not working, not understanding the instructions etc... it takes around 5 minutes to follow the procedure after you get used to it without any problems.
It's just absurd how such thing was discovered recently and not earlier. It would have helped people like me that in the end, was able just to port stuff as props only
kwaHliveD  [developer] 25 Jun, 2022 @ 4:51am 
this tool was released to public in 2019, your work started in 2015. if you hadn't looked up the internet for this tool especially after it's been released, it's pretty normal you skipped that. i searched every month since 2020.

also, dembones is described as "skinning decomposition with rigid bones", when we look up "vertex animations to bone animations", we never get this tool anywhere on the Internet. there's only one video on the Internet on how it is used. it's again normal to miss that.
Snow Silver 25 Jun, 2022 @ 12:26pm 
I think the workflow is missing some explanations. Took me a while to get around to giving this a go.
You never explain what to do after you have a reference pose exported.

If you follow your instructions you'll only ever get one frame out of dembones and that one frame will have one bone (a really tiny bone)
kwaHliveD  [developer] 25 Jun, 2022 @ 1:23pm 
indeed i did?

first you export reference mesh as FBX in step 6

then, you export the animations as ABC in step 7

at last, you mix both with dembones in step 8

if you don't get any animations, maybe your ABC file is missing the frames. re-import ABC before processing to see if you export it properly.
Snow Silver 25 Jun, 2022 @ 2:08pm 
The ABC file has all the frames yet dem bones is only exporting a single frame.
The ABC file when imported looks like a ball of a bunch of the sequences individually
kwaHliveD  [developer] 25 Jun, 2022 @ 2:27pm 
if all the frames export as a single mesh, this means your blender is in the wrong version. it must exactly be 2.83.8. what version of blender are you using?

when you re import your abc, your mesh should cycle frame by frame.
Last edited by kwaHliveD; 25 Jun, 2022 @ 2:29pm
Snow Silver 25 Jun, 2022 @ 2:31pm 
It imports the ABC as a list of objects for each frame. Not as a single object with animations.
Snow Silver 25 Jun, 2022 @ 3:16pm 
Not sure if that's what you were refering to. 2.83 wouldn't be the reason for that. Unless they changed how ABC files work.

the plugin you claim not being supported works just fine in newer blenders too if you were wondering.
HunterTR 25 Jun, 2022 @ 5:23pm 
I wonder if it might work for 007 Agent Under Fire? :gordon:
kwaHliveD  [developer] 25 Jun, 2022 @ 10:29pm 
see the conversation at https://blenderartists.org/t/stop-motion-obj-obj-stl-ply-sequence-importer-v2-1-1/670105/108?page=6

the alembic exporter works in all blender versions, but it exports frames properly (a cycling vertex anim with frames) when your mesh is initially imported with stop motion obj. in newer or older versions, you get all the frames put in a single mesh, in a single frame. I'll record myself following my own steps eventually.

Hunter, it is up to you to check the compability, I don't know that game.
Snow Silver 26 Jun, 2022 @ 11:06am 
Thanks, this should help clear up some issues. My problem might have been my doubtfulness of needing the older blender version
< >
Showing 1-15 of 25 comments
Per page: 1530 50