Scripted Appearance

Change a face, read its current values, and test texture mapping in World.

Check both sides of an update
These features require a Scripter compiler and World build that support them together. A function appearing in the generated reference means the compiler knows its mapping; it does not establish that every host implements it or that the latest code is deployed. Check the scripting release notes and field-test status when trying a newly added feature.

Set a color

LSL color vectors list red, green and blue, with each component normally between 0 and 1. For example, llSetColor(<0.2, 0.5, 1.0>, ALL_SIDES); sets a blue color. llSetText and llSetLinkColor use the same vector convention. Native scripts can supply RGB objects such as { r: 0.2, g: 0.5, b: 1 }. Supply all three finite numbers.

Choose the prim and face explicitly

llSetPrimitiveParams and llGetPrimitiveParams start with the prim containing the script. Their linked variants let you choose another member of a linkset. Use LINK_THIS for the scripted prim or a positive link number for one member. A root in a linkset is link 1; a standalone, unlinked prim has link number 0.

Faces are numbered from 0. Use the shape's actual face count; a cut or hollow prim can expose different faces from an ordinary box. ALL_SIDES applies a supported face rule across the prim. PRIM_LINK_TARGET changes the target for following rules in a setter list, so a single call can update several linked members.

Appearance values you can read back

Query ruleValues returned for one face or primWhat to check
PRIM_TEXTURE, faceTexture reference, repeats vector, offsets vector, rotationRotation is in radians. References can be asset identifiers or native texture paths.
PRIM_COLOR, faceRGB vector, alphaColour components and individual-face alpha use 0–1 values.
PRIM_FULLBRIGHT, faceInteger flagFullbright makes the surface ignore scene lighting.
PRIM_GLOW, faceGlow valueA visible halo also depends on the scene's rendering effects. Glow is not a light source.
PRIM_TEXGEN, faceProjection modeDefault and planar are supported on eligible generated prims; see the limits below.
PRIM_TEXTText string, RGB vector, alphaThis is floating text on the prim, not text painted into a texture. Empty or invisible text still has values.
PRIM_TYPEA shape-specific parameter tupleTuple length depends on shape. Readback alone does not prove that every cut or surface renders correctly.

Query results follow the order of the requested rules. Face rules queried with ALL_SIDES can return several tuples, so do not parse them as one face. The scalar helpers behave differently: llGetColor(ALL_SIDES) averages face colours, while llGetAlpha(ALL_SIDES) sums face alpha and can exceed 1. Query individual faces when you need their exact values.

This is a selected, recently updated set of rules, not a promise that every PRIM_* rule is implemented. See the function reference and constants reference for compiler mappings.

Legacy shininess and bump rules

PRIM_BUMP_SHINY uses face, shiny, bump in setters; a query returns shiny, bump for each selected face. Use the named PRIM_SHINY_NONE/LOW/MEDIUM/HIGH values (0–3), not a material slider's numeric intensity. Standard-material shininess with PRIM_BUMP_NONE requires both World #1688 and Scripter #153, followed by fresh compilation of the original LSL. Merged source does not confirm server deployment; check the World and compiler builds actually in use. Other legacy bump patterns and PBR visual semantics are not complete; recognized constants alone do not imply rendering support.

// On a disposable prim with a Standard material:
llSetPrimitiveParams([PRIM_BUMP_SHINY, ALL_SIDES, PRIM_SHINY_MEDIUM, PRIM_BUMP_NONE]);
list values = llGetPrimitiveParams([PRIM_BUMP_SHINY, 0]);
// values contains the legacy shiny enum followed by the bump enum.

Keep texture coordinates in texture space

With the paired texture-query compiler and World update, llGetTexture(face) returns a matching texture name from the scripted prim's inventory, or otherwise its stored UUID or native texture reference. Native paths and URLs are permitted; do not assume the answer is always a UUID. ALL_SIDES selects face 0, while an invalid face or a native face with no texture returns NULL_KEY. World currently follows OpenSim identity exposure, without SL's object-permission UUID masking; this is not full SL parity. The reference preview bridge can delegate to a host identity query; its material-only fallback returns the available texture URL and cannot reproduce inventory-name lookup or permission rules.

A PRIM_TEXTURE setter takes face, texture, repeats, offsets, rotation. The X and Y components of the two vectors mean U and V; they are not world coordinates. Do not swap them to compensate for World's Y-up scene. Negative repeats mirror a texture. The coordinate-frame conversion for spatial vectors does not apply to these UV values.

