DJ-Skaro / blender-smd

Automatically exported from code.google.com/p/blender-smd
0 stars 1 forks source link

Blender bone orientation incompatable with $jigglebone #65

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Models exported from Blender seem to have an issue with $jigglebone where by 
what should be Yaw rotation is applied as Roll.

From what I've managed to make out, this is due to the fact that Blender has a 
really annoying habit of setting the bones "forward" axis to Y, without giving 
you any way to change it.
However source expects the Z axis to be forward.

As seen in the image at the top of this VDC page:
https://developer.valvesoftware.com/wiki/$jigglebone

Is there any way that the exporter could have an option to re-orient the bones 
axes?

Or am I just being totally stupid? If so and there's an easy work around for 
this, please do let me know. T_T

Steps:
1. Create a simple cylinder with say, five subdivisions, shove a test grid 
texture on it, rig it with five bones.
2. Export and create a QC file, specifying the bones as jiggle bones. Use a 
config similar to this to easily see the issue:
$jigglebone "BoneName" {
    is_flexible {
        yaw_stiffness 100
        yaw_damping 6
        pitch_stiffness 100
        pitch_damping 8
        tip_mass 30
        length 30
        angle_constraint 37
    }
}
3. Compile the QC into something sandboxy, such as Gmod.
4. Spawn the model and waggle it around a little.
5. Observe as it moves incorrectly.

Made a little video of the issue in-case you can't be bothered with the steps. 
xD
http://www.vorix.net/stuffandthings/RollExample.avi
As you can see, one of the axes functions as expected, one not so much.

Original issue reported on code.google.com by dir...@vorix.net on 18 Jan 2013 at 5:24

GoogleCodeExporter commented 9 years ago
If you check the "legacy rotation" option on the Armature's export settings, 
the tools will rotate bones round to the orientation Source assumes. Does that 
fix the problem?

Original comment by cont...@steamreview.org on 23 Jan 2013 at 10:46

GoogleCodeExporter commented 9 years ago
I didn't actually know about this option, it sounded good.

Upon using and re-exporting/compiling, the only change I can see is that the 
misbehaving axis has been swapped.
Using my video as a reference, moving the model side to side now functions as 
expected, but forward and back is now translated to roll.

Original comment by dir...@vorix.net on 28 Jan 2013 at 9:51

GoogleCodeExporter commented 9 years ago
Damn. Looks like the only thing you can do is uncheck the "Connected" option of 
each bone and rotate them to the appropriate direction manually. They'll look 
strange in Blender but at least it'll work.

Remember to disable legacy rotations too.

I'm not going to fix this in the tools because it's a Blender problem.

Original comment by cont...@steamreview.org on 30 Jan 2013 at 4:37