STEAM GROUP
Blender Source Tools BleST
STEAM GROUP
Blender Source Tools BleST
202
IN-GAME
1,509
ONLINE
Founded
November 8, 2013
All Discussions > Help > Topic Details
Hezus Aug 4, 2017 @ 7:19am
Animations are rotated after export?
Alright, I've been at this for the entire day but for the life of me I can't figure it out. Hopefully someone can point out what I'm doing wrong.

So, I've modelled half a dome in Blender, which I want to open up. I've created an armature which is parented by modifier to the meshes I want to move. at Armature is at the origin 0,0,0 and I've set a rotation keyframe on frame 1. Then I rotated the entire shell of the dome about 80 degrees (so it opens) and set that to frame 30. Seems to look all fine in Blender. I've renamed the action to 'open' and exported the entire thing.

Looks like this:
https://drive.google.com/open?id=0BwjJCsQeR8f8Y2lPYnlWM001MkU

Now this is what happens in HLMV:
https://drive.google.com/open?id=0BwjJCsQeR8f8enhLQzFjSFNvS1k

Note how the dome (which is parented to the armature) is flipped 90 degrees. It's also starting at the wrong point.

I'm completely at a loss on where to find the solution.
- I've been checking all the settings for rotation options or base angles.
- The 'legacy rotation' option didn't affect it at all.
- I've tried animating the rest of the mesh to support an 'idle' animation (hopefully to let it make the same wierd rotation, but that just makes the entire mesh rotate [wtf?]).
- I've rotated the armature 90 degrees before parenting and animating it.. no result.
- I've troubleshooted my entire way through all documentation on the Valve Dev Community.. but no luck there.

Last idea would be that there is something wrong with the studiomdl? I'm using the one from Black Mesa (steam version).

Can someone help me?
Last edited by Hezus; Aug 5, 2017 @ 12:30am
< >
Showing 1-12 of 12 comments
Artfunkel Aug 4, 2017 @ 10:30am 
Your links are broken.
Hezus Aug 5, 2017 @ 12:30am 
Originally posted by Artfunkel:
Your links are broken.

Links restored. I copy/pasted this from Facepunch and that forum shortens links, so that;s what happend.

I've checked the compile log and it mentions this:

Found 1 preexisting sequences.
bones 1248 bytes (2)
animation x y ips angle
@open 0.00 0.00 : 0.00 ( 90.00) 1.0

As you can see it somehow sets the angle to 90 degrees, but I never specified it to do so. Nor can I find a place in Blender where this can be altered..
Last edited by Hezus; Aug 5, 2017 @ 2:46am
Artfunkel Aug 5, 2017 @ 5:21am 
That's not a message I'm familiar with. Are you trying to do fancy stuff like delta animations? Post your QC please.
Hezus Aug 6, 2017 @ 8:16am 
Really appreciate your time to help me with this!


Here's the QC:

$modelname "dome\dome.mdl"
$cdmaterials "models\dome"
$scale 500.0
$surfaceprop "metal"
$body "Body" "pivot.smd"
$body "Body1" "high.smd"
$body "Body2" "low.smd"
$body "Body3" "main.smd"
$sequence "open" "anims\open.smd" fps 30
$collisionmodel "low.smd"
{
$mass 40
}

I've also tried to compile with DMX, but that creates the same results.
Artfunkel Aug 6, 2017 @ 11:50am 
Try grouping your Blender meshes so that they export to one file.
Hezus Aug 6, 2017 @ 12:06pm 
I doubt that would help, since the mesh without any animations doesn't do the 90 degree turn. It's fine with the different groups as long as I don't include any animations.

Turning them all into 1 group would then force me to animate the model by vertexes, right?
Hezus Aug 7, 2017 @ 1:37am 
I've been digging a bit deeper. Here's part of the actual animation SMD:

version 1
nodes
0 "blender_implicit" -1
1 "Bone" -1
end
skeleton
time 0
0 0 0 0 0 0 0
1 0.000000 0.000000 0.000000 1.570796 -0.000000 0.000000
time 1
0 0 0 0 0 0 0
1 0.000000 0.000000 0.000000 1.570796 -0.000000 0.000000
time 2
0 0 0 0 0 0 0
1 0.000000 0.000000 0.000000 1.567642 -0.000000 0.000000
..
up to frame 30:
time 30
0 0 0 0 0 0 0
1 0.000000 0.000000 0.000000 0.364866 -0.000000 0.000000

Here's the syntax from Valve:
<int|bone ID> <float|PosX PosY PosZ> <float|RotX RotY RotZ>

So, as you can see, it rotates along the X-axis (as it should, same in Blender). But nowhere it's specifying the initial rotated position. I guess that rules out the problem of the animation itself and that should lead me to the positions of the bones. I'm going to dig into that some more, to see if I can find that rotation parameter somewhere.



Hezus Aug 7, 2017 @ 3:37am 
Alright, I've found a way to do it. Let me just put this here for reference, so in case someone has the same problem:

It seems that the StudioMDL is turning animations to 90 degrees by default and I had no way of changing that whatsoever.

So I created an amature (skeleton) with 2 bones. Bone2 is my pivot point of the dome, so I need that to be at the origin of the mesh (0,0,0). Bone1 was placed somewhere straight under the origin of the mesh. I parented the static parts of the mesh to Bone1 and the moving parts to Bone2*. In this .blend file I created the idle animation (action is named 'idle). I created a keyframe1 with LocRot (that's what the SMD exports it to) and a keyframe 30. Then export the animation and the meshes to SMD.

I find the NLA-editor a very rigid tool and I couldn't get it to have multiple actions within one armature, so I just saved it to a seperate Blender file and animated bone 2 there. I named that action 'open' and exported just that (no need to export the meshes again).

So, now the model and it's animations are back in line with eachother. I still find it quite odd why StudioMDL sets 90 degrees rotation on default.. hopefully someone can shed some light on that.


*according the the first instruction (Bone Parent) here:
https://developer.valvesoftware.com/wiki/Animation_in_Blender

Hezus Aug 7, 2017 @ 7:03am 
Another strange thing I've encountered:

Make sure your animation is on keyframe 1 before you export to SMD. If you export it while having the last keyframe on the screen, the animation will start from that position.

Artfunkel Aug 7, 2017 @ 11:39am 
Originally posted by Hezus:
Turning them all into 1 group would then force me to animate the model by vertexes, right?
No. If someone told you that, they are wrong. You can continue to animate bones after grouping the meshes.

The solution you've come up with is an overcomplicated way to achieve the same effect as grouping.
Hezus Aug 8, 2017 @ 5:01am 
So what happens exactly when you group the meshes? Does it export it as one mesh?

Do you know a way how to have multple actions in Blender for one armature?
Artfunkel Aug 8, 2017 @ 9:24am 
Yes, it's one SMD or DMX file. Why don't you just try it and see?

Multiple actions for one Armature is fully supported but the UI for it is very awkward. I added a selection widget to make switching easier to Scene Properties > Source Engine Exportables.
< >
Showing 1-12 of 12 comments
Per page: 1530 50

All Discussions > Help > Topic Details
Date Posted: Aug 4, 2017 @ 7:19am
Posts: 12