Animation Hooks (Controller based events)

Has anybody made some efforts to get Controller based events?

Such that artists can tag specific keyframes in their animations as “hooks”, which, when passed, send events to all HookListeners (or whatever you’d call them) currently registered with the Controller… I would like to know if somebody has any experience in adding this kind of stuff to jME. I would really like to have stuff like that, that way you could e.g. play footstep sounds based on model animation and all that…

If nobody has tried before, I would have a try at it, and would appreciate some thoughts on how this should be done (as a Controller, obviously, but does the Event/Listener model appeal you, or should this be done entirely different?)

That’s on the todo list for my new model animation system - I’ve got events for animation starting and ending finished, but not for events at a particular frame/time yet. Hopefully I’ll have time to work on that in the next couple of weeks.

Great, that’s good to hear. Is your new animation system dealing with jointmeshes only, or does it handle morph targets as well? And what about Spatial animation (SpatialTransformer style)? Is this covered? I am currently trying to implement the missing functionality in SpatialTransformer, and was just thinking if there would a standard way of doing this stuff, I might just add events as well. Maybe someone could do some Interfaces for e.g AnimationEvent, AnimationListener, and either put some abstract methods in Controller, or provide a new abstract EventSendController (or whatever better name someone might find for that). What do you think?

Currently my model code just copes with animation of models from MD5 (doom3) animation files. SpatialTransformer (as far as I know) just transforms the position/orientation of a model, so you can use both together. I haven’t thought about morphing, if you were using models with a skeleton they’d need to have the same skeleton to be able to properly morph between the two.

I like the idea of having the root Controller able to have event listeners added to it - the events that can be fired would depend on the controller type. As long as there is some kind of getType() and possibly getUserObject() method in the root ControllerEvent.

My model/animation code isn’t going to be finished (or even in a stable state, probably) by the 0.9 release, and with the new packaging system the old controllers will be available for anyone who wants to use them - my model system will simply be another option.