LL functions could return texture UUIDs as type uuid
tracked
SuzannaLinn Resident
In LSL, functions like llGetTexture() return either a texture name or its UUID, both as strings, and string–key comparisons work.
In SLua, string and uuid are distinct types. For instance, in an object with blank textures:
print( ll.GetTexture(0) == TEXTURE_BLANK ) -- > false
We must cast to uuid:
print( uuid( ll.GetTexture(0) ) == TEXTURE_BLANK ) -- > true
Log In
H
Harold Linden
tracked
Thanks for sending this in!
We'll need to think about how to handle this one, there's not currently support for functions that might return one type or the other outside of a list.
For the moment you can use a wrapper around
ll.GetLinkPrimitiveParams()
which _will_ give you a proper UUID in the list response.SuzannaLinn Resident
PrimParams return type
string
print( typeof( ll.GetPrimitiveParams{ PRIM_TEXTURE, 0 }[1] ) ) -- > string
print( typeof( ll.GetLinkPrimitiveParams( 0, { PRIM_TEXTURE, 0 } )[1] ) ) -- > string
H
Harold Linden
SuzannaLinn Resident Urgh, my bad, I was just reading the C++ and didn't check how an actual script behaves. Looks like the code shoves it in a
uuid
if it's an asset ID but something later turns it into a string... I'll look into what we can do about that.