Prims "knows" UUID of its textures (full permissions) ?
|
|
Christif Vaher
Registered User
Join date: 24 Jun 2008
Posts: 51
|
05-13-2009 08:48
I have a full permission prim, with full permission textures on each side that I applied. I would like to be able to touch a side of the prim and have the prim tell me the UUID of that texture. I dont want to have put the UUIDs in a notecard or configuration prior to this.
Basically I am making a tool for people to easily find out the UUIDs of their textures, prims, etc. Thank you in advance for your help.
|
|
Rolig Loon
Not as dumb as I look
Join date: 22 Mar 2007
Posts: 2,482
|
05-13-2009 09:19
From: Christif Vaher I have a full permission prim, with full permission textures on each side that I applied. I would like to be able to touch a side of the prim and have the prim tell me the UUID of that texture. I dont want to have put the UUIDs in a notecard or configuration prior to this. Basically I am making a tool for people to easily find out the UUIDs of their textures, prims, etc. Thank you in advance for your help. So, use llDetectedTouchFace to identify a face when you click on it and then write a llSay (or llInstantMessage) statement to say "You have just touched face #" + i + ". The texture here is " + llList2String(FaceUUID, i) + "." Put the UUIDs of your textures in the list FaceUUID and you're in hog heaven. See  . ETA: Unless, of course, you're talking about having people grab the UUID of a texture that they don't have permissions for. In THAT case, no, can't be done. And it shouldn't, either. You can't grab the UUID of a texture from an object itself unless you own it. You can only get it if (a) you own the texture and it's in your inventory, where you just right click and get Asset UUID or (b) it's publicly available, posted where anyone can copy it. From your question, though, it doesn't sound as if that's what you're talking about, so just put the UUIDs in a list as I suggested, and be done with it. 
_____________________
It's hard to tell gender from names around here but if you care, Rolig = she. And I exist only in SL, so don't ask....  Look for my work in XStreetSL at 
|
|
Cyd Woolley
Carpe Cerevisiam
Join date: 6 Jan 2007
Posts: 21
|
05-13-2009 09:24
Also, llGetTexture(integer face) will return a string that is the texture on face. If the texture is in the prim's inventory, the return value is the inventory name, otherwise the returned value is the texture UUID.
|
|
Rolig Loon
Not as dumb as I look
Join date: 22 Mar 2007
Posts: 2,482
|
05-13-2009 09:26
From: Cyd Woolley Also, llGetTexture(integer face) will return a string that is the texture on face. If the texture is in the prim's inventory, the return value is the inventory name, otherwise the returned value is the texture UUID. ...... if you own the texture. Otherwise, llGetTexture returns NULL_KEY.
_____________________
It's hard to tell gender from names around here but if you care, Rolig = she. And I exist only in SL, so don't ask....  Look for my work in XStreetSL at 
|
|
Cyd Woolley
Carpe Cerevisiam
Join date: 6 Jan 2007
Posts: 21
|
05-13-2009 09:29
From: Rolig Loon ...... if you own the texture. Otherwise, llGetTexture returns NULL_KEY. Yes, absolutely correct.
|
|
Christif Vaher
Registered User
Join date: 24 Jun 2008
Posts: 51
|
05-13-2009 09:39
Thank you everyone.
default { touch_start(integer num_detected) { llSay(0,llGetTexture(num_detected)); } // touch_start }
Got me where I needed to be, since I own the textures it works great. I appreciate the help.
|
|
Hewee Zetkin
Registered User
Join date: 20 Jul 2006
Posts: 2,702
|
05-13-2009 10:18
From: Christif Vaher Thank you everyone.
default { touch_start(integer num_detected) { llSay(0,llGetTexture(num_detected)); } // touch_start }
Got me where I needed to be, since I own the textures it works great. I appreciate the help. Note that your 'num_detected' parameter is actually the number of touches that happened at once. Since this is USUALLY one, you'll always be returning the texture on side one of the prim. You probably want to modify it to read more like: default { touch_start(integer num_detected) { llSay(0,llGetTexture(llDetectedTouchFace(0))); } // touch_start }
If you really want to use the 'num_detected' parameter, use it to loop over all the touches that were made, as follows: default { touch_start(integer num_detected) { integer touchIndex; for (touchIndex = 0; touchIndex < num_detected; ++touchIndex) { llSay(0,llGetTexture(llDetectedTouchFace(touchIndex))); } } // touch_start }
|
|
Day Oh
Registered User
Join date: 3 Feb 2007
Posts: 1,257
|
05-13-2009 11:41
From: Rolig Loon ...... if you own the texture. Otherwise, llGetTexture returns NULL_KEY. I found this wording a little confusing and just want to make sure it's properly understood... If the object is full perm for the current owner, llGetTexture Always works. The only cause of NULL_KEY is the object itself not being full-perm. llGetTexture does not search the avatar's inventory for items pointing to the texture asset. llGetTexture *does* search the object's inventory for an item pointing to the texture asset. If an item is found, it turns the item's name instead of an asset ID.
|
|
Rolig Loon
Not as dumb as I look
Join date: 22 Mar 2007
Posts: 2,482
|
05-13-2009 13:02
From: Day Oh I found this wording a little confusing and just want to make sure it's properly understood... If the object is full perm for the current owner, llGetTexture Always works. The only cause of NULL_KEY is the object itself not being full-perm. llGetTexture does not search the avatar's inventory for items pointing to the texture asset. llGetTexture *does* search the object's inventory for an item pointing to the texture asset. If an item is found, it turns the item's name instead of an asset ID. Thanks, that's what I intended. If you, the owner of the object, don't have permission to grab the texture (to get its UUID, to copy it to your own inventory, to modify it, ..... ) then llGetTexture will return NULL_KEY. The reason I suggested the approach in my initial response to the OP, BTW, was that I was thinking ahead to the case where he might be intending to sell a texture that he's displaying on the object. In that case, he'd want to own the object itself and prevent others from copying its textures until they had paid. The script would use the llDetectedTouchFace and llList2String(FaceUUID,i) method to trigger a money event and release the texture to the buyer without actually getting the UUID from the face itself.
_____________________
It's hard to tell gender from names around here but if you care, Rolig = she. And I exist only in SL, so don't ask....  Look for my work in XStreetSL at 
|