# llSetLinkPrimitiveParamsFast

*LSL function*

Replaces deprecated `llSetLinkPrimitiveParams`, `llSetPrimitiveParams`.

```lsl
void llSetLinkPrimitiveParamsFast(integer link, list rules);
```

- `integer link`: Link number (1 for root, >1 for children) or a LINK_* flag.
- `list rules`: A list of PRIM_* rules and data to apply.

- Energy: 10

This is a very powerful & sharp function. Each `PRIM_*` rule takes at least one parameter and has its own quirks and its own dedicated article with specific information.

Sets the prims parameters according to **rules**.

```lsl title="How to use" frame="terminal"
llSetLinkPrimitiveParamsFast(0, []);
```

## Specification

Constant group [PrimParam](/constants/groups/PrimParam/):

```lsl
PRIM_ALLOW_UNSIT = 39
PRIM_ALPHA_MODE, integer face, integer alpha_mode, integer mask_cutoff
PRIM_BUMP_SHINY, integer face, integer shiny, integer bump
PRIM_CLICK_ACTION = 43
PRIM_COLLISION_SOUND, string sound, float volume
PRIM_COLOR, integer face, vector color, float alpha
PRIM_DAMAGE, float damage, integer damage_type
PRIM_DESC = 28
PRIM_FLEXIBLE, integer enabled, integer softness, float gravity, float friction, float wind, float tension, vector force
PRIM_FULLBRIGHT, integer face, integer enabled
PRIM_GLOW, integer face, float intensity
PRIM_GLTF_BASE_COLOR, integer face, string texture, vector repeats, vector offsets, float rotation_in_radians, vector color, float alpha, integer gltf_alpha_mode, float alpha_mask_cutoff, integer double_sided
PRIM_GLTF_EMISSIVE, integer face, string texture, vector repeats, vector offsets, float rotation_in_radians, vector emissive_tint
PRIM_GLTF_METALLIC_ROUGHNESS, integer face, string texture, vector repeats, vector offsets, float rotation_in_radians, float metallic_factor, float roughness_factor
PRIM_GLTF_NORMAL, integer face, string texture, vector repeats, vector offsets, float rotation_in_radians
PRIM_HEALTH = 52
PRIM_LINK_TARGET = 34
PRIM_MATERIAL = 2
PRIM_NAME = 27
PRIM_NORMAL, integer face, string texture, vector repeats, vector offsets, float rotation_in_radians
PRIM_OMEGA, vector axis, float spinrate, float gain
PRIM_PHANTOM = 5
PRIM_PHYSICS = 3
PRIM_PHYSICS_SHAPE_TYPE = 30
PRIM_POINT_LIGHT, integer enabled, vector linear_color, float intensity, float radius, float falloff
PRIM_POS_LOCAL = 33
PRIM_POSITION = 6
PRIM_PROJECTOR, string texture, float fov, float focus, float ambiance
PRIM_REFLECTION_PROBE, integer enabled, float ambiance, float clip_distance, integer flags
PRIM_RENDER_MATERIAL, integer face, string render_material
PRIM_ROT_LOCAL = 29
PRIM_ROTATION = 8
PRIM_SCRIPTED_SIT_ONLY = 40
PRIM_SIT_FLAGS = 50
PRIM_SIT_TARGET, integer sit_target, vector offset, rotation rot
PRIM_SIZE = 7
PRIM_SLICE = 35
PRIM_SPECULAR, integer face, string texture, vector repeats, vector offsets, float rotation_in_radians, vector color, integer glossiness, integer environment
PRIM_TEMP_ON_REZ = 4
PRIM_TEXGEN, integer face, integer mode
PRIM_TEXT, string text, vector color, float alpha
PRIM_TEXTURE, integer face, string texture, vector repeats, vector offsets, float rotation_in_radians
PRIM_TYPE = 9
```

### Shape

<table class="params-list">
	<tr>
		<th>Rule</th>
		<th>Description</th>
	</tr>
	<tr>
		<td>[PRIM_TYPE](/constants/PRIM_TYPE/)

`, integer flag, …`

