Difference between revisions of "User:Strife Onizuka/PRIM TEXTURE"

From Second Life Wiki
Jump to navigation Jump to search
(Created page with '{{User:Strife Onizuka/Constant |scope=face|attr=texture |g1_type=integer|g1_name=face |r1_type=string|r1_name=texture |r2_type=vector|r2_name=repeats |r3_type=vector|r3_name=offs...')
 
(forgot usermode pages can't have issues)
 
(5 intermediate revisions by the same user not shown)
Line 3: Line 3:
|g1_type=integer|g1_name=face
|g1_type=integer|g1_name=face
|r1_type=string|r1_name=texture
|r1_type=string|r1_name=texture
|r2_type=vector|r2_name=repeats
|r2_type=vector|r2_name=repeats|r2_desc=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)
|r3_type=vector|r3_name=offsets
|r3_type=vector|r3_name=offsets|r3_desc=x and y range from -1 to 1 (z is ignored)
|r4_type=float|r4_name=rotation_in_radians
|r4_type=float|r4_name=rotation_in_radians|r4_desc=angle in radians
|inject-1=
|inject-1=
{{#vardefine:return|[ {{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}} ]}}


{{#vardefine:p_rotation_in_radians_desc|angle in radians}}
{{#vardefine:direction|.set}}
{{#vardefine:p_repeats_desc|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)}}
{{LSL_Function/inventory|texture|uuid=true|type=texture|full={{{remote|}}}}}
{{#vardefine:p_offsets_desc|x and y range from -1 to 1 (z is ignored)}}
{{Issues/SVC-914}}
{{#vardefine:direction}}


{{LSL_Function/inventory|texture|uuid=true|type=texture|no_caveat={{#ifeq:{{{1|}}}|get|true}}|full={{{remote|}}}}}
{{#vardefine:return|[ {{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}} ]}}


{{#vardefine:facetable|{{#var:facetable}}
{{#vardefine:facetable|{{#var:facetable}}
{{!}}-
{{!}}-
{{!}} [ {{#var:texture_const}} ]
{{!}} [ {{#var:const_PRIM_TEXTURE}} ]
{{!}} {{#var:return}} }}
{{!}} {{#var:return}} }}
{{{{#ifeq:{{{1|}}}|get|dev/null|Issues/SVC-914}}|}}
{{#vardefine:caveats_set|{{#var: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 33: Line 27:
|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 face.
|examples=
|examples=
|text-get={{LSL Constant/PrimParamText|get}}
|text-get={{LSL Generic/Caveats|title=*|h=4|dir=.get}}
 
|text-set={{LSL Generic/Caveats|title=*|h=4|dir=.set}}
{{LSL Generic/Caveats|title=*|h=4}}
|text-set={{LSL Constant/PrimParamText|set}}
 
{{LSL Generic/Caveats|caveats={{#var:caveats_set}}{{#vardefine:caveats_set}}|issues={{#var:issues_set}}|title=*|h=4}}


====<tt>texture</tt> Constants====
====<tt>texture</tt> Constants====
Line 62: Line 52:
{{LSL DefineRow||[[changed]]|}}
{{LSL DefineRow||[[changed]]|}}
|location
|location
|cat1=Prim
<!--|cat1=Prim-->
|cat2
|cat2
|cat3
|cat3
|cat4
|cat4
}}
|self=self}}

Latest revision as of 12:34, 5 January 2011

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.

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

The same syntax applies to llGetLinkPrimitiveParams, but with an additional prefixed link parameter in the function call. All Issues ~ Search JIRA for related Bugs

llSetPrimitiveParams

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

The same syntax applies to llSetLinkPrimitiveParams and llSetLinkPrimitiveParamsFast but with an additional prefixed link parameter in the function call.

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.
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>

Caveats

  • If face is ALL_SIDES then the function works on all sides.
  • If face indicates a face that does not exist the return is [ "", ZERO_VECTOR, ZERO_VECTOR, 0.0 ]
All Issues ~ Search JIRA for related Bugs

Related Articles