Difference between revisions of "LlGetTexture"

From Second Life Wiki
Jump to navigation Jump to search
m
(Add Blinn-Phong terminology to page following PBR release.)
 
(27 intermediate revisions by 8 users not shown)
Line 1: Line 1:
{{LSL Function/face|face}}
{{LSL_Function
{{LSL_Function
|inject-2={{LSL Function/face|face|ALL_SIDES=returns the value for face zero.|return=[[NULL_KEY]]}}
|func_id=57|func_sleep=0.0|func_energy=10.0
|func_id=57|func_sleep=0.0|func_energy=10.0
|func=llGetTexture|return_type=string|p1_type=integer|p1_name=face
|func=llGetTexture|return_type=string|p1_type=integer|p1_name=face
|func_footnote=If the object is no-mod and the texture is not in the inventory, return a {{LSL Const|NULL_KEY|key|&quot;00000000-0000-0000-0000-000000000000&quot;|c=Evaluates to false in conditionals just like invalid keys.}}.<br/>If it is a texture in the object's inventory, return the inventory name, otherwise return the texture [[UUID]].
|return_text=that is the [[PBR_Materials#Nomenclature_changes|Blinn-Phong]] diffuse texture on '''face'''
|func_desc
|func_footnote=If the texture is in the prim's inventory, the return value is the inventory name, otherwise the returned value is the texture [[UUID]].
|return_text=that is the texture on '''face'''
|spec
|spec
|caveats
|caveats=*{{LSL Constant/NULL KEY}} is returned when the {{LSLGC|Owner|owner}} does not have {{LSLGC|Permissions/Asset|full permissions}} to the object and the texture is not in the prim's inventory.
*The white texture from the texture picker is "[[TEXTURE_BLANK|5748decc-f629-461c-9a36-a35a221fe21f]]"
*The default texture (plywood) is "[[TEXTURE_PLYWOOD|89556747-24cb-43ed-920b-47caed15465f]]"
|constants
|constants
|examples
|examples=<source lang="lsl2">
//Tells (on chat) the texture keys / texture names on 6 sides
default
{
    state_entry()
    {
        integer i = 0;
        integer max = llGetNumberOfSides();
        while(i < max)
        {
            llSay(0,"Side " + (string)i + " texture is: " + (string)llGetTexture(i));
            ++i;
        }
    }
}
</source>
|helpers
|helpers
|also_functions={{LSL DefineRow||[[llSetTexture]]|}}
|also_functions={{LSL DefineRow||{{LSLGC|PrimitiveParams}}|[[PRIM_TEXTURE]]}}
{{LSL DefineRow||[[llSetTexture]]|}}
{{LSL DefineRow||[[llSetLinkTexture]]|Sets link's texture}}
{{LSL DefineRow||[[llGetNumberOfSides]]|Gets the number of faces on the prim}}
|also_events
|also_events
|also_tests
|also_tests
|also_articles
|also_articles
|notes
|notes
|sort=GetTexture
|history=
*On 5/15/2005 (give or take a day) llGetTexture was changed to check the host object's permissions and if inadequate return {{LSL Constant/NULL_KEY}}.
**http://forums-archive.secondlife.com/54/a1/47066/1.html
**http://forums-archive.secondlife.com/54/09/33388/1.html
|cat1
|cat1
|cat2=Texture
|cat2=Texture

Latest revision as of 06:14, 30 November 2023

Summary

Function: string llGetTexture( integer face );
0.0 Forced Delay
10.0 Energy

Returns a string that is the Blinn-Phong diffuse texture on face

• integer face face number or ALL_SIDES

If face is ALL_SIDES then the function returns the value for face zero. If the texture is in the prim's inventory, the return value is the inventory name, otherwise the returned value is the texture UUID.

Caveats

Examples

//Tells (on chat) the texture keys / texture names on 6 sides
default
{
    state_entry()
    {
        integer i = 0;
        integer max = llGetNumberOfSides();
        while(i < max)
        {
            llSay(0,"Side " + (string)i + " texture is: " + (string)llGetTexture(i));
            ++i;
        }
    }
}

See Also

Functions

•  PrimitiveParams PRIM_TEXTURE
•  llSetTexture
•  llSetLinkTexture Sets link's texture
•  llGetNumberOfSides Gets the number of faces on the prim

Deep Notes

History

Signature

function string llGetTexture( integer face );