STEAM GROUP
Blender Source Tools BleST
STEAM GROUP
Blender Source Tools BleST
355
IN-GAME
2,150
ONLINE
Founded
November 8, 2013
All Discussions > Help > Topic Details
Bones being rotated at weird angles after export
I can't figure out why but after I exported this modified model the bones are rotated in weird directions, I've done this before with another model and it didn't cause me problems

Here's the model source file:
https:// mega.nz /file/ZHJlFazQ#Fx6uHHXBNXsPjhubpBTid7mdV0akcMAO9jNoqGBp0aM
(Just remove the spaces^)

Also the left one is what it is supposed to look like and the right one is what got exported:
https://imgur.com/a/eTxvXiu
Last edited by Wolƒe Strider Shoσter; Jan 18, 2021 @ 3:01am
Originally posted by Pte Jack:
Ok, test one, (using the Studiomdl.exe from SFM), I removed the $Definebone statements and compiled your SMDs and got this in SFM.

https://i.imgur.com/8KlrQxi.png

https://i.imgur.com/t05u7sK.png

https://i.imgur.com/Vlzy4f0.png

Everything looks fine in SFM (unless I'm missing something). I'll compile for GMod a little later as I have to go out right now.
< >
Showing 1-12 of 12 comments
Pte Jack Jan 16, 2021 @ 9:51am 
Looks like you're exporting DMX files (I'm assuming).

If your Mesh object has the same name as the bone that controls it, the model is going to pooch out and the mesh is going to be extruded and rotated differently than it looks in Blender when compiled, This is some sort of bug (not sure if it's within the export of the DMX or the actual Studiomdl compiler screwing up.)

For example. https://steamcommunity.com/sharedfiles/filedetails/?id=1959841658

See how the face of this character is pulled away from the model in that picture. That is because the mesh object that was exported was named head (it created a DMX file called head.DMX) and the bone that it was weight painted to was also named head.

Check your model in Blender and see if this is the case for you. The easy fix is to start using prefixes on your bone names like bip_ or twst_ or hlp_ or def_ or att_ or weyw_
(In my case I look at these identifying what they do, like:
bip = bone in place or biped bone
twst or adj = Twist or adjustment bone
hlp = helper bone
def = deform bone
att = attachment bone
weyw = whatever you want for a prefix to a bone name)

This will ensure that the mesh object and the bone names will never be the same and you won't have this problem when you export DMX files.
Last edited by Pte Jack; Jan 16, 2021 @ 9:53am
I am not exporting in DMX files and every time I rename a bone it renames the vertex group anyway
Pte Jack Jan 17, 2021 @ 7:37am 
Vertex groups should have the same names of the bones that are deforming the mesh that is weight painted to them. If they didn't, then the model would not move.
Yeah I know, I just got confused between mesh object and vertex mesh. Anyway I'm still unsure what is going on with my model, any ideas?
Pte Jack Jan 17, 2021 @ 10:29pm 
I would have to actually examine it to give any further advice.
Whoops, apparently Steam removed my link in my first post, check there you'll see the model source file
Pte Jack Jan 18, 2021 @ 6:15am 
The model appears to be weight painted properly, however (just an observation) you do have some weirdness happening on what looks to be 4 - 8 verts painted to the window and root bone that extrudes something from behind and above the seat. If these are supposed to be rods of some kind then you have to paint them better to get the proper effect .

https://i.imgur.com/WnAN0kD.png

https://i.imgur.com/wNS308r.png

One other thing I did notice is that your Physics mesh (the collision model) is only painted to the root bone, I think the Window and the support collisions need to be painted to the proper bones.. (especially for GMod) ??

https://i.imgur.com/afxNrf5.png

Let me compile this a couple of different ways and see if I'm seeing this twisted bone problem. I may ask for the compiled model your' having problems with if I can't reproduce the problem.

I'm assuming from your picture you are compiling for SFM and or Garry's Mod??

Last edited by Pte Jack; Jan 18, 2021 @ 6:32am
The author of this thread has indicated that this post answers the original topic.
Pte Jack Jan 18, 2021 @ 7:10am 
Ok, test one, (using the Studiomdl.exe from SFM), I removed the $Definebone statements and compiled your SMDs and got this in SFM.

https://i.imgur.com/8KlrQxi.png

https://i.imgur.com/t05u7sK.png

https://i.imgur.com/Vlzy4f0.png

Everything looks fine in SFM (unless I'm missing something). I'll compile for GMod a little later as I have to go out right now.
Pte Jack Jan 18, 2021 @ 9:16am 
Yeah, I'm not seeing an issue in GMod either ( other than that weight painting issue in the cockpit I mentioned earlier and again, unless I'm missing something here.)
This is your SMDs compiled using the GMod version of Studiomdl. The only difference being
is that I commented out the $definebones statements.

Model, Hitboxes, Phy mesh and bones look good in HLVM

https://i.imgur.com/DM6MD6F.png

I've used the Advanced bone tool to extend the 3 support legs and rotate the cockpit cover.

https://i.imgur.com/hCkVjTN.png

https://i.imgur.com/X3J3rZP.png

https://i.imgur.com/6RDULa1.png
Last edited by Pte Jack; Jan 18, 2021 @ 9:24am
Yes that is perfect! (and yes this is for Garry's Mod) Yeah sorry I guess this is just me being completely new to the Blender and Source modeling scene. Thank you so much for the help, hugely appreciated. Although I do have a few questions, I thought you needed $definebones for the bones to work. Also why do would you weight paint the physics mesh, I thought the physics model wouldn't update anyway
Last edited by Wolƒe Strider Shoσter; Jan 18, 2021 @ 7:16pm
Pte Jack Jan 18, 2021 @ 7:25pm 
THe physic mesh is what is used to have things bump into stuff. if it isn't painted properly then it can't interact with the universe you're using it in. So, if you open the cockpit and the cockpit phys mesh does't move, then a model can't get into the machine but can walk up over the cockpit and through the open canopy.

The only time you need define bones is if you want bone in the model that don't have mesh weight painted to it (like weapon bones). Also, if you define bones, then you have to define all the bones you want to have in the model.
Yup all I had to do was remove define bones and everything worked like a charm, thanks a lot!
< >
Showing 1-12 of 12 comments
Per page: 1530 50

All Discussions > Help > Topic Details
Date Posted: Jan 16, 2021 @ 6:12am
Posts: 12