Difference between revisions of "PRIM TEXTURE"

From Second Life Wiki
Jump to navigation Jump to search
m (Negative repeats flip the texture.)
(take cover ^_^)
Line 15: Line 15:
{{!}} [ {{#var:texture_const}} ]
{{!}} [ {{#var:texture_const}} ]
{{!}} {{#var:return}} }}
{{!}} {{#var:return}} }}
{{{{#ifeq:{{{1|}}}|get|dev/null|Issues/SVC-914}}|}}


}}</onlyinclude>{{#if:
}}</onlyinclude>{{#if:
Line 20: Line 22:
{{#vardefine:caveats_set|{{#var:caveats}}}}
{{#vardefine:caveats_set|{{#var:caveats}}}}
{{#vardefine:caveats|}}
{{#vardefine:caveats|}}
{{#vardefine:issues_set|{{#var:issues}}}}


{{LSL_Function/face|face|{{#var:texture_const}}|!footer=*|return={{#var:return}}}}
{{LSL_Function/face|face|{{#var:texture_const}}|!footer=*|return={{#var:return}}}}
Line 42: Line 45:
llSetPrimitiveParams([ PRIM_TEXTURE, ALL_SIDES, llGetInventoryName(INVENTORY_TEXTURE, 0), <1.0, 1.0, 0.0>, <0.0, 0.0, 0.0>, 0.0 ]);
llSetPrimitiveParams([ PRIM_TEXTURE, ALL_SIDES, llGetInventoryName(INVENTORY_TEXTURE, 0), <1.0, 1.0, 0.0>, <0.0, 0.0, 0.0>, 0.0 ]);
llSetPrimitiveParams([ PRIM_TEXTURE, 0, TEXTURE_PLYWOOD, <2.0, 5.0, 0.0>, <0.1, 0.2, 0.0>, 1.0 ]);</lsl>
llSetPrimitiveParams([ PRIM_TEXTURE, 0, TEXTURE_PLYWOOD, <2.0, 5.0, 0.0>, <0.1, 0.2, 0.0>, 1.0 ]);</lsl>
====Set Issues====
{{{!}}
{{#var:issues_set}}
{{!}}}


|toc=llSetPrimitiveParams
|toc=llSetPrimitiveParams

Revision as of 10:53, 1 March 2009

Description

Constant: integer PRIM_TEXTURE = 17;

The integer constant PRIM_TEXTURE has the value 17

Used to get or set the texture settings of a prim's face.

llSetPrimitiveParams

[ PRIM_TEXTURE, integer face, string texture, vector repeats, vector offsets, float rotation_in_radians ]
• integer face face number or ALL_SIDES
• string texture a texture in the inventory of the prim this script is in or a UUID of a texture
• vector repeats x and y range from 0.0 to 100, or -0.0 to -100 in 0.01 increments. Negative values flip the texture (z is ignored)
• vector offsets x and y range from -1 to 1 (z is ignored)
• float rotation_in_radians angle in radians

Used with llSetPrimitiveParams & llSetLinkPrimitiveParams.

Caveats

  • If texture is missing from the prim's inventory and it is not a UUID or it is not a texture then an error is shouted on DEBUG_CHANNEL.
  • If texture 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.

texture Constants

The following constants can (optionally) be used for the texture value: TEXTURE_BLANK, TEXTURE_DEFAULT, TEXTURE_MEDIA, TEXTURE_PLYWOOD and TEXTURE_TRANSPARENT.

Examples

<lsl>llSetPrimitiveParams([ PRIM_TEXTURE, ALL_SIDES, "5748decc-f629-461c-9a36-a35a221fe21f", <1.0, 1.0, 0.0>, <0.0, 0.0, 0.0>, 0.0 ]); llSetPrimitiveParams([ PRIM_TEXTURE, ALL_SIDES, llGetInventoryName(INVENTORY_TEXTURE, 0), <1.0, 1.0, 0.0>, <0.0, 0.0, 0.0>, 0.0 ]); llSetPrimitiveParams([ PRIM_TEXTURE, 0, TEXTURE_PLYWOOD, <2.0, 5.0, 0.0>, <0.1, 0.2, 0.0>, 1.0 ]);</lsl>

Set Issues

   CHANGED_TEXTURE is not triggered when texture is changed via script

llGetPrimitiveParams

llGetPrimitiveParams([ PRIM_TEXTURE, integer face ]);

Returns the list [ string texture, vector repeats, vector offsets, float rotation_in_radians ]

• integer face face number or ALL_SIDES

• string texture a texture in the inventory of the prim this script is in or a UUID of a texture
• vector repeats x and y range from 0.0 to 100, or -0.0 to -100 in 0.01 increments. Negative values flip the texture (z is ignored)
• vector offsets x and y range from -1 to 1 (z is ignored)
• float rotation_in_radians angle in radians

Caveats

Caveats


Related Articles

Deep Notes

All Issues

~ Search JIRA for related Issues
   CHANGED_TEXTURE is not triggered when texture is changed via script

Signature

integer PRIM_TEXTURE = 17;