Difference between revisions of "PRIM TYPE"
Jump to navigation
Jump to search
(Added to caveats : PRIM_TYPE change limited to set of 10 prims or less in the .) |
(see how this looks) |
||
(17 intermediate revisions by 5 users not shown) | |||
Line 2: | Line 2: | ||
{{#vardefine:p_type_flag_desc|PRIM_TYPE_* flag}} | {{#vardefine:p_type_flag_desc|PRIM_TYPE_* flag}} | ||
{{#vardefine:p_type_parameters_hover|a list consisting of the parameters of the PRIM_TYPE_* flag}} | {{#vardefine:p_type_parameters_hover|a list consisting of the parameters of the PRIM_TYPE_* flag}} | ||
{{#vardefine:p_type_parameters_desc|a list consisting of the parameters of {{LSLP|flag}}}} | |||
{{#vardefine:p_hole_shape_desc|PRIM_HOLE_* flag}} | {{#vardefine:p_hole_shape_desc|PRIM_HOLE_* flag}} | ||
{{#vardefine:p_cut_desc|x and y range from 0.0 to 1.0, x must be at least 0.05 smaller than y (z is ignored)}} | {{#vardefine:p_cut_desc|x and y range from 0.0 to 1.0, x must be at least 0.05 smaller than y (z is ignored)}} | ||
{{#vardefine:p_hollow_desc|ranges from 0.0 (solid) to 0.95 (maximum hollowed)}} | {{#vardefine:p_hollow_desc|ranges from 0.0 (solid) to 0.95 (maximum hollowed)}} | ||
{{#vardefine:p_twist_box_desc|ranges from -0 | {{#vardefine:p_twist_box_desc|ranges from -1.0 (-180 degree in the edit window) to 1.0 (+180 degree in the edit window) for both x and y (z is ignored)}} | ||
{{#vardefine:p_twist_torus_desc|ranges from -1.0 (-360 degree in the edit window) to 1.0 (+360 degree in the edit window) for both x and y (z is ignored)}} | {{#vardefine:p_twist_torus_desc|ranges from -1.0 (-360 degree in the edit window) to 1.0 (+360 degree in the edit window) for both x and y (z is ignored)}} | ||
{{#vardefine:p_hole_size_desc|x ranges from 0.05 to 1.0; y ranges from 0.05 (large hole) to 0.50 (no hole)}} | {{#vardefine:p_hole_size_desc|x ranges from 0.05 to 1.0; y ranges from 0.05 (large hole) to 0.50 (no hole)}} | ||
Line 29: | Line 29: | ||
{{#vardefine:type_const|{{LSL Const|PRIM_TYPE|integer|9|c=Used to {{GetSet|{{{1|}}}|get|set|/}} the the type of prim.}}}} | {{#vardefine:type_const|{{LSL Const|PRIM_TYPE|integer|9|c=Used to {{GetSet|{{{1|}}}|get|set|/}} the the type of prim.}}}} | ||
{{#vardefine:caveats-set|{{#var:caveats-set}} | |||
* {{#var:type_const}} can only be used with [[LINK_SET]] if the object contains 10 or fewer prims. It can only be used with [[LINK_ALL_OTHERS]] or [[LINK_ALL_CHILDREN]] if the object contains 11 or fewer prims. If there are more prims, the operation will fail and an error will be shouted to [[DEBUG_CHANNEL]]. Work around this by looping through the prims with [[llSetLinkPrimitiveParamsFast]]. | |||
* {{#var:type_const}} will silently fail when executed by a script placed inside a mesh, whether the affect object is the mesh or not (in linksets for example), use a normal prim as your root prim. | |||
}} | |||
{{#switch:{{{1|}}} | |||
|get={{#vardefine:caveats|{{#var:caveats}} | |||
{{#var:caveats-get}}{{#vardefine:caveats-get}}}} | |||
|set={{#vardefine:caveats|{{#var:caveats}} | |||
{{#var:caveats-set}}{{#vardefine:caveats-set}}}} | |||
}} | |||
}}</onlyinclude>{{#if: | }}</onlyinclude>{{#if: | ||
Line 35: | Line 48: | ||
}}{{LSL Constant | }}{{LSL Constant | ||
|inject-2={{LSL PrimitiveParam Categorize|Prim}} | |||
|name=PRIM_TYPE | |name=PRIM_TYPE | ||
|type=integer | |type=integer | ||
|value=9 | |value=9 | ||
|desc=Gets or sets the {{ | |desc=Gets or sets the {{LSLP|type_flag|type}} of the prim and associated type {{LSLP|type_parameters|parameters}}. | ||
|examples | |examples | ||
|pa={{LSL Constant/List|i_front=[ {{#var:type_const}}, |i_end= ] + {{ | |pa={{LSL Constant/List|i_front=[ {{#var:type_const}}, |i_end= ] + {{LSLPT|type_parameters|flag_parameters}} | ||
|text=Used with [[llSetPrimitiveParams]] & [[llSetLinkPrimitiveParams]]. | |text=Used with [[llSetPrimitiveParams]] & [[llSetLinkPrimitiveParams]]. | ||
The values needed for | The values needed for {{LSLP|type_parameters|flag_parameters}} is dependent on {{LSLP|type_flag|flag}}, please refer to the individual PRIM_TYPE_* articles for additional information. | ||
{{LSL Generic/Caveats|caveats={{#var:caveats-set}}|title=*}} | |||
|toc=llSetPrimitiveParams | |toc=llSetPrimitiveParams | ||
|i1_type=integer|i1_name=type_flag|i1_disp=flag | |i1_type=integer|i1_name=type_flag|i1_disp=flag | ||
}} | }} | ||
|pb={{LSL Constant/List|i_front=[[llGetPrimitiveParams]]([ {{#var:type_const}}|i_end= ]);| | |pb={{LSL Constant/List|i_front=[[llGetPrimitiveParams]]([ {{#var:type_const}}|i_end= ]);| | ||
|r_front=Returns the list [ |r_end= ] + {{LSL Param|type_parameters|flag_parameters}} | |r_front=Returns the list <code>[ |r_end= ] + {{LSL Param|type_parameters|flag_parameters}}</code> | ||
|text=The values that follow after | |text=The values that follow after {{LSLP|type_flag|flag}}, the {{LSLP|type_parameters|flag_parameters}}, are dependent on the value of {{LSLP|flag}}, please refer to the individual PRIM_TYPE_* articles for further information. | ||
|toc=llGetPrimitiveParams | |toc=llGetPrimitiveParams | ||
Line 55: | Line 70: | ||
}} | }} | ||
|pc= | |pc= | ||
{{LSL_Constants/PrimitiveParams/type|table=*|simple=*|sortable=*|style=margin-top:0; margin-right:0;|{{ | {{LSL_Constants/PrimitiveParams/type|table=*|simple=*|sortable=*|style=margin-top:0; margin-right:0;|{{LSLPT|type_parameters|flag_parameters}}}} | ||
{{LSL Constants/PrimitiveParams/hole shape|table=*|simple=*|sortable=*|style=margin-top:0; margin-right:0;}} | |||
|constants= | |constants= | ||
{{LSL ConstRow|CHANGED_SHAPE}} | {{LSL ConstRow|CHANGED_SHAPE}} | ||
|functions= | |functions= | ||
{{LSL DefineRow||[[llSetPrimitiveParams]]|}} | {{LSL DefineRow||[[llSetPrimitiveParams]]|}} | ||
Line 67: | Line 81: | ||
{{LSL DefineRow||[[changed]]|}} | {{LSL DefineRow||[[changed]]|}} | ||
|location | |location | ||
|cat1 | |cat1 | ||
|cat2 | |cat2 | ||
}} | }} |
Latest revision as of 10:49, 5 January 2014
LSL Portal | Functions | Events | Types | Operators | Constants | Flow Control | Script Library | Categorized Library | Tutorials |
Description
Constant: integer PRIM_TYPE = 9;The integer constant PRIM_TYPE has the value 9
Gets or sets the type of the prim and associated type parameters.
llSetPrimitiveParams
[ PRIM_TYPE, integer flag ] + flag_parameters• integer | flag | – | PRIM_TYPE_* flag |
Used with llSetPrimitiveParams & llSetLinkPrimitiveParams.
The values needed for flag_parameters is dependent on flag, please refer to the individual PRIM_TYPE_* articles for additional information.
Caveats
- PRIM_TYPE can only be used with LINK_SET if the object contains 10 or fewer prims. It can only be used with LINK_ALL_OTHERS or LINK_ALL_CHILDREN if the object contains 11 or fewer prims. If there are more prims, the operation will fail and an error will be shouted to DEBUG_CHANNEL. Work around this by looping through the prims with llSetLinkPrimitiveParamsFast.
- PRIM_TYPE will silently fail when executed by a script placed inside a mesh, whether the affect object is the mesh or not (in linksets for example), use a normal prim as your root prim.
- While it is possible to use PRIM_TYPE_SCULPT to animate an object, it is not recommended. For details see: Why UUID Flipping is Bad
llGetPrimitiveParams
llGetPrimitiveParams([ PRIM_TYPE ]);Returns the list [ integer flag ] + flag_parameters
• integer | flag | – | PRIM_TYPE_* flag |
The values that follow after flag, the flag_parameters, are dependent on the value of flag, please refer to the individual PRIM_TYPE_* articles for further information.
flag Constants | flag_parameters | ||||||
---|---|---|---|---|---|---|---|
PRIM_TYPE_BOX | 0 | [ integer hole_shape, vector cut, float hollow, vector twist, vector top_size, vector top_shear ] | |||||
PRIM_TYPE_CYLINDER | 1 | [ integer hole_shape, vector cut, float hollow, vector twist, vector top_size, vector top_shear ] | |||||
PRIM_TYPE_PRISM | 2 | [ integer hole_shape, vector cut, float hollow, vector twist, vector top_size, vector top_shear ] | |||||
PRIM_TYPE_SPHERE | 3 | [ integer hole_shape, vector cut, float hollow, vector twist, vector dimple] | |||||
PRIM_TYPE_TORUS | 4 | [ integer hole_shape, vector cut, float hollow, vector twist, vector hole_size, vector top_shear, vector advanced_cut, vector taper, float revolutions, float radius_offset, float skew ] | |||||
PRIM_TYPE_TUBE | 5 | [ integer hole_shape, vector cut, float hollow, vector twist, vector hole_size, vector top_shear, vector advanced_cut, vector taper, float revolutions, float radius_offset, float skew ] | |||||
PRIM_TYPE_RING | 6 | [ integer hole_shape, vector cut, float hollow, vector twist, vector hole_size, vector top_shear, vector advanced_cut, vector taper, float revolutions, float radius_offset, float skew ] | |||||
PRIM_TYPE_SCULPT | 7 | [ string map, integer type ] |
hole_shape Flags | Shape | hole_shape Flags | Shape | ||
---|---|---|---|---|---|
PRIM_HOLE_DEFAULT | 0x00 | Default | PRIM_HOLE_SQUARE | 0x20 | Square |
PRIM_HOLE_CIRCLE | 0x10 | Circle | PRIM_HOLE_TRIANGLE | 0x30 | Triangle |
Caveats
Related Articles
Constants
• | CHANGED_SHAPE |
Functions
• | llSetPrimitiveParams | |||
• | llSetLinkPrimitiveParams | |||
• | llGetPrimitiveParams |
Events
• | changed |