Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Weird: same animation but different when embedded

Paulo Dielli
Symfurny Furniture
Join date: 19 Jan 2007
Posts: 780
09-28-2008 16:19
I make my own animations with Poser for my furniture. I used to use them in poseballs, but now I'm embedding the poses into pillows and cushions with Lex Neva's sit target script.

The weird thing is that the exact same animation acts differently when applied in a poseball or embedded in a pillow. For example: an arm doesn't rest nicely on the tummy anymore but is pretty much in front of it. Really strange is that I saw this in two animations, and only with the right arm! The arm also seems to move a bit at the start of the animation (only first time), as if it has to settle itself. I don't see that when I just use it in a poseball (regular sphere). Very strange.

The animation is exactly the same as the one I used in the poseball. The pillow is a sculpty. Anybody else seen this too?

[edit:] I just checked. All parts of the arm, shoulder etcetera in frame 2 are different from frame 1, so that can't be it either. So maybe sculpties do this because of their wider bounding box???
Bree Giffen
♥♣♦♠ Furrtune Hunter ♠♦♣♥
Join date: 22 Jun 2006
Posts: 2,715
09-28-2008 22:45
That's pretty weird. I've used a sit target script to embed a sit into a chair, not a sculpted one, and it worked fine. No changes to the animation. I don't see how a sculpted prim can affect an animation. All I can guess is that the pose script in the pillow is somehow different from the pose script in the poseball. I know that most poseballs turn off the default sit before they start your added sit animation. Does the pillow turn off the default sit too? Also have you checked if your AO is causing the problem?
Day Oh
Registered User
Join date: 3 Feb 2007
Posts: 1,257
09-29-2008 00:22
I have good results with this poseball script

From: someone
react()
{
key avatar = llAvatarOnSitTarget();
if(avatar != NULL_KEY)
{
llRequestPermissions(avatar, PERMISSION_TRIGGER_ANIMATION);
llSetAlpha(0.0, ALL_SIDES);
}
else
{
llSetAlpha(1.0, ALL_SIDES);
}
}

default
{
state_entry()
{
llSitTarget(<0.0, 0.0, 0.01>, ZERO_ROTATION);
react();
}

on_rez(integer param)
{
llOwnerSay((string)llGetKey());
}

changed(integer change)
{
if(change & (CHANGED_LINK | CHANGED_INVENTORY))
{
react();
}
}

run_time_permissions(integer perm)
{
key avatar = llAvatarOnSitTarget();
if((llGetPermissionsKey() == avatar) && (llGetPermissions() & PERMISSION_TRIGGER_ANIMATION))
{
string anim = llGetInventoryName(INVENTORY_ANIMATION, 0);
if(llGetInventoryType(anim) == INVENTORY_ANIMATION)
{
list anims = llGetAnimationList(avatar);
integer t = llGetListLength(anims);
if(t)
{
integer i;
do
{
llStopAnimation(llList2String(anims, i));
} while(++i < t);
}
llStartAnimation(anim);
}
}
}
}
_____________________
Paulo Dielli
Symfurny Furniture
Join date: 19 Jan 2007
Posts: 780
09-29-2008 08:01
Thanks Day, I'll try that tonight and will post the results here.

