Difference between revisions of "PRIM TEXTURE"

From Second Life Wiki
Jump to navigation Jump to search
m (duplicated caveat)
m (name collision)
Line 1: Line 1:
<onlyinclude>{{#if:
<onlyinclude>{{#if:


{{#vardefine:return|[&nbsp;{{HoverText|""|string texture}}, {{HoverLink|ZERO_VECTOR|{{LSL VR|0.0|0.0|0.0}} vector repeats}}, {{HoverLink|ZERO_VECTOR|{{LSL VR|0.0|0.0|0.0}} vector offsets}}, {{HoverText|0.0|float rotation_in_radians}}&nbsp;]}}
{{#vardefine:texture_return|[&nbsp;{{HoverText|""|string texture}}, {{HoverLink|ZERO_VECTOR|{{LSL VR|0.0|0.0|0.0}} vector repeats}}, {{HoverLink|ZERO_VECTOR|{{LSL VR|0.0|0.0|0.0}} vector offsets}}, {{HoverText|0.0|float rotation_in_radians}}&nbsp;]}}


{{#vardefine:texture_const|{{LSL Const|PRIM_TEXTURE|integer|17|c=Used to {{GetSet|{{{1|}}}|get|set|/}} the texture settings of a prim's face}}}}
{{#vardefine:texture_const|{{LSL Const|PRIM_TEXTURE|integer|17|c=Used to {{GetSet|{{{1|}}}|get|set|/}} the texture settings of a prim's face}}}}
Line 17: Line 17:
{{!}}-
{{!}}-
{{!}} [ {{#var:texture_const}} ]
{{!}} [ {{#var:texture_const}} ]
{{!}} {{#var:return}} }}
{{!}} {{#var:texture_return}} }}


{{#vardefine:caveats_get|
{{#vardefine:caveats_get|
Line 26: Line 26:
* {{LSLP|repeats}} is not only used to set the number of repeats but the sign of the individual components is also used to set the "Flip" attribute.}}
* {{LSLP|repeats}} is not only used to set the number of repeats but the sign of the individual components is also used to set the "Flip" attribute.}}


<includeonly>
{{#ifeq:{{{1|}}}|get|
{{#ifeq:{{{1|}}}|get|


Line 41: Line 40:


}}
}}
</includeonly>


<noinclude>
<noinclude>
{{:PRIM TEXGEN|get}}
{{:PRIM TEXGEN|{{{1|}}}}}
</noinclude>
</noinclude>


Line 59: Line 57:
{{#vardefine:issues_set|{{#var:issues}}{{#vardefine:issues|}}}}
{{#vardefine:issues_set|{{#var:issues}}{{#vardefine:issues|}}}}


{{LSL_Function/face|face|{{#var:texture_const}}|!footer=*|return={{#var:return}}}}
{{LSL_Function/face|face|{{#var:texture_const}}|!footer=*|return={{#var:texture_return}}}}


{{#vardefine:caveats_get|{{#var:caveats}}{{#vardefine:caveats|}}
{{#vardefine:caveats_get|{{#var:caveats}}{{#vardefine:caveats|}}

Revision as of 13:40, 7 June 2014

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 rot ]
• 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 rot angle expressed in radians

Used with llSetPrimitiveParams & llSetLinkPrimitiveParams.

Caveats

  • repeats is not only used to set the number of repeats but the sign of the individual components is also used to set the "Flip" attribute.
  • In the default texture mapping mode the texture repeats units are in texture repeats per face. In the planar texture mapping mode the texture repeats units are in texture repeats per half meter. This is in contrast to the in-world editing tool, in which the planar texture scaling units are repeats per meter.
  • 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>

llGetPrimitiveParams

llGetPrimitiveParams([ PRIM_TEXTURE, integer face ]);

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

• integer face face number or ALL_SIDES

• string texture a texture in the inventory of the target prim 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 rot angle expressed in radians

Caveats

  • If face is ALL_SIDES then the PRIM_TEXTURE works on all sides.
  • If face indicates a face that does not exist the PRIM_TEXTURE return is [ "", ZERO_VECTOR, ZERO_VECTOR, 0.0 ]
  • repeats is not only used to get the number of repeats but the sign of the individual components indicate if "Flip" is set.
  • With texture as with llGetTexture, NULL_KEY is returned when the owner does not have full permissions to the object and the texture is not in the prim's inventory.
  • In the default texture mapping mode the texture repeats units are in texture repeats per face. In the planar texture mapping mode the texture repeats units are in texture repeats per half meter. This is in contrast to the in-world editing tool, in which the planar texture scaling units are repeats per meter.

Caveats


Deep Notes

Search JIRA for related Issues

Signature

integer PRIM_TEXTURE = 17;