LlIsLinkGLTFMaterial: Difference between revisions

From Second Life Wiki
Jump to navigation Jump to search
Rider Linden (talk | contribs)
Created page with "{{LSL_Function |func_id=|func_sleep=0.0|func_energy=10.0 |func=llIsLinkGLTFMaterial |return_type=integer |p1_type=integer|p1_name=link|p1_desc=Link to inspect for PBR, may be..."
 
WolfGang Senizen (talk | contribs)
m Returns boolean integer, added return subtype
 
(3 intermediate revisions by 2 users not shown)
Line 3: Line 3:
|func=llIsLinkGLTFMaterial
|func=llIsLinkGLTFMaterial
|return_type=integer
|return_type=integer
|return_subtype=boolean
|p1_type=integer|p1_name=link|p1_desc=Link to inspect for PBR, may be [[LINK_THIS]] or [[LINK_ROOT]]
|p1_type=integer|p1_name=link|p1_desc=Link to inspect for PBR, may be [[LINK_THIS]] or [[LINK_ROOT]]
|p2_type=integer|p2_name=face|p2_desc='''Face''' to examine for PBR, or [[ALL_SIDES]]
|p2_type=integer|p2_name=face|p2_desc='''Face''' to examine for PBR, or [[ALL_SIDES]]
Line 9: Line 10:
|spec
|spec
|caveats=
|caveats=
* Returns [[FALSE]] if link does not exist or refers to a multi-link target (such as [[LINK_SET]]).
* Returns [[FALSE]] if face does not exist.
* Returns [[FALSE]] if face does not exist.
|constants
|constants
|examples=<source lang="lsl2">
|examples=<source lang="lsl2">
//Tells (on chat) the texture keys / texture names on 6 sides
//Tells (on chat) if the materials are PBR
default
default
{
{
Line 44: Line 46:
|also_articles
|also_articles
|notes
|notes
|history=
|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=
|cat2
|cat3
|cat3
|cat4
|cat4
}}
}}

Latest revision as of 12:31, 9 April 2025

Summary

Function: integer llIsLinkGLTFMaterial( integer link, integer face );
0.0 Forced Delay
10.0 Energy

Returns a boolean (an integer) that is TRUE if the material is PBR and FALSE if it is Blinn-Phong diffuse texture on face

• integer link Link to inspect for PBR, may be LINK_THIS or LINK_ROOT
• integer face Face to examine for PBR, or ALL_SIDES

Caveats

  • Returns FALSE if link does not exist or refers to a multi-link target (such as LINK_SET).
  • Returns FALSE if face does not exist.

Examples

//Tells (on chat) if the materials are PBR
default
{
    state_entry()
    {
        integer i = 0;
        integer max = llGetNumberOfSides();
        while(i < max)
        {
            string message = "Side " + (string)i + " material is ";
            if (llIsLinkGLTFMaterial(LINK_THIS, i))
                message += "GLTF/PBR";
            else
                message += "Blinn-Phong";
            llSay(0, message);
            ++i;
        }

        if (llIsLinkGLTFMaterial(LINK_THIS, ALL_SIDES))
            llSay(0, "All sides are PBR");
        else
            llSay(0, "Some sides are not PBR");
    }
}

See Also

Functions

•  llGetNumberOfSides Gets the number of faces on the prim

Deep Notes

Signature

function integer llIsLinkGLTFMaterial( integer link, integer face );