More animation controls
tracked
sprightlysprite Resident
I propose the following API:
key llStartAnimationOptions(string animation, list options);
key llStartObjectAnimationOptions(string animation, list options);
Params:
animation: The name of the animation to start
options: An option list, in the same style as llSetPrimitiveParams and other such functions.
Return value:
A key which can be passed to llStopAnimation to cancel the animation. When animations are started in this way, they are not uniquely identified by their name in the way that traditional animations are. There can even be multiple copies of the same animation running. So this key is needed toi identify an instance of the animation.
Options:
[ANIMATION_RATE, float rate]: A multiplier applied to the rate of the animation, so 2.0 plays at double speed, and 0.5 plays at half speed.
[ANIMATION_OFFSET, vector offset]: Offset the root position of the animation by the given vector. Defaults to 0.
[ANIMATION_SCALE, vector, scale]: Scales the root position of the animation by the given vector. Defaults to 0.
[ANIMATION_PRIORITY, integer priority]: The priority of the animation. If not specified, defaults to the priority set at upload time.
[ANIMATION_LOOP, integer loop]: If TRUE, the animation is looped. If FALSE, not. If not specified, defaults to the setting at upload.
... ditto for overriding other upload options.
JUSTIFICATION:
It is currently very difficult or impossible to use off the shelf animations purchased from other creators in scripted objects. The relative timing between animations has to be just right. The scale of the animation has to match the size of the object, meaning creators often have to resize their objects to match the animation rather than their own vision, and it's impossible to make an animated object resizable without screwing up the animations. When layering animations, you have to just hope the creators uploaded them with the right relative priorities, but you always get that one creator who decided that if you're catching a ball you legs should be exactly in this position at the max priority, so the avatar stands up awkwardly when the catch anim is played, and so on.
These options are intended to return some control over how an animation is used to the user of that animation, so that it can be adjusted to match a build.
Of the upload options that can be overridden, the most important are the priority (to layer animations reliably) and the in percent or frame. The latter can be used for all sorts of interesting tasks, like resynchronizing animations in the middlke of playback by restarting them with a different input frame; or selecting just portions of longer animations to use in specific contexts.
Log In
Sterling Ronzoni
There should also be an "all animations pause" and a "all animations resume" command. with the former pausing all but the lowest priority, default animations, in order to keep randomly running animations from interfering with a newly run animation.
For example, you "sit" to push a lawnmower, but at times some previously running animation can combine with the pushing lawnmower animation, corrupting the motion.
Upon "standing", the "all animations resume" command kicks in.
The purpose of this is so one will not have to disable their AO manually in order to correctly run a new animation.
Jasdac Stockholm
Maybe also ANIMATION_FLIP_X, that way we don't have to upload two separate animations for left/right handed actions etc.
Also ANIMATION_RATE should allow a negative rate to play it backwards.
Kyle Linden
tracked
Jasdac Stockholm
An additional suggestion:
ANIMATION_DURATION, float duration : stops the animation after duration seconds
WolfGang Senizen
Your suggestion for ANIMATION_SCALE
Is probably better to default to
<1,1,1>, 1
rather than 0 no?Rohacan Hirons
Hi, I suggest adding an ANIMATION_START_TIME parameter to allow the viewer to adjust the current frame to match the actual start of the animation. This would help address lag and download time issues when the animation is not already cached. This parameter could be used to synchronize animations across multiple animated objects or avatars, ensuring they play in unison
sprightlysprite Resident
Rohacan Hirons Yes, that makes sense. I had thought overriding the start frame could be sufficient, but you're right that download time might interfere with synchronization, so something that tells the viewer explicitly what the sync reference should be is nice.