Sensations Prim Animator

    The Sensations Prim Animator is a powerful tool for saving and reloading changes to prims.

    === Important notes before you begin ===

    The Sensations Animator requires the main prim be an "anchor" prim and not be animatable. If you have an object where you want to change the main prim, please link in a new main prim before begining.

    === Tutorial ===

    To begin using the Sensations Prim Animator you usually will start by installing the three distributed scripts into the object you want to animate. Make sure your object has a descriptive name and a good default size, then touch the object and pick "New Anim" from the menu.

    To summarize the use of the 3 scripts:

    Sensations Prim Animation Data Script - One or more of these scripts need to be included to store the animation data. If this runs out of memory, drag in additional data scripts and reset.
    Sensations Prim Animation Player Script - This script handles loading the animation data from the web database or notecard and then controls the many playback options.
    Sensations Prim Animation Recorder Script - This script handles creating animations, recording new frames, or updating and deleting existing frames or animations.

    Many of the parts can function independently. For example, if you don't need to see the frames you've recorded immediately you can record with just the recorder script. Once an animation is loaded, if you don't need the player abilities (meaning that you will switch frames manually) then the player script can be removed. However it will be required if the data scripts get reset.

    === Main Menu ===

    Main Menu

    Pause/Play/Stop - Pause, play or stop the currently loaded animation.
    <</>> - Move to the previous or next frame.
    New Frame - Adds a new frame to the end of the animation using the current prims.
    New Anim - Creates a new animation ID and uses the current prims for the first frame.
    Dupe Anim - Creates a new animation ID and duplicates all of the frames from the current animation.
    Rem Frame - Removes the current frame moving all later frames back by one.
    Rem Anim - Deletes the current animation and all associated frame data from the web page.
    Help - Loads the Prim Animator web page.
    Sync Base - Updates the saved animation base size to the current size.
    WARNING: This can cause existing animations to shrink or grow when changing the base size.
    Sync Frame - Updates the currently displayed frame number with the current prim settings.

    === Recorder Modes ===

    It is important to note while recording that there are 3 modes.

    Stopped - This is the default mode. Changing frames causes the saved frame information to load.
    Playing - This mode plays the animation so it can be seen in action. Editing cannot be done in this mode.
    Paused - This mode is similar to Stopped except changing frames does not load the saved frame information.

    === Advanced Menu ===

    Main Menu

    Reset - Resets the player script causing a reload of the animation data.
    Prim List - Display all the prims in the object and their associated prim IDs.
    Loop - Change the player mode to Loop.
    Single - Change the player mode to Single pass.
    Ping Pong - Change the player mode to Ping Pong (play front to back to front etc)
    Delay # - Set the animation delay to # seconds between frames.

    === Animating ===

    After creating the new animation with the default initial frame, you can then make adjustments to the frame and click the [New Frame] button. This will create a second frame with the changes from the initial frame. Continue this process to create all the frames you want. If you need to update a frame you already created use the [Sync Frame] button to rerecord the currently selected frame.

    If at some point you need to link in more prims, link them in without changing the main prim. You can then use the [Sync Frame] button to rerecord the frames with the new prims. It is recommended that you at least sync the first frame to allow optimizations to be successful if this prim is going to change at all. It may be wise (but not required) to sync all the frames if the prim is going to change, because any frames that do not have data for a prim will just ignore that prim.

    The importance of Paused mode is the ability to copy a frame to another position. Use Stopped mode to load the desired frame, then switch to Paused mode and switch to the frame you wish to overwrite. Then click [Sync Frame] to copy the current data over the frame shown on the menu.

    The [Dupe Anim] button can be used to preserve an animation when you want to experiment with changes to the animation. Take a copy of the object, then pick [Dupe Anim] and continue editing the object with the new animation ID. The copy you took will still have the original animation ID and the one you are working on will have a new one that you can experiment with.

    === Scripting ===

    Once you have the animations created with the recorder, the next step is to write your scripts to animate when desired.

    Number String Parameter Key Parameter Description
    475 Animation ID Animation Set (optional) Load animation set into the player.
    476 Frames none Sent by player script when an animation set has been loaded.
    477 Frame Animation Set (optional) Switch to a frame in an animation set.
    479 base size none Sent by player during animation set loading with the base prim size for the animation.
    480 none none Clears the data stores of loaded animations.
    481 frame|prim(|set) <data> Sent by player during animation set loading.
    482 free memory data store Data store notification of free memory.
    483 data store number none Data store available notification.
    484 command text


    1 or 0

    1 or 0
    Loop or Ping Pong or <list>
    Send commands to the player to change its behavior.

    Enable or disable the memory announcement from the data scripts.
    Start the animation playing.
    Stop a playing animation.
    Set the delay between frame changes in seconds or partial seconds.
    Set the direction of the animation.
    Set the style of animation.
    485 none none Player will respond with with 476 (the number of loaded frames)

    Here are some example snippets for controlling the animation in your item. The first is a simple frame selection:

    llMessageLinked(LINK_THIS, 477, "2", "");

    This will load frame 2, the third frame in the animation set. With the initial player settings, to play the animation once through:

    llMessageLinked(LINK_THIS, 484, "Play", "");

    To play the animation on a loop, the loop setting must be changed:

    llMessageLinked(LINK_THIS, 484, "Loop", "Loop");
    llMessageLinked(LINK_THIS, 484, "Play", "");

    To stop a looping animation:

    llMessageLinked(LINK_THIS, 484, "Stop", "");

    Please note that after changing the loop setting, if you want it to no longer loop it must be set back to single:

    llMessageLinked(LINK_THIS, 484, "Loop", "Single");

    === Finishing up ===

    Once you have your animation recorded and your scripts written the last thing you need to decide is how to package it.

    There are online and offline modes. The Sensations prim animator keeps the animation data loaded in script memory in most cases so this is only an issue if the scripts get reset.

    === Online Mode ===
    Advantages: Faster loading of animation data. Animations can be tweaked and updated by resetting or reloading the animation.
    Disadvantages: Requires that a Sensations server connection can be made.

    To use online mode take the following steps:

    1) The animation ID is stored in the object description during recording. You can either just leave that in the description and sell the item as is or
    2) Make a note of the animation ID saved in the object description and then add this to one of your objects scripts:

        link_message(integer sender, integer num, string msg, key id)
            // Handle animation loaded response
            if(num == 476 && msg == "")
                // No animation loaded... try to load it
                llMessageLinked(LINK_THIS, 475, "1000", "");
    Replacing "1000" with the animation ID you found in the object description.
    3) Remove or change the object description

    === Offline Mode ===
    Advantages: Is completely based within SecondLife. No privacy issues.
    Disadvantages: Slower loading. Static animation data. Vulnerable to notecard database issues. May be easier to get at the animation delta data.

    To use offline mode take the following steps:

    1) If you don't have a Sensations web account follow the instructions located here:
    2) Load the following web page:
    3) Select the animation from the drop down list.
    4) Create a notecard named "Prim Anim Settings" and paste the notecard lines from the web page into it.
    5) Place the "Prim Anim Settings" notecard in the object.
    6) Remove or change the object description.