STEAM 组
Blender Source Tools BleST
STEAM 组
Blender Source Tools BleST
468
游戏中
2,543
在线
成立于
2013 年 11 月 8 日
所有讨论 > Help > 主题详情
Hezus 2017 年 8 月 4 日 上午 7:19
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?
最后由 Hezus 编辑于; 2017 年 8 月 5 日 上午 12:30
< >
正在显示第 1 - 12 条,共 12 条留言
Artfunkel 2017 年 8 月 4 日 上午 10:30 
Your links are broken.
Hezus 2017 年 8 月 5 日 上午 12:30 
引用自 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..
最后由 Hezus 编辑于; 2017 年 8 月 5 日 上午 2:46
Artfunkel 2017 年 8 月 5 日 上午 5:21 
That's not a message I'm familiar with. Are you trying to do fancy stuff like delta animations? Post your QC please.
Hezus 2017 年 8 月 6 日 上午 8:16 
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 2017 年 8 月 6 日 上午 11:50 
Try grouping your Blender meshes so that they export to one file.
Hezus 2017 年 8 月 6 日 下午 12:06 
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 2017 年 8 月 7 日 上午 1:37 
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 2017 年 8 月 7 日 上午 3:37 
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 2017 年 8 月 7 日 上午 7:03 
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 2017 年 8 月 7 日 上午 11:39 
引用自 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 2017 年 8 月 8 日 上午 5:01 
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 2017 年 8 月 8 日 上午 9:24 
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.
< >
正在显示第 1 - 12 条,共 12 条留言
每页显示数: 1530 50

所有讨论 > Help > 主题详情
发帖日期: 2017 年 8 月 4 日 上午 7:19
回复数: 12