Create a Primitive

27 May 2017

  • Release 9.164 - now allows setting the name, description and permissions of the newly created primitive. Furthermore, the command now returns the UUID of the newly created primitive for easily reusing with other commands.

18 August 2015

  • Release 8.40 - added.
createprimitive (Commands)
TypeCorrade progressive command
Commandcreateprimitive
DescriptionCorrade can create new primitives by using the createprimitive command.
Permissionsinteract
Parametersgroup, password, position
Last ChangesRelease 9.164 - now allows setting the name, description and permissions of the newly created primitive. Furthermore, the command now returns the UUID of the newly created primitive for easily reusing with other commands.

Corrade can create new primitives by using the createprimitive command.

Command Required Parameters Required Corrade Permissions Example
createprimitive group, password, position interact
llInstantMessage(CORRADE,
    wasKeyValueEncode(
        [
            "command", "createprimitive",
            "group", wasURLEscape(GROUP),
            "password", wasURLEscape(PASSWORD),
            // the position at which to create the
            // new primitive.
            "position", wasURLEscape(
                (string)(<169.770218, 162.512756, 3402.75>)
            ),
            // start with a sphere
            "type", "sphere",
            // set the name of the newly created
            // primitive to "ball"
            "name", "ball",
            // set the description of the newly
            // created primitive to "bouncy"
            "description", "bouncy",
            // override the sphere material
            // and make it out of glass
            "data", wasListToCSV([
              "Material",
              "Glass"
            ]),
            // and turn physics on
            "flags", wasListToCSV([
              "Physics"
            ]),
            "callback", wasURLEscape(URL)
        ]
    )
);
Optional Parameter Possible Value Description
name A string. The name of the newly created primitive.
description A string. The description of the newly created primitive.
range A range in meters. The spherical distance from Corrade in which to locate the item.
rotation A rotation in quaternions. The primitive rotation. If not specified, the primitive will have a zero rotation.
region A region name. The region where to create the primitive. If not specified, the primitive will be created in the local simulator.
scale A vector describing the scale of the primitive to create. The size of the the primitive to create. If not specified the primitive will be scaled to $0.5m$ on all three axes.
flags A CSV list of members from the PrimFlags structure. Various flags for the primitive being created.
data A CSV list of members from the ConstructionData The data to construct the primitive by.
type Please see the Corrade built-in body types. The initial body to start from, after which the parameters in data get applied. If you do not supply this parameter then data will start off with a cube.

Notes

  • The way that Corrade rezzes primitives is usually to start from a built-in body specified by type after which the parameters get altered by the data parameter (see the example call for the command). There are four cases depending on whether data or type are specified:
    • In case neither data or type is specified, then Corrade will set the primitive to the cube built-in type.
    • In case only type is specified, the body type will be rezzed with no modifications.
    • In case only data is specified, then the primitive will be rezzed by setting the default body type to cube and then altering the primitive using the parameters specified in data.
    • If both type and data is specified, then Corrade will start off from the specified body type and then alter that body by setting its parameters to those specified in data.
  • The command returns the UUID of the newly created primitive.

secondlife/scripted_agents/corrade/api/progressive/commands/createprimitive.txt ยท Last modified: 2017/05/27 23:07 by Wizardry and Steamworks

Access website using Tor


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