31 July 2019

20 August 2015

18 August 2015

Corrade can set primitive sculpt data using the setprimitivetexturedata command.

CommandRequired ParametersRequired Corrade PermissionsExample
setprimitivetexturedatagroup, password, iteminteract
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 ParameterPossible ValueDescription
rangeA range in meters.The spherical distance from Corrade in which to locate the item.
faceThe face number.The face number to set the texture on.
allSet the specified texture data for all faces.
defaultSet 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.

Notes