Hi,
All the prims we are using on this build are sculpties so they all will be will be zero aligned, the build is made to be worn by avis and I thought it could be helpful for the user to be able to adjust it depending on their own avi proportions.
This is my idea, using the http://wiki.secondlife.com/wiki/Linkset_resizer_with_menu as a template, but im lost on how to make the script aware when you change from different axis, the previous resizing get lost...
resizeObject(float scale)
{
integer link_qty = llGetNumberOfPrims();
integer link_idx;
vector new_size;
vector new_pos;
if (link_qty > 1)
{
//link numbering in linksets starts with 1
for (link_idx=1; link_idx <= link_qty; link_idx++)
{
link_scale_a = llList2Vector(llGetLinkPrimitiveParams(link_idx,[PRIM_SIZE]),0);
new_size = llList2Vector(link_scales, link_idx-1);
new_pos = llList2Vector(link_positions, link_idx-1);
// new_size = scale * llList2Vector(link_scales, link_idx-1);
// new_pos = scale * llList2Vector(link_positions, link_idx-1);
if (axis == "x")
{
new_size.x = new_size.x * scale;
new_pos.x = new_pos.x * scale;
}
if (axis == "y")
{
new_size.y = new_size.y * scale;
new_pos.y = new_pos.y * scale;
}
if (axis == "z")
{
new_size.z = new_size.z * scale;
new_pos.z = new_pos.z * scale;
}
if (axis == "all")
{
new_size = scale * llList2Vector(link_scales, link_idx-1);
new_pos = scale * llList2Vector(link_positions, link_idx-1);
}
if (link_idx == 1)
{
//because we don't really want to move the root prim as it moves the whole object
llSetLinkPrimitiveParamsFast(link_idx, [PRIM_SIZE, new_size]);
}
else
{
llSetLinkPrimitiveParamsFast(link_idx, [PRIM_SIZE, new_size, PRIM_POSITION, new_pos]);
}
}
}
}