This full permission script is intended for use with the exported file data produced by Bento Buddy but there's no reason that you can't rename your animation assets to take advantage of this offering in order to have a single data entity that entirely describes your animation and its details, such as total time, frames per second, loop enabled (yes/no), loop start and stop point, ease in and out points and base priority.
You'll find a script in this package, along with an example animation, that will allow you to easily extract the formatted details from the animation name that was produced by Bento Buddy when "Export Anim Details" was enabled.
-
I've added a feature to the animation exporter that appends details to the file name. When an animation file is uploaded to Second Life the base filename is used as the asset name, which will contain these same details. A filename may look something like this...
animation#T59.79 F24.0 L0 I0.0 O0.5 E0.82 Z0.82 P4#.anim
The elements to parse are always at the end, enclosed within hash marks (#). I have taken some care to make this as easy as possible without exceeding projected limits.
Note that, although some may believe that "total frames" are a thing to know about there is no such thing in Second Life and Bento Buddy allows you to have fractional frames, something other exporters don't do. Additionally there's an advanced feature in Bento Buddy to allow fractional seconds directly, when addressing a loop, another thing that other exporters don't provide.
The information below can be used to parse the data segment.
T - Total animation time
F - Frames per second
L - Loop enabled (0 = disabled, 1 = enabled)
I - Loop in point, fractional seconds
O - Loop out point, fractional seconds
E - Ease in duration, fractional seconds
Z - Ease out duration, fraction seconds
P - Priority, 0 to 6, the script sets this to 7 so you know if it changed.
The initial values are set to 10000 and a variable called MAX has been set to 9999 so you can
test if a variable was filled by asking if(TM > MAX) { llOwnerSay("TM was not available"); }
Geek Notes:
In order to express this with as much information as we know, and the best accuracy we have, I have to do it using the more versatile, and superior, data layout that is the SL anim file content. BVH is another matter and is widely used and easy to get information about. The way SL filters BVH data is another matter and, while it is useful for most things, stringing animations together using BVH can be a chore so we use anim whenever possible and BVH only for a rough preview.
An animation is made up of motion data and time. For Second Life the time for a particular motion is fractional seconds, not frames. There are no actual frames but, rather, segments of things to happen and how long it takes for those things to complete.
At the start of an animation there is zero motion so everything is zero... actually it's not a 0 number but that's a different avenue for another topic.
Let's say I want a bone to rotate to a 90 degrees actual on the x axis. I say actual because that's how the data is represented, not as a "rotation". I tell it where the bone is, where it is supposed to go and now long it takes to do it. This is two sets of data, a start and a target. While you may consider this to be two frames it is not, it is just data that has no functional equivalent to frames. It's a motion then how long, then another motion and how long, the "how long" can be the entire range or a fraction thereof, and frames are not structured this way. The idea of a frame is a thing for 3d applications to utilize with respect to the user and has no functional value otherwise. If you need to have an idea of frames you can divide the entire time by fps and get the only thing that can even come close to it, which is useless.
There is no direct interpolation performed on animations, everything is linear in SL. In order to make a smooth, visually interpolated animation, we define segments of time and motion that have a somewhat smooth visual continuity. Bento Buddy does this by cleaning up any data that cannot be seen easily and allowing everything else to pass through, giving you the best accuracy possible with the lowest data size.
- Full permission
- Variable asigments ready for you
- Detailed description and sensible function layout
- Modular
- Works perfectly with Bento Buddy's file export details