Language: EN FR
Animate avatars from an attachment with adjustment and positionning facilities and a complete menu system
Oggy's Scripted Items
As previously stated, attachments do not provide a "sit target" that would allow precise positionning of the avatar (and thus their pose) with respect to the object. Therefore, positionning a pose or animation from an attachment has been considered as "impossible".
A workaround was found : playing a secondary pose after the first one to position and rotate the avatar as desired. This works because SL animations and poses are defined through the bvh standard, as the animation of a set of "bones". During the animation, each joint (for example, a shoulder) defines its angle around the 3 axis (X, Y and Z). Any joint which does not specify a particular angle is "ignored" by the animation, and thus may be animated by an animation that was previously playing, meaning that you can effectively "cumulate" animations (walking while waving your arms in the air, for example).
To make things clear, let's just define a bit of vocabulary :
To understand how adjustment poses work, let's underline that the "root" of a BVH animation is a special joint which defines the position and orientation of the whole avatar. This joint is identified with the avatar hip, and this is where we plug our adjustment pose: adjustment poses are just very simple 2-frame animations that move and rotate only the root joint.
Of course this in turn causes a few limitations:
This adjustment system is thus primarily designed to allow a positional visual adjustment of the avatar with respect to its own attachment, helping adapt the pose to various avatar shapes and sizes. When using this system, the final customer will be able, for each pose you defined in the configuration, to select an adjustment pose among those you have allowed in another special notecard.
As explained previously, the WearPose System is made of two distinct phases, where two different scripts are at work (WPS-Preparation and WPS-MainScript). The same is true for the adjustment procedure.
Depending on the contents of the ".adjust" notecard, adjustment for a particular pose will be one of two modes:
So the idea behind those two modes is that the standard adjustment mode is used by you, the creator, to experiement and find correct position and orientation parameters that will let you define, later on, more elaborate adjustment poses to be used as manual adjustment poses.
Adjustment poses are actually defined as one translation along the Z axis and two angles that represent rotations around the X and Y axis (as a side note, note that QAvimator has different labels for those axes, Y and Z are inverted - that's a detail). The bvh format defines other angles and offsets but they are just not relevant to our situation. You can use the "standard" adjustment mode to find out the correct values of the angles and Z-offset.
However, it was not feasible to directly support any precise combination. Therefore, standard adjustment only supports angles of 30, 45, 60, 90, 120, 135, 150, 180, 210, 225, 240, 270, 300, 315 and 330 degrees around each of the X and Y axis, but only one of them at a time. And the Z offset can go from -10 to 10, knowing that 1 unit represents approximately 12.5 centimeters in height. More details about the standard poses can be found on this page.
Although the predefined angles are quite rough in their steps and are not mixed, they are already 30, plus the 20 Z-related poses, that makes 50 poses, which is far from enough if we want a really precise positionning. You get it, this approach is very limited.
Yet, what you are really interested as a creator is probably to be able to move the avatar only on the Z (up-down) axis. Yet, as stated earlier, the adjustment pose orientation will override the primary pose orientation, so you must recreate it. This is where manual adjustment and this website kicks in.
The following procedure is of course only a suggestion. Try, experiment, and find what is best for you.
The following assumes you have configured your poses in the ".config" notecard. To enable adjustment for a specific pose, this pose must be mentionned in a new notecard, named ".adjust".
It is likely that these two angles will remain the same for all your adjustment poses (for the same primary pose) since what you really want is a vertical translation. So you should probably spend a bit of time to try to find the correct values.
To create the adjustment pose, just fill in the form on this page : Adjustment pose generator. You will get then an bvh file on your computer, which you will have to upload to SL using appropriate parameters described on the form page.
Inside this notecard, find the line where you mentionned your primary pose name earlier. On this same line, add the name of your newly uploaded adjustment pose, separated by a vertical bar. For example :
sitting|adjustment1If you need more adjustment poses for the same primary pose, just add them with vertical bar separations:
sitting|adjustment1|adjustment2If one of your adjustment poses should be equal to "no adjustment", just use a minus sign. For example:
sitting|adjustment1|-|adjustment3When you save the notecard, the WPS-Preparation script will reboot.
In this mode, only the "page up" and "page down" will then be available to select the next or previous adjustment pose you listed in the notecard.
Note that in manual adjustment mode, the first adjustment pose will be the one applied at boot time, some sort of "default adjustment".
Note that if there still exists in your configuration a primary pose that is declared as "standard adjustment", you will get a warning and adjustment will not work on that pose : standard adjustment mode is only supported by the WPS-Preparation script.
The following is an example of a ".adjust" notecard.
arm at hip|Y345|Y345_Z5|Y345_Z-5 Arms crossed|-|_rY30|_rY45|_rY60|_rY90|_rY270|_rY300|_rY315|_rY330 Sit1|_Z-5|_Z-4|_Z-3|_Z-2|_Z-8|_Z-7|_Z-6 Sit2|_Z-6|_Z-5|_Z-4|_Z-3|_Z-9|_Z-8|_Z-7 Model sit
As you can see on this example (from the demo) 5 (primary) poses are allowed to have an adjustment. 4 of them (arm at hip, Arms crossed, Sit1 and Sit2) use manual adjustment while the last one (Model sit) uses standard adjustment. This is valid for the WPS-Preparation script but will trigger a configuration warning if used with the WPS-MainScript.
If we for example look at the "Sit1" animation, notice that the "_Z-5" immediately follows the first vertical bar. This means that by default, the "Sit1" animation will be played with the "_Z-5" adjustment pose. Other allowed adjustment poses for this Sit1 are _Z-4, _Z-3, _Z-2, _Z-8, _Z-7 and _Z-6. This means that you (and the final customer) can "cycle" through this list using their "page up" and "page down" keys when the adjust mode is active.
Also note that these _Z-5 (etc.) adjustment poses are actually standard adjustment poses used in manual adjustment mode, which is perfectly allowed.
On this example, the pose "arm at hip" has more "composite" adjustment poses (obtained from the Adjustment pose generator on this site) that combine a rotation around the Y axis and a translation along the Z axis. It is also worth noticing the "-" (minus sign) is used as an adjustment pose name for the primary pose "Arms crossed". This means "no adjustment".
|©2015-2017 Oggy Fink - all rights reserved|