Prims
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; what is drawn on each face under Textures & Materials.
Concepts
- Primitive params set rules on any prim;
PRIM_LINK_TARGETswitches prims inside one list- Read them back for any prim or for this prim
- Placement and scale:
position,rotation,size(PRIM_SIZE), or scale the whole object Shape: parametric shapes (box, cylinder, prism, sphere, torus, tube, ring) take cut, hollow, twist and other parameters- Sculpts and mesh use the sculpt type
- Faces: textures,
colors, alpha, materials and media are set per faceALL_SIDESapplies to every face; count faceshereor on any prim
- Beyond the faces: point light,
glow, hover text and flexible paths - Prim
nameanddescription,touchandsittext, click action and pay price - Each prim holds inventory: scripts, notecards, textures, sounds, animations and objects
- Scripts
listandinspectit, remove items, and react tochanges
- Scripts
- Objects and inventory items carry next-owner permissions (copy, modify, transfer)
- Scripts can read them, and transfer the object’s ownership in some cases
Functions and events
void | llSetLinkPrimitiveParamsFast(integer link, list rules) |
list | llGetLinkPrimitiveParams(integer link, list params) |
void | llSetPos(vector pos) |
void | llSetRot(rotation rot) |
void | llSetScale(vector size) |
void | llSetText(string text, vector color, float alpha) |
string | llGetInventoryName(integer type, integer index) |
integer | llGetObjectPermMask(integer group) |
event | changed(integer changes) |
Primitive params
A rule list is PRIM_* constants each followed by their values; one call can change many properties on many prims.
Prim inventory
Scripting Details
void | 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(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(list params)Returns a list of primitive attribute values matching the requested params list. |
void | 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(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(vector size)Sets the physical scale (dimensions) of the prim containing the script to size. |
vector | llGetScale()Returns a vector representing the physical scale (dimensions in meters) of the prim containing the script. |
integer | 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()Returns an integer representing the total number of sides (faces) of the prim containing the script. |
integer | llGetLinkNumberOfSides(integer link)Returns an integer representing the number of sides (faces) of the linked prim specified by link. |
void | llSetText(string text, vector color, float alpha)Displays floating text above the prim with the specified color vector and transparency alpha. |
void | llSetObjectName(string name)Sets the name of the prim containing the script to name. |
string | llGetObjectName()Returns a string containing the name of the specific prim containing the script. |
void | llSetObjectDesc(string description)Sets the description of the prim containing the script to description (limited to 127 characters). |
string | llGetObjectDesc()Returns a string containing the description of the specific prim containing the script. |
void | llSetTouchText(string text)Displays the string text instead of 'Touch' in the right-click context menu. |
void | llSetSitText(string text)Displays the string text instead of 'Sit' (or 'Sit Here') in the viewer's right-click context menu. |
void | llSetClickAction(integer action)Sets the action (a CLICK_ACTION_* flag) performed when an avatar left-clicks the prim. |
void | 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()Returns the key (UUID) of the prim containing the script. |
integer | llGetInventoryNumber(integer type)Returns the count of items of the specified type (INVENTORY_*) in the prim's inventory. |
string | llGetInventoryName(integer type, integer index)Returns the name of the inventory item of the specified type (INVENTORY_*) at the specified inventory index. |
integer | llGetInventoryType(string item)Returns an integer representing the INVENTORY_* type of the named inventory item. |
key | llGetInventoryKey(string item)Returns the key (UUID) of the specified inventory item. |
key | llGetInventoryCreator(string item)Returns the key (UUID) of the creator of the specified inventory item. |
string | llGetInventoryDesc(string item)Returns the description string of the specified inventory item. |
string | 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(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(string item)Permanently deletes the named inventory item from the prim's inventory. |
void | 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(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(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(integer group)Returns the script's object's permission flags for the specified group. |
void | llSetObjectPermMask(integer group, integer flags)Sets the scripts's object's permission flags for the specified group. |
integer | llGetInventoryPermMask(string item, integer group)Returns the specified item's permission flags for the specified group. |
void | llSetInventoryPermMask(string item, integer group, integer flags)Sets the specified item's permission flags for the specified group. |
integer | 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()Returns the key (UUID) of the prim's original creator. |
key | llGetOwner()Returns the key (UUID) of the object's current owner. |
Additional
llSetLinkPrimitiveParamsFast— common rules (PrimParam, read withPrimParamGet)PRIM_LINK_TARGET— Switch to another prim within the same listPRIM_SIZE,PRIM_POSITION,PRIM_POS_LOCAL,PRIM_ROTATION— Size and placementPRIM_TYPE— Shape type and its parameters (PrimType,PrimTypeHole);PRIM_TYPE_SCULPTwith a sculpt type such asPRIM_SCULPT_TYPE_MESHand flagsPRIM_TEXTURE,PRIM_COLOR— Per-face texture and color, with a face number orALL_SIDES(Faces)PRIM_POINT_LIGHT— Local light: color, intensity, radius and falloffPRIM_GLOW— Glow intensity on a facePRIM_TEXT— Hover text, likellSetTextPRIM_FLEXIBLE— Flexible path: softness, gravity, friction, wind, tension and forcePRIM_NAME,PRIM_DESC,PRIM_CLICK_ACTION— Name, description and click action
llGetInventoryNumberandllGetInventoryName— filter by type (InventoryType), such asINVENTORY_ALLorINVENTORY_SCRIPTchanged— inventory changesCHANGED_INVENTORY— Changed by someone with modify rightsCHANGED_ALLOWED_DROP— Someone else dropped an item, possible only withllAllowInventoryDropCHANGED_SHAPE,CHANGED_SCALE,CHANGED_OWNER— Shape, scale or owner changed
llRemoteLoadScriptPin— copies a script into a prim whose PIN was set withllSetRemoteScriptAccessPinllGetObjectPermMaskandllGetInventoryPermMask— permission flags (AssetPermission) per category (AssetPermissionCategory, flags)PERM_COPY,PERM_MODIFY,PERM_TRANSFER— Copy, modify and transferMASK_OWNER,MASK_NEXT— Current owner and next owner
llTransferOwnership— transfers the object or a copy (TransferOwnershipFlag)llGetObjectDetails—OBJECT_TOTAL_INVENTORY_COUNTcounts inventory items in another object with the same owner
Constant groups
Section titled “Constant groups”Constant groups PrimParam 43PrimParamGet 41PrimType 8PrimTypeHole 4PrimTypeSculptType 6PrimTypeSculptFlag 3Faces 1InventoryType 14AssetPermission 5AssetPermissionCategory 5AssetPermissionCategoryFlag 1TransferOwnershipFlag 3
Related
Section titled “Related”See also SL Wiki LSL PrimitiveParamsSL Wiki Script library: primsFeature InventoryFeature MovementFeature LinksetsFeature Textures & MaterialsFeature EffectsCategory Prim PropertiesCategory Prim InventorySL Wiki LSL InventoryCategory Asset PermissionsCategory Prim TargetSL Wiki LSL PrimPlanned Guide: primitive params rule lists