Start a new topic

How to know what animation has finished when AR.ModelAnimation.onFinish() fires

Hi Guys,


We're building a script-driven animation sequencer. This involves lots of instantiation of objects and animations from a script file, which references the .wt3s and the embedded animations therein.


We're dependant on AR.ModelAnimation's .onFinish property firing, which we hook into to figure out what each object should do next in it's relevant script. However, the callback simply fires, and provides no visible context for what triggered the animations - as a result, we're having to wrap these in closures which bakes in an object and animation reference. This *works* but isn't ideal, because of the memory and processing overhead it incurs, not to mention the impact it has as our script gets subtler and larger.


We've tried the dirty trick of passing properties with IDs in at creation time of the AR.ModelAnimations, but Wikitude (understandable) doesn't like us doing that and rejects it.


Has anyone found a more efficient way of handling this?


Would Wikitude consider this as a useful feature for future - the ability to pass a consistent ID or marker when creating objects and animations that gets passed as  a parameter to the onFinish/onStart events?


Thanks for suggestions (or taking on the suggestions!) - we're using SDK 6.1 FYI


Dave


Thanks Eva. It absolutely is correct and as per your API documentation, but as a feature request whilst moving forward it would help eliminate a lot of closure creation when working with multiple parallel animations!


Best


Dave

Hi Dave,

As you said yourself, what you are experiencing is expected behavior. Right now we do not have any plans of implementing something like this in our next releases but should anything change I will let you know.

Thanks
Eva

 

Login or Signup to post a comment