STEAM GROUP
Blender Source Tools BleST
STEAM GROUP
Blender Source Tools BleST
291
IN-GAME
1,908
ONLINE
Founded
November 8, 2013
All Discussions > Bug Reports > Topic Details
ToTac Nov 26, 2019 @ 11:36am
BST always export all Amature Bones to Animation SMDs
I am not sure if I am doing something wrong or of this is a common bug, but I keep running into this problem more often recently. Maybe I just didn't realize it in the past.

The object setup may be like this:
A simple mesh parented to an armature by hierachy and modifier.
Multiple deforming bones, all parented to the root bone, but !not all of them are deforming!
A few controller/IK/physic bones, not deforming, either parented or not parented to the root bone.

BST settings:
Format: SMD
Up-Axis: Z
Engine: GoldSRC (or Source, doesnt't matter)
That is it.

Now when exporting the reference and animation SMDs (either all at once or individually), the animation SMDs will always have ALL the bones in them, while the mesh (or reference) SMDs will only have the deforming bones in them, which is effectively destroying the hierarchy and making compilation impossible.

For example, if I use a Human Meta Rig like the one of Rigify, the animation SMDs will include over 400 bones, while mesh SMDs will include less than 100.

I can't really think of a solution or workaround for this.
Any help would also be appreciated.
< >
Showing 1-9 of 9 comments
Zappy Nov 26, 2019 @ 11:44am 
Can you verify that the mesh SMDs still have less than 100 bones when you make a new Blender session and import one of the mesh SMDs into it?

I know that, at least for Source, the model compiler itself can discard bones that don't have any vertices connected to them if none of their child bones are linked to any vertices either, even though those bones may still be in the SMDs themselves.
Meanwhile, for mesh-less animations, the model compiler can of course only assume that every single bone means something important.


Additionally, what versions of Blender and the Blender Source Tools are you using?


I'm sure that Artfunkel would appreciate knowing those things.
ToTac Nov 26, 2019 @ 11:49am 
Sorry, your answer came too fast ;) Wanted to add that info now.

Blender 2.80
Blender Source Tools 3.0.3

As for the rest, I am trying different setups now. Also tried Blender 2.79 and BST 2.10.2, but the behaviour seems to be the same there as well.
Last edited by ToTac; Nov 26, 2019 @ 11:49am
Pte Jack Nov 26, 2019 @ 12:54pm 
Unparent the objects from the armature and rely on the armature modifier to handle the job or move the mesh object(s) to the armature collection usually takes care of the multiple armature warning.
Artfunkel Nov 26, 2019 @ 1:02pm 
It's intentionally worked this way since the 30th of January 2014, but I can't entirely remember why.

It might be because an animation can be applied to multiple meshes with different deformation settings, so we can't safely decide what to cull. Or it could be related to supporting the import/export of animations without any meshes in the scene.

This shouldn't break anything though. The compiler can handle collapsing bones perfectly well. What is the exact error message you are seeing?
ToTac Nov 26, 2019 @ 1:19pm 
Zappy, just to be sure you didn't get me wrong.

In my case, the reference SMDs are including the correct amount of bones (e.g. 80 deforming bones).
The animation SMDs are including the total amount of bones (e.g. over 400) used in that particular Armature which is used for the mesh(es), which isn't what I (or anybody?) would want, naturally.

If this would be an option, then I would just set all bones to "deform" and export them nonetheless (so they'd appear in the mesh/reference SMDs as well), but apparently I am running into problems then when compiling models for Goldsource, since that studiomdl format has a limit of 128 bones and non-connected bones aren't really being ignored on compilation. I am currently working with the Sven Coop studiomdl.exe, which is a bit more advanced and kind of up to date at least, so you would assume this not being an issue, but apparently it is.

So I kind of depend on a way which excludes all the unnecessary bones from export, not only for the reference SMDs, but also for animation SMDs.
Last edited by ToTac; Nov 26, 2019 @ 1:34pm
ToTac Nov 26, 2019 @ 1:31pm 
Originally posted by Pte Jack:
Unparent the objects from the armature and rely on the armature modifier to handle the job or move the mesh object(s) to the armature collection usually takes care of the multiple armature warning.

I tried that, but it's not helping with my problem apparently. Although I am not totally sure what you expected this to do.
Scene would then look like this:
  • MyMesh1 (Armature Modifier: MyArmature)
  • MyMesh2 (Armature Modifier: MyArmature)
  • MyMesh3 (Armature Modifier: MyArmature)
  • MyArmature
Animation still plays, no problem there. But animation SMD still includes all bones, also non-deforming ones.
ToTac Nov 26, 2019 @ 1:48pm 
Originally posted by Artfunkel:
It's intentionally worked this way since the 30th of January 2014, but I can't entirely remember why.

It might be because an animation can be applied to multiple meshes with different deformation settings, so we can't safely decide what to cull. Or it could be related to supporting the import/export of animations without any meshes in the scene.

This shouldn't break anything though. The compiler can handle collapsing bones perfectly well. What is the exact error message you are seeing?

Thanks a lot for explaining!
I rarely exceeded the Goldsource limit of 128 bones before I think, so this is only now getting an issue for me, as I started animating a character for Sven Coop with the Human Meta Rig, which is rather complex, I am sure you know it yourself.

On export from Blender the BST show the Warning:
"WARNING: Exported 458 bones, but SMD only supports 128!"

The Sven COop Studiomdl.exe will then only blat about the "illegal parent bone replacement", since the bone tables in reference and animation SMDs differ like so:

walk.smd (Animation - 457 bones in total)
version 1
nodes
0 "root" -1
1 "ORG-hips" 0 (non-deforming)
2 "ORG-spine" 1 (non-deforming)
3 "ORG-chest" 2 (non-deforming)
4 "ORG-neck" 3 (non-deforming)
5 "ORG-head" 4 (non-deforming)
6 "DEF-head" 4
7 "Nose1" 6
8 "Nose2" 7
9 "Eye.L" 6
10 "Ear1.L" 6
[...]

Body.smd (Mesh - 75 bones in total)
version 1
nodes
0 "root" -1
1 "DEF-head" 0
2 "Nose1" 1
3 "Nose2" 2
4 "Eye.L" 1
5 "Ear1.L" 1
6 "Ear2.L" 5
7 "EyeLid1.L" 1
8 "EyeLid2.L" 1
9 "Jar" 1
10 "Eye.R" 1
[...]
Last edited by ToTac; Nov 26, 2019 @ 1:57pm
Artfunkel Dec 2, 2019 @ 10:34am 
I'm a little reluctant to change something so fundamental that has been in place for so long, but I could provide an option somewhere I suppose.

If you feel comfortable editing script files, you could open export_smd.py and change line 532 to read:
exporting_armature = False
This will cause animation exports to have the same bones as mesh exports.
ToTac Dec 4, 2019 @ 8:30pm 
Sorry, I am just so confused about this topic, I stopped thinking about it and came to terms with only using simple selfmade rigs for Goldsource SMD export, so I don't need to worry about exporting all bones for it to work.

It's weird how nobody else seems to have trouble with this, so I kept wondering if I am doing something wrong. Maybe nobody tried to use the Human Meta Rigs for Goldsource animation before? I dont know.

Anyway, thanks for that hint, I even flew over the code before and tried to analyze the bone export a bit, but it's far too complex for me to overlook it that easily.
I will surely try your suggestion, because it is still an important topic for me. Will give feedback then.
< >
Showing 1-9 of 9 comments
Per page: 1530 50

All Discussions > Bug Reports > Topic Details