Monkanim: new animation system in the works

Thank you @nehon
I am going to update.

So while we are on this topic,

@nehon can you please confirm if rig.setLocalTranslation(); is working !?
Transforming the rig object directly has no effect, but transforming the parent works fine. (I hope this is not a mistake of mine)

also when I create a clone of rig object, changing animation on it will also change it on the clone.

I am using the latest commit.

Mhh you’re right about the setLocalTranslation.It seems there is a spatialTrack in all the animations that moves the model to 0,0,0 on each frame.
Maybe a side effect of xbuf import or I did shit with my model in blender, that’s definitely annoying. I’m going to investigate. Do you have the same issue with your own models?
In any case it’s an issue with the model, not the system.

About the clone, well, yes. The triggers are the same so whenever the condition is met the event is fired on both the models.

Hmm - I’ve tried monkanim and had a look at its source to look for the best way to include the locomotion system i’ve protyped in it. But so far I am not certain where is the best way to include it. I am thinking of implementing the Anim interface to have a single “locomotion” animation which internally takes care about selecting the right walking animation, foot positions and doing the IK stuff for the calculated foot positions. But this would limit the functionality of the locomotion system, because its also capable of putting the legs to the right positions for non-walking animations. This means if you play e.g. a dance animation while standing on some steps it takes care about putting the foots on the right step…

So maybe it would be better to put the foot placement/IK stuff on a higher level like AnimState to make it accessible for all animations. But so far I couldn’t find any good hook, means without changing monkanim source. And then I have the “problem” that I need to make some statistics for the animation as a prerequisite for the foot placement - and for this I also could not find a good way to hook into the system.

I know this all must be confusing to read because you don’t have many details on what I am trying to do. Nevertheless, any ideas?

Yes.
I think it happens after switching AnimControl with AnimationManager. Because It works fine in regular case. (Without using Monkanim)

I will investigate further on this.

1 Like

IMO any IK stuff should be a separate control. The AnimationManager handles the anim chaining and layers and stuff, then the IK/locomotion control adjusts bone positions, then the skeletong control applies it to the mesh (HW or software).
So to sum it up, it should be a separated control.

1 Like

And thank you both for your interest :wink:

2 Likes

I am also thinking a separate control for the IK stuff would be best, but it needs a lot of information about the animations. E.g. on some animations you want to have IK (dance, idle, run, walk, …) and on some you don’t want to have it (like flying, jumping, falling, …). And this ofc also depends on which animation is currently playing, with which weight (transition between jumping and walking might mean only 0.5 of the IK placement should be applied).

Edit: And also the masks ofc

Do you think to set all the additional information up in the IK control and then observe the events of mokanim would be the best integration?

IMO it’s ok if controls are interdependent, AnimControl and SkeletonControl are highly dependent today. So the LocomotionControl (or w/e its name) can be dependent on the AnimationManager, even having a reference to it to access data.
Consider it as an addon to the AnimationManager. AnimationManager can work without it, but not the other way around.

Ok, then I will start using this approach. Btw, I think I will also create a separate control that sets the animation speed according to the step size of the animation and the current speed (movement in worldspace, scaled to local space) of the spatial.

Don’t know how long it takes for the first prototype, but I will let you know as soon there is something to see;)

Btw - I am excited that thanks to monkanim I am finally able to refactor this to reasonable architecture. I would love to get started right away, but first I need to do a little bit of paid work :wink:

Thanks for all the effort you are putting into JME - really appreciate it!

1 Like

I don’t know if it has been answered already but you mention that you can select effected bones by their layers. However what is when layers overlap?

Is it possible to have a crouch and a walk animation and then the character would (ugly) walk crouched? I don’t know how one would combine the rotations though, maybe just applying them from the top to the bottom layer might be enough?

The higher layer takes precedence over the lower layer.

1 Like

@Nehon: Would it be possible to have also a T-Pose animation for the puppet model?

mhh you mean a state that resets to the t-pose?

yes - I assume the binding position should do it, because I assume this is a t-pose

yeah that’s more when you’d disable the control. Do you specifically need it as a state?

No, you are right - disabling the control should to the “trick” as well! thx!

Btw - I have the requirement to have a specific order for the controlUpdate:

  1. Calculate the velocity of the attached spatial → Alignment Tracker Control
  2. Update the MonkAnim animations → AnimationManager
  3. Do the ray tracing and IK Stuff → IK Control
  4. Transfer the bone rotations to the corresponding buffers → SkeletonControl but I think its in the render method to ensure that this is called last

I think the order would be right, if I am just adding them in the right order - do you have a better idea/pattern how this should be done. I mean, I could also do a separate AppState that calls specific methods, but I don’t know if this is “better”. What do you think?

Note that right now it might not do this, but yeah sounds like a reasonable thing to implement.

O[quote=“nehon, post:60, topic:36359”]
Note that right now it might not do this, but yeah sounds like a reasonable thing to implement.
[/quote]
Ok, then until then I can also manually set to the binding position - no problem at all;)