Prim Package Format

From Second Life Wiki
Revision as of 22:48, 3 May 2008 by Eddy Stryker (talk | contribs) (New page: This document describes the PrimPackage format of serialized object data (prim shapes and textures) from Secondlife. = PrimPackage = A PrimPackage is a zip file containing a single XML f...)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

This document describes the PrimPackage format of serialized object data (prim shapes and textures) from Secondlife.

PrimPackage

A PrimPackage is a zip file containing a single XML file and zero or more texture files. The XML files contains an LLSD structure serialized with the LLSD XML serializer, and the textures are Targa or JPEG2000 format.

Zip File

Any level of compression may be used, but the file may not have a password or any extended zip features. The file extension must be either .zip or .primpackage. The zip file must contain a file called prims.xml and may contain texture files in either Targa or JPEG2000 format, or a mix of the two. No sub-folders are allowed inside the zip file.

XML File

(Overview)

Example

(XML Data)

Textures

Textures are in either Targa or JPEG2000 format. Targa files can have one (grayscale), three (red/green/blue), or four (red/green/blue/alpha) layers. JPEG2000 files can have either one (grayscale), two (grayscale/alpha), three (red/green/blue), or four (red/green/blue/alpha) layers but must also be compatible with the official Second Life grid and viewer. In other words, you must be able to upload the exact binary data contained in each JPEG2000 file to the official Second Life grid run by Linden Lab and have that texture show up in-world using the official Linden Lab Second Life viewer. Any size, compression, etc. settings are allowed as long as this requirement is met.

Texture Naming

Texture files may have any file name that is allowed in a zip file, but it is recommended that exported textures use the UUID of the exported texture as the file name. The file extension must be either .tga for Targa files or .jp2 for JPEG2000 files. For example, a texture with the UUID a822ff2b-ff02-461d-b45d-dcd10a2de0c2 exported from the grid as a raw JPEG2000 file should be named a822ff2b-ff02-461d-b45d-dcd10a2de0c2.jp2.