I am using LSL (Linden Scripting Language) in Second Life. I have imported a virtual (mesh) aircraft object and spent hours animating various parts such as canopy and undercarriage.
I have now discovered that I should have imported the object to face east when all axis are set to zero (mine was facing west). I have now re-imported the object with the correct orientation, however as the main mesh object was my 'root prim' and the frames storing the positions of every animated part was relative to that, all the animated parts (child prims) are now reversed by exactly 180 degrees.
Does anyone know of a way I could parse the script data to find and automatically add a correction of 180 degrees?
I spent hours on the animations and have pages of data, so an automated solution would be extremely preferable and any help gratefully received.
A snippet of the code I need to parse is reproduced below:
link_message(integer n, integer c, string m, key id){
vector lSize = llList2Vector(llGetLinkPrimitiveParams(1,[7]),0);
if(m == lAnimName + "|0"){// Frame 0.
if(lLeg3t)
llSetLinkPrimitiveParamsFast(lLeg3t,[
33, <0.245628*lSize.x, -0.183868*lSize.y, -0.184195*lSize.z>, 29, <-0.500000, 0.000000, -0.707107, 0.500000>
]);
if(lWire3t)
llSetLinkPrimitiveParamsFast(lWire3t,[
33, <0.259854*lSize.x, -0.187642*lSize.y, -0.196354*lSize.z>, 29, <-0.500000, 0.000000, -0.707107, 0.500000>
]);
if(lWire3b)
llSetLinkPrimitiveParamsFast(lWire3b,[
33, <0.244813*lSize.x, -0.194661*lSize.y, -0.171052*lSize.z>, 29, <0.073912, -0.549525, -0.444997, 0.703233>
]);
if(lFoot3)
llSetLinkPrimitiveParamsFast(lFoot3,[
33, <0.261851*lSize.x, -0.180508*lSize.y, -0.157508*lSize.z>, 29, <-0.270598, -0.270598, -0.653282, 0.653282>
]);
if(lLeg3b)
llSetLinkPrimitiveParamsFast(lLeg3b,[
33, <0.247470*lSize.x, -0.200321*lSize.y, -0.190136*lSize.z>, 29, <0.073912, -0.549525, -0.444997, 0.703233>
]);
if(lSled3)
llSetLinkPrimitiveParamsFast(lSled3,[
33, <0.251954*lSize.x, -0.184123*lSize.y, -0.169543*lSize.z>, 29, <0.000000, 0.000000, -0.707107, 0.707107>
]);
if(lWire2t)
llSetLinkPrimitiveParamsFast(lWire2t,[
33, <0.268535*lSize.x, 0.190722*lSize.y, -0.196969*lSize.z>, 29, <-0.061628, 0.541675, -0.454520, 0.704416>
]);
if(lLeg2t)
llSetLinkPrimitiveParamsFast(lLeg2t,[
33, <0.255244*lSize.x, 0.185132*lSize.y, -0.176223*lSize.z>, 29, <-0.061628, 0.541675, -0.454520, 0.704416>
]);
if(lWire2b)
llSetLinkPrimitiveParamsFast(lWire2b,[
33, <0.237334*lSize.x, 0.180499*lSize.y, -0.159385*lSize.z>, 29, <0.517145, -0.024678, -0.706676, 0.482246>
]);