A successful readback confirms the requested texture values, but an image may still be loading. Check the rendered face too: a missing asset, its transparency, backface culling, or a different projection can change what you see without changing the query result.

Default and planar projection

The raw repeats returned by PRIM_TEXTURE do not change when you switch modes. Keep that distinction in mind when comparing script values with a control labelled “repeats per metre.” Supported scripted resizing and shape regeneration retain the live projection recipe.

Current projection limits
Default/planar switching requires generated prim geometry with face mapping data. Imported meshes or sculpts without that data are unsupported. Cylindrical and spherical projection, arbitrary mesh UV editing, and interactive HUD/form region authoring are not supplied by this rule. Planar orientation and shared seams can still differ from SL on some shapes; matching numeric values are not a guarantee of matching pixels.

Try a held projection comparison

Put this script in a disposable generated box and assign a numbered grid or another recognisable texture to face 0 first. Each touch holds the next mode so you can inspect it. The third touch restores the original mode; texture, repeats and offsets are left as they were. Keep the script running through all three touches: resetting it takes a new initial snapshot.

integer originalMode;
integer step = 0;

default
{
    state_entry()
    {
        list values = llGetPrimitiveParams([PRIM_TEXGEN, 0]);
        originalMode = llList2Integer(values, 0);
        llOwnerSay("Touch for default, planar, then restore.");
    }

    touch_start(integer count)
    {
        ++step;
        integer mode = PRIM_TEXGEN_DEFAULT;
        if (step == 2) mode = PRIM_TEXGEN_PLANAR;
        if (step == 3) mode = originalMode;

        llSetPrimitiveParams([PRIM_TEXGEN, 0, mode]);
        list values = llGetPrimitiveParams([PRIM_TEXGEN, 0]);
        llOwnerSay("Face 0 mode: " + (string)llList2Integer(values, 0));

        if (step == 3)
        {
            llOwnerSay("Original projection restored.");
            step = 0;
        }
    }
}

Mode 0 is default and mode 1 is planar. If the image looks unchanged, check that you are viewing face 0, that it has a texture, and that its size and repeats make the difference visible. A half-metre face with unit repeats can look similar in both modes.

After a compiler or World update

  1. Keep the original LSL source. Reopen and transpile it with the updated Scripter compiler when release notes call for retranspilation; previously generated code keeps its old translations.
  2. Update the script using the editor's normal workflow and test in a World build containing the paired runtime changes. Restarting an old compiled script does not recompile its source.
  3. Use a disposable object and inspect both query output and visible appearance. Record the build, script source, prim/face, expected result and actual result when reporting a mismatch.

The embedded Glitch preview is a separate host with its own capabilities. It is useful for a quick check, but a successful preview is not proof of World support, and a preview limitation is not proof that World cannot run the script. Verify new linked-prim, projection and material features in World. Documentation, the standalone editor and World can be deployed separately, so a refreshed docs page alone does not update your compiler or scene.

Scripts and the Look tab

Scripted appearance can differ from the authored values shown in the Look tab. Some live parameters do not yet have corresponding controls or inspection there. A script reset is not an appearance undo: restore saved values explicitly when your script finishes an effect. In particular, live projection overrides are runtime state, not a promise of saved appearance after an object reload.

Texture image replacement, changing how a texture is projected, and laying out clickable regions for a HUD are different tasks. The appearance/editor coverage and UX tracker records implemented controls, missing inspection/editing features, and proposed display tools. Proposed tools on that page are not current scripting capabilities.

Set color with native TypeScript

For a native TypeScript script on an object, import Color3 and ALL_SIDES with WorldScript. This complete example sets every face red when the script starts. Change the hex color to choose another color. Stopping the script does not restore its prior color.

import { WorldScript, Color3, ALL_SIDES } from "poqpoq/types";

export default class RedBox extends WorldScript {
  onStateEntry() {
    this.object.setColor(Color3.fromHex("#ff0000"), ALL_SIDES);
  }
}

Color3.fromHex creates a new color value. Shared colors such as Color3.WHITE are read-only; create a new color to edit its components. ALL_SIDES applies the color to all faces.

This example requires the updated SDK/editor and native-value worker release. If the editor accepts the code but the script reports that Color3 or ALL_SIDES is undefined, the runtime still needs that update. A refreshed documentation page alone does not update your scene runtime.

See also