</td>
		<td>Sets the prim's shape. The PRIM_TYPE_* flag picks the shape and the arguments that follow it. **hole_shape** is one of [PRIM_HOLE_*](/constants/groups/PrimTypeHole/); a sculpt's **type** is one of [PRIM_SCULPT_TYPE_*](/constants/groups/PrimTypeSculptType/), optionally combined with [PRIM_SCULPT_FLAG_*](/constants/groups/PrimTypeSculptFlag/). Has no effect on mesh. Forms:<ul><li>

`PRIM_TYPE, PRIM_TYPE_BOX, integer hole_shape, vector cut, float hollow, vector twist, vector top_size, vector top_shear`

</li><li>

`PRIM_TYPE, PRIM_TYPE_CYLINDER, integer hole_shape, vector cut, float hollow, vector twist, vector top_size, vector top_shear`

</li><li>

`PRIM_TYPE, PRIM_TYPE_PRISM, integer hole_shape, vector cut, float hollow, vector twist, vector top_size, vector top_shear`

</li><li>

`PRIM_TYPE, PRIM_TYPE_SPHERE, integer hole_shape, vector cut, float hollow, vector twist, vector dimple`

</li><li>

`PRIM_TYPE, PRIM_TYPE_TORUS, 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`

</li><li>

`PRIM_TYPE, PRIM_TYPE_TUBE, 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`

</li><li>

`PRIM_TYPE, PRIM_TYPE_RING, 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`

</li><li>

`PRIM_TYPE, PRIM_TYPE_SCULPT, string map, integer type`

</li></ul></td>
	</tr>
</table>

## Shared wiki article

