|
Shegl, Sr. Member
Posted: 22 July 2012 10:35 PM Total Posts: 134
There was no BlendSkeletonAnimator in gold pack as we know.
So I don’t know exactly will be native support of blending 2 anims in 1 time (walk + any).
So I find my own way to achieve it. But did it in way Creation of Extended class SkeletonAnimator with hard modifing SkeletonAnimationState and reworking function (localToGlobalPose).
So I made what 2 active states playing in one time. And global pose combining from 2 arrays of jointPoses of activated nodes. Half from first state, and another half from second SkeletonPose. (Top and Bottom of skeleton).
In my way I need for each skeleton_set build my own blendingTree to switch right joints. And this joints are switching all the time on enterframe when secondary animation is playing.
Is where a bit better way to do the same as in attachment?
P.S. This hellknight model have 110 joints and animation playing only on CPU so we can see perfomance problems when use my method.
File Attachments
|
Richard Olsson, Administrator
Posted: 23 July 2012 08:49 AM Total Posts: 1192
[ # 1 ]
The “right” way to do this is to create an ISkeletonAnimationNode implementation that masks and blends two other nodes together (e.g. two clip nodes that play different clips.) There is already a blend node that interpolates between two nodes, and one that “adds” the difference of a node from the bind pose on top of another node. The latter, if the object is animated with this in mind, could be used for essentially what you’re describing. But a masking node would be a welcome addition if you want to implement it!
With this new system (that was actually always there, just not as easily accessible), there is no need for a special animator for this type of functionality.
|
Shegl, Sr. Member
Posted: 23 July 2012 12:01 PM Total Posts: 134
[ # 2 ]
Richard your way I did in first try, and this is not optimal and looks not good, cause you just cant switch blending if you running and make Hit anim then u stop and u need to reblend in new node what it’s hitting + stoping and then play idle animation..
In my implementation you just:
animator = new BlendSkeletonAnimator( anim_set, skeleton, jointsBlend);
The animation state have not just looping, but blendAnim:Boolean and blendingAnim:Boolean
animator.play(currentAnim,stateTransition); (which can be blending or not)
and animator.playAddative(attackAnim, stateTransition); (if currentAnim is blendingAnim== true, attackAnim blend with current Anim, if not playing full attackAnim)
But if currently playing Idle anim which have flag blendingAnim = false and playing full attackAnim, and you start walk forward (walkingAnim have blendingAnim = true) you continiue hitting and start walking..
Uh… just look the attachment… it’s cant be done with existing BlendNode.
|
Richard Olsson, Administrator
Posted: 23 July 2012 12:09 PM Total Posts: 1192
[ # 3 ]
I didn’t say it can be done with the current blend node, but only that it should probably be implemented using the node system, by creating a new (masking) node.
Are you saying that with your solution you actually have two animators running simultaneously? Maybe you could upload an example to http://gist.github.com or something else that is as easy to read where we don’t have to download a rar?
|
Shegl, Sr. Member
Posted: 23 July 2012 12:17 PM Total Posts: 134
[ # 4 ]
Richard currently i have open only 80 web port.. cant use https and also github..
No it’s only one animator which have from 1 to many active nodes to play.. and on render he combine them in output pose.
File Attachments
|
Richard Olsson, Administrator
Posted: 23 July 2012 12:21 PM Total Posts: 1192
[ # 5 ]
Ok, try pastebin.com then, which shouldn’t require SSL. I’d just like to see a short, to-the-point example of how you’re using your custom animator, to be able to assess whether it’s something that could be solved within the existing framework, without the need to have another animator type.
|
Shegl, Sr. Member
Posted: 23 July 2012 12:51 PM Total Posts: 134
[ # 6 ]
Ok here the main thing after reading wich you understand my way http://pastebin.com/yFue0Y20 ..
The overrided SkeletonAnimator now just control not one activeState but _blendState as also control stateTransition beetween activeStates and blendStates.. It was a bit harded when looks first time.
|
Richard Olsson, Administrator
Posted: 23 July 2012 01:06 PM Total Posts: 1192
[ # 7 ]
We have been discussing this in the team, and we still feel that this is something that should be solved using the node system. With your approach, the animator still only supports two animations on top of each other, whereas using a node approach it could be Nary, i.e. support any number.
The one shortcoming that the node approach currently has is that when you switch states, all nodes will be reset, meaning that if you play a hit animation while walking, and then start running, the hit animation will also be reset (or stopped, depending on your node set-up.)
We’re thinking about ways to solve this, the easiest perhaps being to not reset nodes that are shared across states when switching between those states. This would allow you to have base states like “run”, “walk”, “crouch” et c, and then have shared clip nodes that play on top of these for hitting, taunting et c.
|
Shegl, Sr. Member
Posted: 23 July 2012 01:16 PM Total Posts: 134
[ # 8 ]
Thanx Richard what u intresting in solving this thing with this blend nodes. Also wanna tell you what jointMergeArray have not only 2 animations he can store up to +Infinity setups of animations blending with each other of blending anims and depend on wich joints must be blended. But you right. It will be able only blend blending anims. So it will be always Bledning anim + Blended+Blended… n*Blended times Blend anim.
(Blending anim it’s walk and Blend anim which blend this)
|