Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Direct access to sculpt textures: llSetSculptTexture() / llGetSculptTexture()

Creem Pye
Registered User
Join date: 16 Apr 2007
Posts: 34
08-03-2007 13:08
Right now the only way to change a sculptie's texture is by using the following command:
llSetPrimitiveParams([PRIM_TYPE, PRIM_TYPE_SCULPT, "sculpt map uuid", PRIM_SCULPT_TYPE_SPHERE]);

This method works for basic sculpt texture changing, but it has the disadvantage of unseating all avatars on the object. Since changing a sculptie's texture is a purely cosmetic operation (there is no physical change), I think it's unnecessary to unseat all avatars. Therefore, I propose the following 2 additions to LSL:

llSetSculptTexture(key uuid) :
to change the sculpt texture of a sculpted object. This should result in an error if the object isn't PRIM_TYPE_SCULPT or if uuid isn't a texture. Because changing a sculptie's texture is purely cosmetic, calling this function should _not_ unseat any avatars sitting on the object.

key llGetSculptTexture() :
to access the sculpt texture of a sculpt. Note that this function would be similar to llGetPrimitiveParams([PRIM_TYPE]), except that it would only return the texture UUID and not the type of sculptie. Also, I believe this function should have 0 delay, since it's very similar to llGetTexture() in terms of server load.
Darien Caldwell
Registered User
Join date: 12 Oct 2006
Posts: 3,127
08-03-2007 13:17
I have to disagree with the assertion that changing the sculpt texture is purely cosmetic. The maps can change the size and shape of the object, and it's corresponding collision sphere. It's more akin to a change in size of any prim. And it's always been the case you can't resize a prim that is sat on.

As for the llGetSculptTexture() function, it would be nice. But LL has a long standing history of omitting any kind of 'Get' function, which I have concluded is to combat IP theft.
_____________________
Creem Pye
Registered User
Join date: 16 Apr 2007
Posts: 34
08-03-2007 13:50
Darien, I disagree with you on both of your points.

First of all, changing a prim's sculpt texture does not affect the physics at all. For all the sculpties currently supported (PRIM_SCULPT_TYPE_SPHERE), the bounding boxes are equal to spheres of the same scale. The server treats these sculpties as spheres and completely disregards the sculpt texture map when doing physics.

Secondly, llSetScale() absolutely doesn't unsit an avatar sitting on a prim. Try it yourself: rez a sphere, put this script in it, sit on the sphere, and then touch it. Your avatar will remain seated on the sphere, despite the sphere doubling in size.
####
default
{
state_entry(){ llSitTarget(<0,0,0.1>,ZERO_ROTATION);}
touch_start(integer total_number){ llSetScale(<1,1,1>;); }
}
####

The only time that llSetScale() does not work is when the object is physical (regardless of whether somebody's sitting on it).

Also, about llGetSculptTexture() and IP theft, it should behave just like llGetTexture(), returning NULL_KEY when the owner doesn't have full permissions on the object.
Darien Caldwell
Registered User
Join date: 12 Oct 2006
Posts: 3,127
08-03-2007 15:22
Well I don't know about using llSetScale, but I do know you can't resize a prim that's sat on with the editing tools. This is what I was basing my information on. As for the Get, the restriction you mention would make it just as useless as llGetTexture is, so then what would be the point of having it?
_____________________
Creem Pye
Registered User
Join date: 16 Apr 2007
Posts: 34
08-03-2007 16:23
>> Well I don't know about using llSetScale, but I do know you can't resize a prim that's sat on with the editing tools.

Er, yes you can. Try sitting on a prim and then adjust the scale numbers by either typing in a number or pressing down on the arrows to scale it gradually. Position, rotation, and scale editing won't even unseat your avatar (just like when you make the same adjustments using LSL functions).


>> As for the Get, the restriction you mention would make it just as useless as llGetTexture is, so then what would be the point of having it?

I suggested it mostly just for feature-completeness, even if it doesn't work on objects that you don't have rights to. That said, llGetSculptTexture could be handy for objects that don't have restrictive permissions.