Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

How to Deform your Avatar - Tutorial on Deformer scripts and animations

Erluen Twin
Registered User
Join date: 26 May 2006
Posts: 23
08-03-2009 22:59
Search keywords: deform deformer change shape stretch avatar AV .bvh animation script lengthen shorten tinies tiny dragon body

Here is the info you need to make a deformation animation.

Go to this page:

https://jira.secondlife.com/browse/VWR-2242

And download the zipped .bvh files. Open them as a TEXT DOCUMENT and have a look - especially at the difference between TinyDeformForearmr and UnDeformForearmr. ("forearmr" means "right forearm";)

Please correct me if Im wrong, but heres what I know:

The things to change are at the TOP and BOTTOM of the text file. The middle stuff should not be changed.
At the top it says

>> HIERARCHY
>> ROOT rForeArm
>> {
>> OFFSET 0.000000 0.000000 0.000000 etc etc etc
>> CHANNELS 6 Xposition Ypos etc etc etc

You need to change the ROOT to whichever body joint you want to affect.
ROOT rForearm will move the right elbow joint. It actually stretches the length of the upper arm. ROOT rHand will move the wrist join and will lengthen the forearm. Try to keep this in mind not to get confused!! ;p You can't stretch the hand itself because there is no joint at the tips of the fingers - obviously.

Another way to keep it straight is to think of ROOT forearm as you grabbing the forearm with both hands and pulling it away from the body. the forearm wont stretch because your holding it, but the upper arm will stretch like rubber.

So - STEP 1: Change ROOT to the joint you want to move.
(eg ROOT rForeArm, ROOT Head, ROOT Chest) be careful of capital letters.

STEP 2:
At the bottom, youll see this:


>> }
>> MOTION
>> Frames: 2
>> Frame Time: 0.033333
>> 0.000000 43.528519 0.000000 0.000000 0.000000 0.000000 0.000000
>> -0.075000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000
>> 0
>> 0
>> 0

Now its the 2nd row of numbers you should look at.

-0.075000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000

The first 3 numbers are the x, y, z coordinates as far as I can tell.
So, the position of joint in space relative to parent joint is:

x -0.075000 (length/shorten)
y 0.000000 (to the side of AV)
z 0.000000 (forward of back of AV)

I THINK that if you decrease the x value, (make it a more negative number) the right limb will stretch. This is for the RIGHT arm and RIGHT leg only.
For the LEFT arm and leg, and you can see in the bvh files, IN-creasing the x value (more positive) will stretch the arm.

Always compare it to the UnDeform file. The unDeform files have the "normal" values for an avatar.

NORMAL values for Av:
Right side : neg value (eg -10.2 for right forearm)
Left side : pos value (eg 10.2 for right forearm)

Try to keep these straight in your head as well :)

XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
X Side note: For some reason, the left forearm has 3 lines of numbers X
X I assume the 3rd line is the one to change, since it has an X
X x value of 10.12 X
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Now, for the right arm, making it more negative than the "Normal value" will stretch it.
Since the Normal Value is -10.266 , lets change that to -60.00.

Save the file as a Deform_Right_Forearm.bvh file (not a .txt)

And go into SL.
Upload animation Deform_Right_Forearm.bvh
Find it in inventory
Play animation.

Viola - your right upper arm should be longer. about 5 times longer I think.

Stop Animation.
Your arm will still be long. There are 2 ways to Normalize it.

1 - Upload UnDeformrForearm.bvh and play it.
2 - Relog.

I have a touch start script (with llRequestPermissions of course)
which plays each animation in turn automatically. I have my deforem button, and undeform button and it works very nicely.



One hint:

To save 10Lndens on uploading 100 of test animations, when you login to SL, press CTRL SHFT G. (or is it CTRL ALT G??) to get a pulldown menu of Grids. Then choose the 2nd grid Aditi where you can beta test all your animations for free. When you find the one perfect animation, you can log into SL proper (Grid named Agni) and upload for 10 lindens.
Darien Caldwell
Registered User
Join date: 12 Oct 2006
Posts: 3,127
08-04-2009 08:45
This is a bug which LL may or may not fix in the future. (probably not, given their track record). It's pretty limited in usefulness and probably shouldn't be used for anything you intend to sell. You'll have headaches when LL fixes the bug and your items stop working.
_____________________
Talarus Luan
Ancient Archaean Dragon
Join date: 18 Mar 2006
Posts: 4,831
08-04-2009 11:49
Supposedly, with the new viewer, you can't upload deformed animations anymore. Dunno if that actually made it in or not. I know that JIRA was meant to put a halt to that change and get LL to officially support deformations as an unintended "feature".
Void Singer
Int vSelf = Sing(void);
Join date: 24 Sep 2005
Posts: 6,973
08-04-2009 12:56
I'd prefer they left it alone, or put an undeformer into the "stop all animations" but that's just mee... if seen some creative uses of this.
_____________________
|
| . "Cat-Like Typing Detected"
| . This post may contain errors in logic, spelling, and
| . grammar known to the SL populace to cause confusion
|
| - Please Use PHP tags when posting scripts/code, Thanks.
| - Can't See PHP or URL Tags Correctly? Check Out This Link...
| -
Talarus Luan
Ancient Archaean Dragon
Join date: 18 Mar 2006
Posts: 4,831
08-04-2009 13:04
Well, like everything else in SL, there's a lot of cool things done with "hacks" because LL can't bring itself to give us the proper tools to do this stuff normally, for whatever "fear" they have to excuse not doing it. MegaPrims, TeleportAgent/Object, customizable meshes/avatars, etc.

If it were me, as soon as someone figured out a hack to do something cool, I would put programmers on projects to legitimize/support functionality quickly so everyone could benefit without having to support nasty, broken hacks from then on. However, that's just me.

Personally, I abhor having to use hacks. However, I would rather use them than not have the functionality/utility.