By the way, I can see very clearly that the right arm, when sitting for the first time, sort of 'shivers' (sorry, don't know the right English word). It looks like it has to find it's correct position first.

From: Bree Giffen
I know that most poseballs turn off the default sit before they start your added sit animation. Does the pillow turn off the default sit too? Also have you checked if your AO is causing the problem?
Ahh, good idea Bree. Yes, they are different scripts. And no, I didn't check if the new script turns off the default sit. Will do that too tonight and post here. Btw, I don't use an AO. Thanks!
Paulo Dielli
Symfurny Furniture
Join date: 19 Jan 2007
Posts: 780
09-29-2008 19:41
Oh Day! This really worked!!!

I have checked again tonight, first by replacing the automatically generated Lex Neva script by my old (formerly successful) script. I got the same weird offset with the arm! That surprised me, because my old script worked fine with a poseball, but not with the sculpty pillow. Very strange.

Then I used the script you posted above (changed the alpha and put in the right co-ordinates). And that WORKED!!! Oh boy, now I do NOT have to change every single animation I have! Day, you've made me very happy!

Okay, so the offet looked like this (look at the right arm). Left picture is with the Lex Neva script AND with my old script which worked fine before. On the right is the animation with Day's script, which looks like it was intended:



My old script was like this (not right co-ordinates). What was wrong with it? Oh man, when I look at it, it is way too much! It never seemed so much in the script window...

From: someone


integer hidden = FALSE; // Stores whether the object is visible
vector ROTATION = <0,0,0>; //Euler in degrees (like the edit box)

string TITLE = ""; //This text will appear in the floating title above the ball
string ANIMATION = ""; //Put the name of the pose/animation here
vector offset = <1.17,-0.12,-0.25>; // You can play with these numbers to adjust
// how far the person sits from the ball. ( <X,Y,Z> )
integer use_voice = TRUE;

string gNotecard = "poseBall.conf";
integer gLine = 0;

integer listenHandle;
integer masterswitch = TRUE;
integer visible = TRUE;
float base_alpha = 1.0;
key avatar;
key trigger;

key dataserver_key = "";
rotation rot;
integer lowest = 0x7FFFFFFF;
integer me;
string animation;

show()
{
visible = TRUE;
llSetText(TITLE, <1.0,1.0,1.0>,1.0);
llSetAlpha(base_alpha, ALL_SIDES);
}

hide()
{
visible = FALSE;
llSetText("", <1.0,1.0,1.0>,1.0);
llSetAlpha(0.0, ALL_SIDES);
}

init()
{
if(llGetInventoryType(ANIMATION) != INVENTORY_ANIMATION)
{
if(llGetInventoryNumber(INVENTORY_ANIMATION) == 0) // Make sure we actually got something to pose with.
{
llWhisper(0,"Error: No animation found. Cannot pose.";);
animation = "sit";
}
else
animation = llGetInventoryName(INVENTORY_ANIMATION, 0);
}
else
animation = ANIMATION;

if(llGetInventoryType(gNotecard) == INVENTORY_NOTECARD)
{
dataserver_key = llGetNotecardLine(gNotecard, gLine = 0);
}
else //If we are here no configuration notecard was found... lets use the defaults.
{
llSetSitText(TITLE);
if(visible)
show();
else
hide();
}
}

default
{
state_entry()
{
llSetText("Starting up", <1.0,1.0,1.0>, 1.0);
rot = llEuler2Rot(ROTATION * DEG_TO_RAD);
llSitTarget(offset, rot);
if(use_voice)
listenHandle = llListen(1, "", "", "";);
me = llGetLinkNumber();
init();
}

link_message(integer sender_num, integer num, string str, key id)
{
if(num == 99)
{
if(str == "hide";)
{
masterswitch = FALSE;
hide();
}
else if(str == "show";)
{
masterswitch = TRUE;
if(llKey2Name(trigger) == "";)
show();
}
if(use_voice)
{
if(lowest > sender_num)
{//only adjust if it is lower then lowest.
lowest = sender_num;
if(sender_num < llGetLinkNumber())
{
llListenRemove(listenHandle);
listenHandle = 0;
}
else if(!listenHandle)
{
listenHandle = llListen(1, "", "", "";);
llMessageLinked(LINK_ALL_OTHERS, num, "", id);
}
}
}
}
}

touch_start(integer total_number)
{
if(hidden)
{
hidden = FALSE;
llSetAlpha(1.0, ALL_SIDES);
llSetText("", <1,1,1>, 1.0);
}
else
{
hidden = TRUE;
llSetAlpha(0.0, ALL_SIDES);
llSetText("", <0,0,0>, 1.0);
}
}

changed(integer change)
{
if(change & CHANGED_LINK)
{
avatar = llAvatarOnSitTarget();
if(llKey2Name(avatar))
{
if(trigger != avatar)
llRequestPermissions(avatar, PERMISSION_TRIGGER_ANIMATION);
hide();
}
else if(trigger)
{
if(trigger == llGetPermissionsKey())//right user?
if(llGetPermissions() & PERMISSION_TRIGGER_ANIMATION)//got permissions?
if(llKey2Name(trigger)) //user in the sim? modern permision system makes this last check unnecessary.
llStopAnimation(animation);
if(masterswitch)
show();
trigger = "";
}
else if(use_voice)
{
change = llGetLinkNumber();
if(change != me)
{
if(me < change)
{
lowest += change - me;
if(listenHandle)
llMessageLinked(LINK_ALL_OTHERS, 99, "", "";);
}
else
{
if(!listenHandle)
listenHandle = llListen(1, "", "", "";);
if(change)//intended to reduce packet storm on large linksets.
llMessageLinked(LINK_ALL_CHILDREN, 99, "", "";);
}
me = change;
}
}
}
if(change & CHANGED_INVENTORY)
{
llSetText("Reloading configuration...",<1.0,1.0,1.0>,1.0);
init();
}
}

run_time_permissions(integer perm)
{
avatar = llAvatarOnSitTarget();
if(perm & PERMISSION_TRIGGER_ANIMATION && llKey2Name(avatar) != "" && avatar == llGetPermissionsKey())
{
trigger = avatar;
llStopAnimation("sit";);
llStartAnimation(animation);
if(visible == TRUE)
base_alpha = llGetAlpha(ALL_SIDES);
hide();
}
}


listen(integer channel, string name, key id, string message)
{
if(llStringLength(message) == 4)
{
message = llToLower(message);
if(message == "show";)
{
masterswitch = TRUE;
if(llKey2Name(trigger) == "";)
show();
}
else if(message == "hide";)
{
masterswitch = FALSE;
hide();
}
else
return;
llMessageLinked(LINK_ALL_OTHERS, 99, message, "";);
}
}

dataserver(key queryid, string data)
{
if(queryid == dataserver_key)
{
if(data != EOF)
{
integer command = llListFindList([";","title", "offset","rotation","voice","sit_button"], [llToLower(llList2String(llParseString2List(data, [" "], [":",";"]),0))]);
if(command > 0)
{
data = llDeleteSubString(data, 0, llSubStringIndex(data,":";));
if(command == 1)//title
{
if(llGetSubString(data, 0, 0) != " ";)
TITLE = data;
else
TITLE = llDeleteSubString(data, 0, 0);
llSetSitText(TITLE);
if(visible && masterswitch)
show();
}
else if(command == 2)//offset
{
offset = (vector)data;
if(offset); else
{
if((llSubStringIndex(data, "<";) & 0x7FFFFFFF) < llSubStringIndex(data, ">";))//could be a valid vector
offset = <0.0, 0.0, 0.01>;
else
{//definately isn't a valid vector
llSay(0,"Error: The numbers in the offset value lack the '<' and '>' signs. (Should be something like <3,1,6> )";);
offset = <0.0, 0.0, 0.5>;
}
}
rot = llEuler2Rot(ROTATION * DEG_TO_RAD);
llSitTarget(offset, rot);
}
else if(command == 3)//rotation
{
ROTATION = (vector)data;
rot = (rotation)data;
if(<rot.x,rot.y,rot.z> != ROTATION)//allows us to use raw rotations & vectors at the same time.
rot = llEuler2Rot(ROTATION * DEG_TO_RAD);
llSitTarget(offset, rot);
}
else if(command == 4)//voice
{
if(llGetSubString(data, 0, 0) == " ";)
data = llDeleteSubString(data, 0, 0);
use_voice = (llListFindList(["yes", "true", "on", "lag"], [llToLower(data)]) >= 0);
if(use_voice)
{
if(!listenHandle)
listenHandle = llListen(1, "", "", "";);
}
else
{
llListenRemove(listenHandle);
listenHandle = 0;
}
}
else if(command == 5)//sit_button
{
if(llGetSubString(data, 0, 0) != " ";)
llSetSitText(data);
else
llSetSitText(llDeleteSubString(data, 0, 0));
}
}
++gLine;
dataserver_key = llGetNotecardLine(gNotecard, gLine);
}
else
{
if(visible)
show();
else
hide();
}
}
}
}