Difference between revisions of "PRIM TEXTURE"

From Second Life Wiki
Jump to navigation Jump to search
m
m (i hope this doesn't fuck up the main templates)
Line 20: Line 20:
}}</onlyinclude>{{#if:
}}</onlyinclude>{{#if:


{{#vardefine:caveats_set|{{#var:caveats}}}}
{{#vardefine:caveats_set|{{#var:caveats}}{{#vardefine:caveats|}}
{{#vardefine:caveats|}}
* {{LSLP|repeats}} is not only used to set the number of repeats but the sign of the individual components is also used to set it's associated "Flip" attribute.}}
{{#vardefine:issues_set|{{#var: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:return}}}}
{{#vardefine:caveats_get|{{#var:caveats}}{{#vardefine:caveats|}}
* {{LSLP|repeats}} is not only used to get the number of repeats but the sign of the individual components is also used to get it's associated "Flip" attribute.}}
{{#vardefine:issues_get|{{#var:issues}}{{#vardefine:issues|}}}}


}}{{LSL Constant
}}{{LSL Constant
Line 30: Line 34:
|type=integer
|type=integer
|value=17
|value=17
|desc=Used to get or set the texture settings of a prim's face.
|desc=Used to get or set the texture settings of a prim's {{LSLP|face}}.
|examples=
|examples=
|pa={{LSL Constant/List|i_front=[&#32;{{#var:texture_const}},&#32;|i_end=&nbsp;]|
|pa={{LSL Constant/List|i_front=[&#32;{{#var:texture_const}},&#32;|i_end=&nbsp;]|
Line 57: Line 61:
|text=
|text=


{{LSL Generic/Caveats|title=*|h=4}}
{{LSL Generic/Caveats|caveats={{#var:caveats_get}}{{#vardefine:caveats_get}}|issues={{#var:issues_get}}|title=*|h=4}}
|toc=llGetPrimitiveParams
|toc=llGetPrimitiveParams
|i1_type=integer|i1_name=face
|i1_type=integer|i1_name=face

Revision as of 23:36, 30 June 2012

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 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.
  • repeats is not only used to set the number of repeats but the sign of the individual components is also used to set it's associated "Flip" attribute.
All Issues ~ Search JIRA for related Bugs

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 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 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 is also used to get it's associated "Flip" attribute.
All Issues ~ Search JIRA for related Bugs

Related Articles

Deep Notes

Search JIRA for related Issues

Signature

integer PRIM_TEXTURE = 17;