Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

I'm trying to set the texture of child links in a link set programatically

Asturkon Jua
Registered User
Join date: 19 Sep 2006
Posts: 30
11-22-2006 10:40
Hi all,

I'm trying to set the texture of child links in a link set programatically. Since there are many possible textures, i'd like to keep them all only in parent's inventory, instead of having them all in each and every child's inventory.

I got to set a child's texture calling llMessageLinked from the parent's script and getting it with link_message event from the child's receiving script. But that works ONLY if the texture is in child's inventory.

Any idea or workaround about this issue will be very welcome.

Thanks,
Pale Spectre
Registered User
Join date: 2 Sep 2005
Posts: 586
11-22-2006 10:53
Instead of relying on the presence of an actual texture, use the UUID of the texture. Using this method means the textures do not need to be present in any prim.

From the LSL Wiki - llSetTexture: "Sets the texture on side. texture can be the name of a texture in the prim's inventory, or the key of a texture. A side of ALL_SIDES sets all sides of the prim in one call."

The key (UUID) of a texture can be determined by right-clicking the texture in Inventory and doing a: Copy Asset UUID. They look similar to this: 18cfbfd6-ad39-11d5-9d21-00d0b7c730a8.
Meade Paravane
Hedgehog
Join date: 21 Nov 2006
Posts: 4,845
11-22-2006 10:53
Can't use have the root script pass the UUID of one of its textures to the child? If you have the ID, you shouldn't need to have the texture in the child inventory.. I think.
Ultralite Soleil
Registered User
Join date: 31 Aug 2006
Posts: 108
11-22-2006 13:22
From: Pale Spectre
Instead of relying on the presence of an actual texture, use the UUID of the texture. Using this method means the textures do not need to be present in any prim.

Just to clarify, the main script would just pass the texture's UUID to the child script via the llMessageLinked call. The child would just call llSetTexture with the given UUID.
Pale Spectre
Registered User
Join date: 2 Sep 2005
Posts: 586
11-22-2006 14:33
That would be one way, or the scripts in the child prims could have a list of the texture keys, and you'd pass an index value - but passing the texture key via llMessageLinked seems like a good way of keeping the child prim scripts agnostic. I've never used it but llMessageLinked does allow the passing of a key - I guess (key)string should work just as well.

I've never had cause to pass key values to child prim scripts. I do, however, sell a morf product that can read and save all of an objects prim settings - including all of the individual texture keys, offsets, repeats, and rotations - which it can later restore. Absolutely no actual textures are required to perform this trick beyond those naturally applied to the object's prims when editing them.

I actually use llSetPrimitiveParams to apply the textures, but only because you can set many, many, prim settings all in one go using this function. Creating a complex list for llSetPrimitiveParams is kinda scary though, so llSetTexture is an easier way to go if you only want to set a texture to one, or all, of the sides in each child prim.


It really does work. :D
Asturkon Jua
Registered User
Join date: 19 Sep 2006
Posts: 30
Thanks
11-23-2006 00:46
Hi,

That was just exactly what I was looking for. Thanks a lot for your response. I'll try it out as soon as I can.

Best regards,