Set Primitive Texture Data

31 July 2019

  • C10 - added the selection optional parameter.

20 August 2015

  • Release 8.43 - changed index to face and added the all and default parameters.

18 August 2015

  • Release 8.40 - added.
setprimitivetexturedata (Commands)
TypeCorrade progressive command
Commandsetprimitivetexturedata
DescriptionCorrade can set primitive sculpt data using the setprimitivetexturedata command.
Permissionsinteract
Parametersgroup, password, item
Last ChangesRelease 8.43 - changed index to face and added the all and default parameters.

Corrade can set primitive sculpt data using the setprimitivetexturedata command.

Command Required Parameters Required Corrade Permissions Example
setprimitivetexturedata group, password, item interact
llInstantMessage(CORRADE, wasKeyValueEncode(
        [
            // set the texture for the 4th face
            // on a primitive in a 4m range
            // specified by UUID
            "command", "setprimitivetexturedata",
            "group", llEscapeURL(GROUP),
            "password", llEscapeURL(PASSWORD),
            // the UUID of the primitive
            "item", "4bc141fd-1dcf-62bb-993a-75c8498cd66d",
            "range", 4,
            // the 4th face
            "face", 4,
            // just set the texture to a texture UUID
            "data", wasURLEscape(
                wasListToCSV(
                    [
                        "TextureID", "2b21acae-7aa5-ae18-3635-26d2a0924801"
                    ]
                )
            ),
            "callback", wasURLEscape(URL)
        ]
    )
);

The data parameter follows the TextureEntry structure and sub-structures.

Optional Parameter Possible Value Description
range A range in meters. The spherical distance from Corrade in which to locate the item.
face The face number. The face number to set the texture on.
all Set the specified texture data for all faces.
default Set the specified texture data for the default texture.

Setting the Color of Primitive Faces

The command can be used to set the color of primitives. For instance, the following invocation will set the color of the 4th face of a primitive to red:

llInstantMessage(CORRADE, wasKeyValueEncode(
        [
            // set the color for the 4th face
            // on a primitive in a 4m range
            // specified by UUID to red
            "command", "setprimitivetexturedata",
            "group", wasURLEscape(GROUP),
            "password", wasURLEscape(PASSWORD),
            // the UUID of the primitive
            "item", "e8c6c1c7-7f08-469e-f084-f0019aa33624",
            "range", 4,
            // the 4th face
            "face", "4",
            // just set the texture to a texture UUID
            "data", wasURLEscape(
                wasListToCSV(
                    [
                        "RGBA", "<1, 0, 0, 1>"
                    ]
                )
            ),
            "callback", wasURLEscape(URL)
        ]
    )
);

In case you want to set the color for all the faces, the whole primitive, then instead of specifying 4 for the face parameter, specify all.

Optional Parameter Possible Value Description
selection attached, rezzed or all (default: all) Either attached, rezzed or all for selecting only primitives or objects attached to avatars, primitives or objects rezzed in-world or all primitives or objects respectively.

secondlife/scripted_agents/corrade/api/commands/setprimitivetexturedata.txt ยท Last modified: 2020/09/04 06:44 (external edit)

Access website using Tor Access website using i2p Wizardry and Steamworks PGP Key


For the copyright, license, warranty and privacy terms for the usage of this website please see the license, privacy, copyright and the plagiarism pages.