# Prims

> Prim properties and primitive params: shape, size, appearance, light, text and inventory.

A prim is the basic building block of an object, whether a parametric shape, a sculpt or mesh. Each prim has properties: position, rotation and size; shape; faces with textures and colors; light, glow and text; physics settings; and its own inventory.

Primitive params read and write almost all of these in one call, as a list of `PRIM_*` rules followed by their values. Specific functions cover the common cases.

How prims are linked into objects is covered under [Linksets](/features/linkset/); what is drawn on each face under [Textures & Materials](/features/textures/).

## Concepts

- [Primitive params](/functions/llSetLinkPrimitiveParamsFast/) set rules on any prim; [`PRIM_LINK_TARGET`](/constants/PRIM_LINK_TARGET/) switches prims inside one list
  - Read them back [for any prim](/functions/llGetLinkPrimitiveParams/) or [for this prim](/functions/llGetPrimitiveParams/)
- Placement and scale: [position](/functions/llSetPos/), [rotation](/functions/llSetRot/), [size](/functions/llSetScale/) ([`PRIM_SIZE`](/constants/PRIM_SIZE/)), or [scale the whole object](/functions/llScaleByFactor/)
- [Shape](/constants/PRIM_TYPE/): parametric shapes (box, cylinder, prism, sphere, torus, tube, ring) take cut, hollow, twist and other parameters
  - Sculpts and mesh use the [sculpt type](/constants/PRIM_TYPE_SCULPT/)
- Faces: textures, [colors](/constants/PRIM_COLOR/), alpha, materials and media are set per face
  - [`ALL_SIDES`](/constants/ALL_SIDES/) applies to every face; count faces [here](/functions/llGetNumberOfSides/) or [on any prim](/functions/llGetLinkNumberOfSides/)
- Beyond the faces: [point light](/constants/PRIM_POINT_LIGHT/), [glow](/constants/PRIM_GLOW/), [hover text](/functions/llSetText/) and [flexible paths](/constants/PRIM_FLEXIBLE/)
- Prim [name](/functions/llSetObjectName/) and [description](/functions/llSetObjectDesc/), [touch](/functions/llSetTouchText/) and [sit](/functions/llSetSitText/) text, [click action](/functions/llSetClickAction/) and [pay price](/functions/llSetPayPrice/)
- Each prim holds inventory: scripts, notecards, textures, sounds, animations and objects
  - Scripts [list](/functions/llGetInventoryName/) and [inspect](/functions/llGetInventoryType/) it, [remove items](/functions/llRemoveInventory/), and react to [changes](/constants/CHANGED_INVENTORY/)
