Export an Object to a Mesh in Collada Format

31 July 2019

  • C10 - added the selection parameter.

23 May 2015

  • Release 8.13 - added the optional path parameter.

19 May 2015

  • Release 8.12 - range is now an optional parameter and not required to locate the item.

14 May 2016

  • Release 8.11 - added.
exportdae (Commands)
TypeCorrade progressive command
Commandexportdae
DescriptionThe exportdae command can be used to export an object (including those attached to avatars), along with all the necessary textures to a Collada DAE file.
Permissionsinteract
Parametersgroup, password, item
Last ChangesRelease 8.13 - added the optional path parameter.

The exportdae command can be used to export an object (including those attached to avatars), along with all the necessary textures to a Collada DAE file. Note that this command does not care whether the object specified contains any mesh objects: in case the object to export does not contain mesh, Corrade creates a mesh of every linked primitive.

Command Required Parameters Required Corrade Permissions Example
exportdae group, password, item interact
llInstantMessage(CORRADE,
    wasKeyValueEncode(
        [
            // Export an object named "Chicken"
            "command", "exportdae",
            "group", wasURLEscape(GROUP),
            "password", wasURLEscape(PASSWORD),
            // NOTE: or an UUID can be passed
            // NOTE: this must be the name or
            // the UUID of an object (a root primitive).
            "item", "Chicken",
            "range", 5,
            "callback", wasURLEscape(URL)
        ]
    )
);

The possible and currently supported downloadable assets are the following: Bmp Emf Exif Gif Icon Jpeg MemoryBmp Png Tiff Wmf

Optional Parameter Possible Value Description
format Bmp Downloads the textures referenced by the object in the specified format or in JPEG2000 Codestream format in case format was not specified.
Emf
Exif
Gif
Icon
Jpeg
Png
Tiff
Wmf
range A range in meters. The spherical distance from Corrade in which to locate the item.
Optional Parameter Possible Value Description
path A path-name ending in a file name (e.g.: C:\\Data\\Assets\\MyAsset.txt, or /mnt/data/Store.png) If a path is specified, then the asset will be saved to the file name indicated by the path.
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.

In case the path optional parameter is not specified, then the asset will be downloaded, encoded as a Base64 string, then URI escaped and then placed as the value to the data key from the callback. If the path parameter is specified, then the data will be saved to the indicated path.

Remarks

  • Since a mesh object export consists of both an XML file and the referenced textures, Corrade bundles the DAE file and the textures in a ZIP file which it then Base64 encodes and sends it as the value of the data key in the command output. In order to retrieve all the files from the output, you must Base64 decode the value of the data key which will give you binary data representing a ZIP file. Depending on the language you script Corrade in, you can either save that binary data to a ZIP file and then decompress it using conventional tools or decompress the ZIP file in-memory if the scripting language provides memory streams.
  • Contrary to some distinguished viewers, Corrade will only return data if it has succeeded in downloading all the textures, creating the DAE file and successfully created a ZIP archive. If at any point there is a failure, Corrade will break execution and return the error. To that effect, the exportdae command does not return partial-results, as in exports with missing textures but will only return completely successful exports.
  • Compared to the exportxml command, the exportdae command always succeeds in creating a meshed object. This is because all primitives part of the object's link-set will be meshed regardless whether they are already a mesh (in which case no meshing is necessary) or not.
  • Setting the selection parameter appropriately when it is known beforehand whether the sought object is either attached to an avatar or rezzed in-world can greatly improve the search time and speed up the command.

secondlife/scripted_agents/corrade/api/commands/exportdae.txt ยท Last modified: 2022/11/24 07:46 by 127.0.0.1

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


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