Difference between revisions of "LlSetRenderMaterial"

From Second Life Wiki
Jump to navigation Jump to search
(Sets the {{LSLP|material}} of this prim's {{LSLP|face}})
 
Line 7: Line 7:
|p2_type=integer|p2_name=face
|p2_type=integer|p2_name=face
|func_footnote
|func_footnote
|func_desc=Sets the {{LSLP|material}} of this prim's {{LSLP|face}}. Similarly to [[llGetTexture]], this function accepts material assets either by ID or by item name.
|func_desc=Sets the {{LSLP|material}} of this prim's {{LSLP|face}}.|return_text
|return_text
|spec
|spec
|constants
|constants

Revision as of 12:37, 4 October 2022

Summary

Function: llSetRenderMaterial( string material, integer face );
0.2 Forced Delay
10.0 Energy

Sets the material of this prim's face.

• string material a material in the inventory of the prim this script is in or a UUID of a material
• integer face face number or ALL_SIDES

If face is ALL_SIDES then the function works on all sides.

Caveats

  • This function causes the script to sleep for 0.2 seconds.
  • The function silently fails if its face value indicates a face that does not exist.
  • If material is missing from the prim's inventory and it is not a UUID or it is not a material then an error is shouted on DEBUG_CHANNEL.
  • If material is a UUID then there are no new asset permissions consequences for the object.
    • The resulting object develops no new usage restrictions that might have occurred if the asset had been placed in the prims inventory.

Examples

default
{
    state_entry()
    {
        // the first material alphabetically inside the same prim's inventory
        string material = llGetInventoryName(INVENTORY_MATERIAL, 0);

        // set it on all sides of the prim containing the script
        llSetRenderMaterial(material, ALL_SIDES);
    }
}

Deep Notes

Signature

function void llSetRenderMaterial( string material, integer face );