Updating Animation Duration with Configuration Parameters
AnsweredHi,
I have the ability to change properties of nodes using my own configuration parameters, but I was wondering if it is possible to change the duration of a keyframe animation in the same way. I would imagine if it is, you would have to change the specific nodes of the animation, so if there are 3 different nodes moving from start to finish, they would all need to have their "Time" changed to increase the length of the animation.
Please do let me know if this is something that is possible.
Thanks,
Mason
-
Official comment
Hi Mason,
Please correct me if I am answering your question incorrectly;
Yes you can adjust the "Time" of an animation and have this unique to different nodes using the same animation. The property you are looking for is called "Duration Scale". This property adjusts how long an animation will take to play. Values above 1, will increase the duration, and values below 1 will decrease the duration.
You can find more information here:
https://docs.kanzi.com/3.9.13/en/working-with/animations/triggering-animations-with-the-play-animation-action.html#controlling-keyframe-animations -
That's what I was looking for, just completely missed it. But how would I go about assigning it's value using, say, an activity property or something similar or is this not possible? I am wanting to adjust the duration of an animation outside of Kanzi Studio.
0 -
Hi Mason,
Yes it is possible to modify the duration scale outside of Kanzi.
You will need to use the Kanzi API to adjust this timing in code, but it can be done.
https://docs.kanzi.com/3.9.13/en/reference/kanzi-lua-api/class/AnimationPlayerMetadata.html#AnimationPlayerMetadata.PlayMessageArguments.DurationScaleProperty0
Please sign in to leave a comment.
Comments
3 comments