This page transcludes [LlSetPrimitiveParams](https://wiki.secondlife.com/wiki/LlSetPrimitiveParams). The following text is from that archived revision.

## Caveats

- [PRIM_SIZE](/constants/PRIM_SIZE/) has similar constraints to [llSetScale](/functions/llSetScale/) and fails silently on physical prims/links. One workaround is to set items to non-physical before changing their size, then changing them back to physical; this can be accomplished in a single [llSetLinkPrimitiveParamsFast](/functions/llSetLinkPrimitiveParamsFast/) command using [PRIM_LINK_TARGET](/constants/PRIM_LINK_TARGET/).
- [PRIM_PHANTOM](/constants/PRIM_PHANTOM/), [PRIM_PHYSICS](/constants/PRIM_PHYSICS/) and [PRIM_TEMP_ON_REZ](/constants/PRIM_TEMP_ON_REZ/) applies to the entire object ([linkset](https://wiki.secondlife.com/wiki/Link#link-set)).
- Values may drift, become truncated or be range-limited. Some limits are applied by the client during deserialization and before rendering, others are applied by the simulator before storing the values.
- When testing [vector](https://wiki.secondlife.com/wiki/vector)s and [rotation](https://wiki.secondlife.com/wiki/rotation)s use [llVecDist](/functions/llVecDist/) and [llAngleBetween](/functions/llAngleBetween/) (respectively) to perform fuzzy tests.
- [PRIM_LINK_TARGET](/constants/PRIM_LINK_TARGET/) is a special parameter which can be inserted to perform actions on multiple prims on the [linkset](https://wiki.secondlife.com/wiki/Link#link-set) with one call.
- Scripts written before September 2004 that use [PRIM_TYPE](/constants/PRIM_TYPE/) depend on [PRIM_TYPE](/constants/PRIM_TYPE/) to have the value 1; if these scripts are recompiled, the new value of `PRIM_TYPE` will be used, causing errors at runtime.
- To fix this, replace the [PRIM_TYPE](/constants/PRIM_TYPE/) flag with the value 1 or update to the newer [PRIM_TYPE](/constants/PRIM_TYPE/) syntax.
- [PRIM_ROTATION](/constants/PRIM_ROTATION/) is bugged in child prims. See [Useful Snippets](https://wiki.secondlife.com/wiki/LlSetPrimitiveParams) for a workaround, or the linked SVC-93 issue below.
- This function will return an error if given data of the wrong type. This is problematic when providing data from user input or notecard. To remedy this, see [List Cast](https://wiki.secondlife.com/wiki/list_cast) function.
- Applying an operation to [LINK_SET](/constants/LINK_SET/) will apply it first to the root prim, then to each child prim.
- The sim will clamp attributes before storing them.
- The client will clamp attributes before rendering.
- **Some prim properties are reset** by this function
- A flexible prim will become not flexible
- A sliced prim will become unsliced
- : In order to preserve properties they must be saved and explicitly set in the function call

:::note
When wanting to change the alpha value of a face, please consider using [llSetLinkAlpha](/functions/llSetLinkAlpha/)(integer link, float alpha, integer face); instead of [llSetLinkPrimitiveParamsFast](/functions/llSetLinkPrimitiveParamsFast/)(integer link, \[ [PRIM_COLOR](/constants/PRIM_COLOR/), integer face, vector color, float alpha \]);, that way you don't have to mess with the color settings. Also don't expect [llSetLinkPrimitiveParamsFast](/functions/llSetLinkPrimitiveParamsFast/) being faster than [llSetText](/functions/llSetText/) when setting a float text property within a loop like at "% loading" status bars. Measurements showed [llSetText](/functions/llSetText/) being 3-4 times faster. That also might applies for similar functions.
:::

- Attempting to change [PRIM_TYPE](/constants/PRIM_TYPE/) of a [mesh](https://wiki.secondlife.com/wiki/mesh) object has no effect.
- Keeping the [PRIM_TYPE](/constants/PRIM_TYPE/) as [PRIM_TYPE_SCULPT](/constants/PRIM_TYPE_SCULPT/) and trying to set a different sculpt map or sculpt flags on a mesh also does nothing. Additionally, a script residing inside a mesh type prim cannot change the sculpt parameters of *any* prim in the linkset.
- The caveats described at [llSetClickAction](/functions/llSetClickAction/#caveats) all apply to [PRIM_CLICK_ACTION](/constants/PRIM_CLICK_ACTION/).

## Examples

<details open>
<summary>A simple script to light up a prim in a [linkset](https://wiki.secondlife.com/wiki/Link#link-set) when touched, and unlight the others using llSetLinkPrimitiveParams, when script is installed in the root prim of the linkset.</summary>

```lsl
// Turn all prims off and the one touched turn on

default
{
    touch_start(integer num_detected)
    {
        llSetLinkPrimitiveParamsFast(LINK_SET, [
                PRIM_FULLBRIGHT, ALL_SIDES, FALSE,
            PRIM_LINK_TARGET, llDetectedLinkNumber(0),
                PRIM_FULLBRIGHT, ALL_SIDES, TRUE]);
    }
}
```

</details>

<details>
<summary>A simple script which moves all child prims .25m forward on the root's Z axis, when touched.</summary>

```lsl collapse={1-27}
default
{
    touch_start(integer total_number)
    {
        integer numberOfPrims = llGetNumberOfPrims();

        if (numberOfPrims < 2) return;

        vector  link_pos;
        list    params;

        integer link = 2;// start with first child prim
        do
        {
//          get a child prim's local position (i.e, relative to the root prim)
            link_pos = llList2Vector(llGetLinkPrimitiveParams(link, [PRIM_POS_LOCAL]), 0);

            link_pos.z += 0.25;// relative to root's local z-axis !!!

            params += [PRIM_LINK_TARGET, link,
                            PRIM_POS_LOCAL, link_pos];
        }
        while (++link <= numberOfPrims);

        if (!llGetListLength(params)) return;

//      the params list starts with a PRIM_LINK_TARGET (a hack so we can start
//      with the first child prim), so it doesn't really matter which number you
//      put as first parameter in this function call
        llSetLinkPrimitiveParamsFast(2, params);
    }
}
```

</details>

<details>
<summary>Example 3</summary>

:::note
You can use one function call instead of two when making use of [PRIM_LINK_TARGET](/constants/PRIM_LINK_TARGET/).
:::

<table>
	<tr>
		<th>**Preferred method using [PRIM_LINK_TARGET](/constants/PRIM_LINK_TARGET/)**</th>
		<th>**Second method does the same effect-wise.**</th>
	</tr>
	<tr>
		<td>

			```lsl
			//  color the root prim red and the first linked-prim green

			default
			{
			    touch_start(integer num_detected)
			    {
			        llSetLinkPrimitiveParamsFast(LINK_ROOT, [
			                PRIM_COLOR, ALL_SIDES, <1.0, 0.0, 0.0>, 1.0,
			            PRIM_LINK_TARGET, 2,
			                PRIM_COLOR, ALL_SIDES, <0.0, 1.0, 0.0>, 1.0]);
			    }
			}
			```

		</td>
		<td>

			```lsl
			//  color the root prim red and the first linked-prim green

			default
			{
			    touch_start(integer num_detected)
			    {
			        llSetLinkPrimitiveParamsFast(LINK_ROOT, [
			                PRIM_COLOR, ALL_SIDES, <1.0, 0.0, 0.0>, 1.0]);
			        llSetLinkPrimitiveParamsFast(2, [
			                PRIM_COLOR, ALL_SIDES, <0.0, 1.0, 0.0>, 1.0]);
			    }
			}
			```

		</td>
	</tr>
</table>

<table>
	<tr>
		<th>**Combining function calls**</th>
	</tr>
	<tr>
		<td>

			```lsl
			// Combined function calls

			default
			{
			    touch_start(integer num_detected)
			    {
			        // color prim faces, set texture and set fullbright
			        llSetPrimitiveParams([
			            PRIM_COLOR, ALL_SIDES, ZERO_VECTOR, 1.0,
			            PRIM_COLOR, 3, <1.0, 1.0, 1.0>, 1.0,
			            PRIM_TEXTURE, 3, "4d304955-2b01-c6c6-f545-c1ae1e618288", <1.0, 1.0, 0.0>, ZERO_VECTOR, 0.0,
			            PRIM_FULLBRIGHT, 3, TRUE]);
			    }
			}
			```

		</td>
	</tr>
	<tr>
		<td>

			```lsl
			// Single function calls

			default
			{
			    touch_start(integer num_detected)
			    {
			        // color prim faces
			        llSetPrimitiveParams([
			            PRIM_COLOR, ALL_SIDES, ZERO_VECTOR, 1,
			            PRIM_COLOR, 3, <1.0, 1.0, 1.0>, 1.0]);

			        // set texture
			        llSetPrimitiveParams([
			            PRIM_TEXTURE, 3, "4d304955-2b01-c6c6-f545-c1ae1e618288", <1.0, 1.0, 0.0>, ZERO_VECTOR, 0.0]);

			        // set fullbright
			        llSetPrimitiveParams([
			            PRIM_FULLBRIGHT, 3, TRUE]);
			    }
			}
			```

		</td>
	</tr>
</table>

```lsl
// And if you want to place it above your bed, to make you sleep well, and the coords
// of that place are, for example, <x, y, z>
llSetPrimitiveParams([
    PRIM_COLOR, ALL_SIDES, ZERO_VECTOR, 1.0,
    PRIM_COLOR, 3, <1.0,1.0,1.0>, 1.0,
    PRIM_TEXTURE, 3, "4d304955-2b01-c6c6-f545-c1ae1e618288", <1.0, 1.0, 0.0>, ZERO_VECTOR,0.0,
    PRIM_FULLBRIGHT, 3, TRUE,
    PRIM_POSITION, <x, y, z>]);

// You can set the texture of several sides at once, with no time penalty,
// just by repeating the param for that:
llSetPrimitiveParams([
    PRIM_TEXTURE, 3, "4d304955-2b01-c6c6-f545-c1ae1e618288", <1.0, 1.0, 0.0>, ZERO_VECTOR, 0.0,
    PRIM_TEXTURE, 4, "4d304955-2b01-c6c6-f545-c1ae1e618288", <1.0, 1.0, 0.0>, ZERO_VECTOR, 0.0]);
```

</details>

<details>
<summary>Example 4</summary>

### Top-size (taper)

```lsl
default
{
    state_entry()
    {
        vector scale = llGetScale();
        float  X     = scale.x;
        float  Y     = scale.y;

        llSetPrimitiveParams([
            PRIM_SIZE, <X, Y, 0.1>, // keep the prim thin
            PRIM_TYPE, PRIM_TYPE_BOX, 0, <0.0,1.0,0.0>, 0.0, ZERO_VECTOR,
                <1.0 - (0.4 / X), 1.0 - (0.4 / Y), 0.0>, ZERO_VECTOR]);
        // We used the equation "answer = 1 - desired_taper"

        // The proportions of the top-size (taper) will be maintained (as close as possible)
        // whenever the prim is resized. The proportion above will produce a reasonably
        // pleasing picture frame kinda thing.
    }

    changed(integer change)
    {
        if(change & CHANGED_SCALE)
        {
            llResetScript();
        }
    }
}
```

</details>

## Helper functions

```lsl
//-- PRIM_ROTATION workaround for child prims (works in unattached objects only)
llSetLinkPrimitiveParamsFast(linknumber, [
    PRIM_ROT_LOCAL, rot*llGetRootRotation()]);

//-- PRIM_ROTATION workaround for child prims (works in linked objects only)
llSetLinkPrimitiveParamsFast(linknumber, [
    PRIM_ROT_LOCAL, rot*llList2Rot(llGetLinkPrimitiveParams(LINK_ROOT, [PRIM_ROT_LOCAL]), 0)]);

//-- PRIM_ROTATION workaround for child prims (works in all scenarios)
llSetLinkPrimitiveParamsFast(linknumber, [
    PRIM_ROT_LOCAL, rot*llList2Rot(llGetLinkPrimitiveParams(!!llGetLinkNumber(), [PRIM_ROT_LOCAL]), 0)]);
```

## Notes

The old [PRIM_TYPE](/constants/PRIM_TYPE/) interface (labeled PRIM_TYPE_LEGACY), while technically retired, can still be used.

### [PRIM_POSITION](/constants/PRIM_POSITION/)

`{{#var:PRIM_POSITION/SLPP&A}}`

## History

- Date of release llSetLinkPrimitiveParams [21-02-2007](https://wiki.secondlife.com/wiki/Release_Notes/Second_Life_Release/1.13#release-notes-for-second-life-1-13-4-281-29-february-21-2c-2007) or [14-03-2007](https://wiki.secondlife.com/wiki/Release_Notes/Second_Life_Release/1.14)
- Date of release `llSetLinkPrimitiveParamsFast` [29-03-2010](https://wiki.secondlife.com/wiki/Release_Notes/Second_Life_Server/1.38#new-features)

## Known issues

From the issue templates included by the wiki article:

- SVC-2105 (nf): '''llSetLinkListPrimitiveParams'''() for setting multiple, specific linked items

## See also

### Functions

- [llGetPrimitiveParams](/functions/llGetPrimitiveParams/) — Get many primitive parameters
- [llGetLinkPrimitiveParams](/functions/llGetLinkPrimitiveParams/) — Get many primitive parameters of other prims in likset
- [llSetLinkPrimitiveParamsFast](/functions/llSetLinkPrimitiveParamsFast/) — Set parameters on other prims in linkset without sleep
- [llSetAlpha](/functions/llSetAlpha/) — Simpler way to set alpha (transparency) without (re-)setting color.
- [llSetTexture](/functions/llSetTexture/) — Simpler way to set texture
- [llSetColor](/functions/llSetColor/) — Simpler way to set color
- [llSetScale](/functions/llSetScale/) — Simpler way to set scale
- [llSetStatus](/functions/llSetStatus/) — Simpler way to set physics and phantom
- [llSetLinkGLTFOverrides](/functions/llSetLinkGLTFOverrides/) — Set or remove individual glTF material overrides on a face

### Articles

- [Internal Textures](https://wiki.secondlife.com/wiki/Internal_Textures)

---

*Source: [LlSetPrimitiveParams](https://wiki.secondlife.com/wiki/LlSetPrimitiveParams#llSetLinkPrimitiveParamsFast) on the Second Life Wiki. Content from the Second Life Wiki articles LlSetPrimitiveParams (revision 1218306, 2025-05-20), Template:Issues/SVC-2105 (revision 1168847, 2012-06-11), Template:LSL Function/link-face (revision 1186827, 2014-01-12) and Template:LSL PrimitiveParam Categorize (revision 1180644, 2013-08-09), CC BY-SA 3.0.*

---

From lsl.dev: https://lsl.dev/functions/llSetLinkPrimitiveParamsFast/
