Download Assets

24 June 2020

  • C10 - removed extended image file formats in favor of built-in types.

26 November 2016

  • Release 9.145 - Removed MP3 download format due to incompatibilities with the mono platform.

6 October 2016

  • Release 9.133 - The command now can take a path instead of a name.

22 September 2016

  • Relese 9.127 - added the capability to download sounds in either mp3 or wav format.

10 July 2016

  • Relese 9.104 - added extended formats for the Windows platform.

23 May 2015

  • Release 8.13 - added the optional path parameter.

4 May 2014

  • Release 7.82 - added the optional format parameter for the Texture asset-type that will allow downloading to a different format other than JPEG2000.

14 December 2014

  • Release 7.28 - added.
download (Commands)
TypeCorrade progressive command
Commanddownload
DescriptionThe download command can be used to download assets from the grid.
Permissionsinteract, inventory, system (if path is specified)
Parametersgroup, password, item, type
Last ChangesRelease 9.133 - The command now can take a path instead of a name.

The download command can be used to download assets from the grid.

Command Required Parameters Required Corrade Permissions Example
download group, password, item, type interact, inventory, system (if path is specified)
llInstantMessage(CORRADE,
    wasKeyValueEncode(
        [
            // Download a texture by UUID
            "command", "download",
            "group", wasURLEscape(GROUP),
            "password", wasURLEscape(PASSWORD),
            // or the path to an item in Corrade's inventory
            "item", "742c887b-a8ed-ba7b-6e7f-8ba8e9d1d76a",
            "type", "Texture",
            "callback", wasURLEscape(URL)
        ]
    )
);
Parameter Possible Value Optional Parameter Possible Value Description Download from
type Texture format One of the supported formats. Downloads a texture in the specified format or in JPEG2000 format in case format was not specified. Asset server
Sound format One of the supported formats. Downloads a sound in OGG Vorbis format by default or in one of the supported formats. Asset server
Animation Downloads an animation in .animatn format. Asset server
Clothing Downloads wearables. Asset server
Bodypart Downloads body parts. Asset server
Landmark Downloads landmarks. Asset server
Gesture Downloads gestures. Asset server
Notecard Downloads notecards. Inventory
LSLText Downloads scripts. Inventory

and the data retrieved is compatible with the data supplied to the upload command.

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.

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.

Supported Texture Image Formats

Grid clients such as Corrade download and upload textures to the grid in the JPEG2000 image format. The JPEG2000 image format is defined with various profiles, such that if the downloaded image is saved to a file and then inspected by the file or exiftool command line utilities, the detected image description should be:

JPEG2000 codestream

which indicates a Profile 0 JPEG2000 which is what the SecondLife grid is using.

The proper file extension for such images is "j2c" which stands for "JPEG2000 codestream". Some tools may not properly implement nor respect the file extension. One tool that manages to correctly convert images to "JPEG2000 codestream" is ImageMagick with the mogrify tool. For instance, supposing that an image x.png exists in the current directroy, then issuing the command:

mogrify -format "J2K" x.png

will result in a new image created x.j2k that, when inspected with the file tool:

file x.j2k

should output:

x.J2K: JPEG 2000 codestream

Other tools, such as ffmpeg will convert an image that when inspected with the file utility will read x.j2k: JPEG 2000 Part 1 (JP2) which will fail to upload with Corrade to SecondLife.

Furthermore, Corrade follows the SecondLife limits on texture uploads without any processing such that the user must ensure that the texture to be uploaded conforms to the specification.

One condition imposed by SecondLife is that the height and width of the image should be a power of 2 otherwise the image will not be uploaded. When uploading with a regular viewer, the viewer disguises a transformation that changes the image such that the width and height are a power of 2. However, when using Corrade, this transformation has to be performed beforehand in order for the upload to succeed.

Supported Sound Formats

By default sounds are stored on the grid in OGG-Vorbis format and Corrade can download the sound file as OGG.

Notes

Except for:

  • notecards,
  • scripts (LSLText)

all the other assets can be grabbed by Corrade's download command in case the UUID of the item is known.

Textures, sounds and animations are well-known formats that, once received, can be easily reused and converted to something else. On the other hand, clothing, landmarks, gestures, notecards and scripts (LSLText) are Linden-based formats that cannot be converted directly.

Some of these formats, for example Clothing, include references to images which will have to be pulled separately by first retrieving the clothing, going through the file and gathering UUIDs and then issuing another download to fetch the textures.


secondlife/scripted_agents/corrade/api/commands/download.txt ยท Last modified: 2024/06/16 17:13 by office

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.