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
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!