- Objects and inventory items carry next-owner permissions (copy, modify, transfer)
  - Scripts can [read them](/functions/llGetObjectPermMask/), and [transfer the object's ownership](/functions/llTransferOwnership/) in some cases

## Functions and events

- `void` [`llSetLinkPrimitiveParamsFast`](/functions/llSetLinkPrimitiveParamsFast/) `(integer link, list rules)`
- `list` [`llGetLinkPrimitiveParams`](/functions/llGetLinkPrimitiveParams/) `(integer link, list params)`
- `void` [`llSetPos`](/functions/llSetPos/) `(vector pos)`
- `void` [`llSetRot`](/functions/llSetRot/) `(rotation rot)`
- `void` [`llSetScale`](/functions/llSetScale/) `(vector size)`
- `void` [`llSetText`](/functions/llSetText/) `(string text, vector color, float alpha)`
- `string` [`llGetInventoryName`](/functions/llGetInventoryName/) `(integer type, integer index)`
- `integer` [`llGetObjectPermMask`](/functions/llGetObjectPermMask/) `(integer group)`
- `event` [`changed`](/events/changed/) `(integer changes)`

## [Primitive params](https://wiki.secondlife.com/wiki/Category:LSL_PrimitiveParams)

A rule list is `PRIM_*` constants each followed by their values; one call can change many properties on many prims.

## [Prim inventory](https://wiki.secondlife.com/wiki/Category:LSL_Inventory)

Each prim holds its own inventory; a linked prim's inventory is separate from its siblings. Scripts list and inspect it, [give](/functions/llGiveInventory/) or [remove](/functions/llRemoveInventory/) items, and react to changes.

## Scripting Details

- `void` [`llSetLinkPrimitiveParamsFast`](/functions/llSetLinkPrimitiveParamsFast/) `(integer link, list rules)`: Sets primitive parameters for the linked prim link according to rules with no built-in script sleep delay.
- `list` [`llGetLinkPrimitiveParams`](/functions/llGetLinkPrimitiveParams/) `(integer link, list params)`: Returns a list of primitive parameters requested in params for the linked prim specified by link (equivalent to llGetPrimitiveParams).
- `list` [`llGetPrimitiveParams`](/functions/llGetPrimitiveParams/) `(list params)`: Returns a list of primitive attribute values matching the requested params list.
- `void` [`llSetPos`](/functions/llSetPos/) `(vector pos)`: Moves the non-physical object or prim toward the vector pos (up to 10m). If called in a child prim, pos is treated as root-relative; if called from the root prim, the entire object is moved.
- `void` [`llSetRot`](/functions/llSetRot/) `(rotation rot)`: Sets the rotation of the prim to rot. If in a child prim, rot is treated as root-relative; if in the root prim of a non-physical object, rotates the entire object.
- `void` [`llSetScale`](/functions/llSetScale/) `(vector size)`: Sets the physical scale (dimensions) of the prim containing the script to size.
- `vector` [`llGetScale`](/functions/llGetScale/) `()`: Returns a vector representing the physical scale (dimensions in meters) of the prim containing the script.
- `integer` [`llScaleByFactor`](/functions/llScaleByFactor/) `(float scaling_factor)`: Attempts to uniformly resize the entire object by scaling_factor, maintaining size-position ratios of the prims. Fails if the linkset is physical, a pathfinding character, in keyframed motion, would exceed prim scale/linkability limits, or would overflow parcel capacity.
- `integer` [`llGetNumberOfSides`](/functions/llGetNumberOfSides/) `()`: Returns an integer representing the total number of sides (faces) of the prim containing the script.
- `integer` [`llGetLinkNumberOfSides`](/functions/llGetLinkNumberOfSides/) `(integer link)`: Returns an integer representing the number of sides (faces) of the linked prim specified by link.
- `void` [`llSetText`](/functions/llSetText/) `(string text, vector color, float alpha)`: Displays floating text above the prim with the specified color vector and transparency alpha.
- `void` [`llSetObjectName`](/functions/llSetObjectName/) `(string name)`: Sets the name of the prim containing the script to name.
- `string` [`llGetObjectName`](/functions/llGetObjectName/) `()`: Returns a string containing the name of the specific prim containing the script.
- `void` [`llSetObjectDesc`](/functions/llSetObjectDesc/) `(string description)`: Sets the description of the prim containing the script to description (limited to 127 characters).
- `string` [`llGetObjectDesc`](/functions/llGetObjectDesc/) `()`: Returns a string containing the description of the specific prim containing the script.
- `void` [`llSetTouchText`](/functions/llSetTouchText/) `(string text)`: Displays the string text instead of 'Touch' in the right-click context menu.
- `void` [`llSetSitText`](/functions/llSetSitText/) `(string text)`: Displays the string text instead of 'Sit' (or 'Sit Here') in the viewer's right-click context menu.
- `void` [`llSetClickAction`](/functions/llSetClickAction/) `(integer action)`: Sets the action (a CLICK_ACTION_* flag) performed when an avatar left-clicks the prim.
- `void` [`llSetPayPrice`](/functions/llSetPayPrice/) `(integer price, list quick_pay_buttons)`: Suggests default amounts for the pay text input field price and the four payment dialog quick_pay_buttons when an avatar pays this object.
- `key` [`llGetKey`](/functions/llGetKey/) `()`: Returns the key (UUID) of the prim containing the script.
- `integer` [`llGetInventoryNumber`](/functions/llGetInventoryNumber/) `(integer type)`: Returns the count of items of the specified type (INVENTORY_*) in the prim's inventory.
- `string` [`llGetInventoryName`](/functions/llGetInventoryName/) `(integer type, integer index)`: Returns the name of the inventory item of the specified type (INVENTORY_*) at the specified inventory index.
- `integer` [`llGetInventoryType`](/functions/llGetInventoryType/) `(string item)`: Returns an integer representing the INVENTORY_* type of the named inventory item.
- `key` [`llGetInventoryKey`](/functions/llGetInventoryKey/) `(string item)`: Returns the key (UUID) of the specified inventory item.
- `key` [`llGetInventoryCreator`](/functions/llGetInventoryCreator/) `(string item)`: Returns the key (UUID) of the creator of the specified inventory item.
- `string` [`llGetInventoryDesc`](/functions/llGetInventoryDesc/) `(string item)`: Returns the description string of the specified inventory item.
- `string` [`llGetInventoryAcquireTime`](/functions/llGetInventoryAcquireTime/) `(string item)`: Returns the time when the item was placed in the prim's inventory, as a UTC timestamp string of the form "YYYY-MM-DDThh:mm:ssZ"
- `key` [`llRequestInventoryData`](/functions/llRequestInventoryData/) `(string item)`: Asynchronously requests data for the named inventory item, triggering a dataserver event. Currently, only landmark items are supported (which return local region coordinates). Returns a key query handle.
- `void` [`llRemoveInventory`](/functions/llRemoveInventory/) `(string item)`: Permanently deletes the named inventory item from the prim's inventory.
- `void` [`llAllowInventoryDrop`](/functions/llAllowInventoryDrop/) `(integer add)`: If add is TRUE, allows users without object modify permissions to drop inventory items into the prim. If FALSE, restricts inventory dropping to users with modify permissions.
- `void` [`llRemoteLoadScriptPin`](/functions/llRemoteLoadScriptPin/) `(key target, string script, integer pin, integer running, integer start_param)`: Copies the script into target, setting it running (if running is TRUE) with the start_param, provided the script owner has modify permissions on target and target's PIN matches pin (set via llSetRemoteScriptAccessPin).
- `void` [`llSetRemoteScriptAccessPin`](/functions/llSetRemoteScriptAccessPin/) `(integer pin)`: Sets the prim's remote script access PIN to pin (a non-zero value enables loading via llRemoteLoadScriptPin, while zero disables it).
- `integer` [`llGetObjectPermMask`](/functions/llGetObjectPermMask/) `(integer group)`: Returns the script's object's permission flags for the specified group.
- `void` [`llSetObjectPermMask`](/functions/llSetObjectPermMask/) `(integer group, integer flags)`: Sets the scripts's object's permission flags for the specified group.
- `integer` [`llGetInventoryPermMask`](/functions/llGetInventoryPermMask/) `(string item, integer group)`: Returns the specified item's permission flags for the specified group.
- `void` [`llSetInventoryPermMask`](/functions/llSetInventoryPermMask/) `(string item, integer group, integer flags)`: Sets the specified item's permission flags for the specified group.
- `integer` [`llTransferOwnership`](/functions/llTransferOwnership/) `(key agent, integer flags, list options)`: Transfers ownership of the object (or a copy of it, depending on Flags) to the specified agent. Returns an integer indicating the success or failure of the transfer.
- `key` [`llGetCreator`](/functions/llGetCreator/) `()`: Returns the key (UUID) of the prim's original creator.
- `key` [`llGetOwner`](/functions/llGetOwner/) `()`: Returns the key (UUID) of the object's current owner.

## Additional

- [`llSetLinkPrimitiveParamsFast`](/functions/llSetLinkPrimitiveParamsFast/) — common rules ([`PrimParam`](/constants/groups/PrimParam/), read with [`PrimParamGet`](/constants/groups/PrimParamGet/))
  - [`PRIM_LINK_TARGET`](/constants/PRIM_LINK_TARGET/) — Switch to another prim within the same list
  - [`PRIM_SIZE`](/constants/PRIM_SIZE/), [`PRIM_POSITION`](/constants/PRIM_POSITION/), [`PRIM_POS_LOCAL`](/constants/PRIM_POS_LOCAL/), [`PRIM_ROTATION`](/constants/PRIM_ROTATION/) — Size and placement
  - [`PRIM_TYPE`](/constants/PRIM_TYPE/) — Shape type and its parameters ([`PrimType`](/constants/groups/PrimType/), [`PrimTypeHole`](/constants/groups/PrimTypeHole/)); [`PRIM_TYPE_SCULPT`](/constants/PRIM_TYPE_SCULPT/) with a [sculpt type](/constants/groups/PrimTypeSculptType/) such as [`PRIM_SCULPT_TYPE_MESH`](/constants/PRIM_SCULPT_TYPE_MESH/) and [flags](/constants/groups/PrimTypeSculptFlag/)
  - [`PRIM_TEXTURE`](/constants/PRIM_TEXTURE/), [`PRIM_COLOR`](/constants/PRIM_COLOR/) — Per-face texture and color, with a face number or [`ALL_SIDES`](/constants/ALL_SIDES/) ([`Faces`](/constants/groups/Faces/))
  - [`PRIM_POINT_LIGHT`](/constants/PRIM_POINT_LIGHT/) — Local light: color, intensity, radius and falloff
  - [`PRIM_GLOW`](/constants/PRIM_GLOW/) — Glow intensity on a face
  - [`PRIM_TEXT`](/constants/PRIM_TEXT/) — Hover text, like [`llSetText`](/functions/llSetText/)
  - [`PRIM_FLEXIBLE`](/constants/PRIM_FLEXIBLE/) — Flexible path: softness, gravity, friction, wind, tension and force
  - [`PRIM_NAME`](/constants/PRIM_NAME/), [`PRIM_DESC`](/constants/PRIM_DESC/), [`PRIM_CLICK_ACTION`](/constants/PRIM_CLICK_ACTION/) — Name, description and click action
- [`llGetInventoryNumber`](/functions/llGetInventoryNumber/) and [`llGetInventoryName`](/functions/llGetInventoryName/) — filter by type ([`InventoryType`](/constants/groups/InventoryType/)), such as [`INVENTORY_ALL`](/constants/INVENTORY_ALL/) or [`INVENTORY_SCRIPT`](/constants/INVENTORY_SCRIPT/)
- [`changed`](/events/changed/) — inventory changes
  - [`CHANGED_INVENTORY`](/constants/CHANGED_INVENTORY/) — Changed by someone with modify rights
  - [`CHANGED_ALLOWED_DROP`](/constants/CHANGED_ALLOWED_DROP/) — Someone else dropped an item, possible only with [`llAllowInventoryDrop`](/functions/llAllowInventoryDrop/)
  - [`CHANGED_SHAPE`](/constants/CHANGED_SHAPE/), [`CHANGED_SCALE`](/constants/CHANGED_SCALE/), [`CHANGED_OWNER`](/constants/CHANGED_OWNER/) — Shape, scale or owner changed
- [`llRemoteLoadScriptPin`](/functions/llRemoteLoadScriptPin/) — copies a script into a prim whose PIN was set with [`llSetRemoteScriptAccessPin`](/functions/llSetRemoteScriptAccessPin/)
- [`llGetObjectPermMask`](/functions/llGetObjectPermMask/) and [`llGetInventoryPermMask`](/functions/llGetInventoryPermMask/) — permission flags ([`AssetPermission`](/constants/groups/AssetPermission/)) per category ([`AssetPermissionCategory`](/constants/groups/AssetPermissionCategory/), [flags](/constants/groups/AssetPermissionCategoryFlag/))
  - [`PERM_COPY`](/constants/PERM_COPY/), [`PERM_MODIFY`](/constants/PERM_MODIFY/), [`PERM_TRANSFER`](/constants/PERM_TRANSFER/) — Copy, modify and transfer
  - [`MASK_OWNER`](/constants/MASK_OWNER/), [`MASK_NEXT`](/constants/MASK_NEXT/) — Current owner and next owner
- [`llTransferOwnership`](/functions/llTransferOwnership/) — transfers the object or a copy ([`TransferOwnershipFlag`](/constants/groups/TransferOwnershipFlag/))
- [`llGetObjectDetails`](/functions/llGetObjectDetails/) — [`OBJECT_TOTAL_INVENTORY_COUNT`](/constants/OBJECT_TOTAL_INVENTORY_COUNT/) counts inventory items in another object with the same owner

## Constant groups

Constant groups: [PrimParam](/constants/groups/PrimParam/) (43), [PrimParamGet](/constants/groups/PrimParamGet/) (41), [PrimType](/constants/groups/PrimType/) (8), [PrimTypeHole](/constants/groups/PrimTypeHole/) (4), [PrimTypeSculptType](/constants/groups/PrimTypeSculptType/) (6), [PrimTypeSculptFlag](/constants/groups/PrimTypeSculptFlag/) (3), [Faces](/constants/groups/Faces/) (1), [InventoryType](/constants/groups/InventoryType/) (14), [AssetPermission](/constants/groups/AssetPermission/) (5), [AssetPermissionCategory](/constants/groups/AssetPermissionCategory/) (5), [AssetPermissionCategoryFlag](/constants/groups/AssetPermissionCategoryFlag/) (1), [TransferOwnershipFlag](/constants/groups/TransferOwnershipFlag/) (3)

## Related

See also: [LSL PrimitiveParams (Second Life Wiki)](https://wiki.secondlife.com/wiki/Category:LSL_PrimitiveParams), [Script library: prims (Second Life Wiki)](https://wiki.secondlife.com/wiki/CatPrims), [Inventory](/features/inventory/), [Movement](/features/movement/), [Linksets](/features/linkset/), [Textures & Materials](/features/textures/), [Effects](/features/effects/), [Prim Properties](/categories/prim_properties/), [Prim Inventory](/categories/prim_inventory/), [LSL Inventory (Second Life Wiki)](https://wiki.secondlife.com/wiki/Category:LSL_Inventory), [Asset Permissions](/categories/asset_permissions/), [Prim Target](/categories/prim/), [LSL Prim (Second Life Wiki)](https://wiki.secondlife.com/wiki/Category:LSL_Prim)
   (planned: Guide: primitive params rule lists)

## Related features

- [Linksets](/features/linkset/)
- [Textures & Materials](/features/textures/)
- [Physics](/features/physics/)
- [Effects](/features/effects/)

## Categories

- [Prim Target](/categories/prim/)
- [Prim Properties](/categories/prim_properties/)
- [Asset Permissions](/categories/asset_permissions/)

---

From lsl.dev: https://lsl.dev/features/prims/
