27 May 2017
13 July 2016
|Type||Corrade progressive command|
|Last Changes||Release 9.105 - added.|
importxml command can be used to import an object based on a previous an XML export.
|Command||Required Parameters||Required Corrade Permissions||Example|
| || || ||
llInstantMessage(CORRADE, wasKeyValueEncode( [ // Import an object based on an XML file. "command", "importxml", "group", wasURLEscape(GROUP), "password", wasURLEscape(PASSWORD), // Import the object at this position. // In other words, set the root of the // object to this position. "position", wasURLEscape("<137.697296, 159.511642, 3400.75>"), // Use an XML file to create a structure // without attempting to upload any textures. "type", "xml", // The XML file previously exported // with the "exportxml" command. "data", wasURLEscape("<llsd><map><key>160378505</key><map><key>name</key><string>..."), "callback", wasURLEscape(URL) ] ) );
|Optional Parameter||Possible Value||Meaning|
| ||Permissions expressed in Corrade permission notation.||The permissions to set on all the created primitives.|
| ||A region name.||Attempt to perform the command on the specified region. Note that Corrade must be connected to that region. If in doubt, please use the getconnectedregions command to determine whether the region you want to specify is currently connected.|
|Parameter||Possible Value||Second Parameter||Possible Value||Optional Parameter||Possible Value||Meaning|
| || || ||A string representing an XML file.||Import a structure of primitives based on an XML file.|
| ||A Base64 encoded ZIP file.|| || ||Import a ZIP bundle by uploading the required textures and creating the primitives. By default Corrade will not upload textures that are to be found in the cache.|
typeparameter, if set to
xml, then Corrade can import just a structure of primitives based on an XML file generated within the ZIP file returned by the exportxml command or, if
typeis set to
zip, Corrade can import both the structure and upload any necessary textures.
dataparameter expects to be set to the contents of an XML file. Otherwise, when importing ZIP files, the
dataparameter expects to be set to the Base64 encoding of a ZIP file.
ZIP files generated by using the exportxml command are fully compatible with the
importxml command. For completeness, here are a few remarks on the contents of the ZIP file that Corrade will recognize:
formatand named as the UUID referenced by the XML file.
For instance, suppose that the contents of a ZIP file are the following:
3736068e-ea9c-bceb-8396-f11bacd66103.j2cis an image file in JPEG2000 codestream format representing a texture with UUID
TestExport.xmlis the structure of primitives to import. Most likely, the
TestExport.xmlfile should reference the UUID
3736068e-ea9c-bceb-8396-f11bacd66103which corresponds to the image file found in the same ZIP file.
Since texture uploads may fail half-way through the import, Corrade by default will not re-upload textures that is aware of. The
cache parameter, when set to
True or omitted, will prevent Corrade from uploading any textures in the ZIP file that have been previously cached. This assumes that Corrade will be stationary on a single grid. You may have to set
False in order to upload textures that Corrade may have seen on a different grid but that do not exist on the current grid.
In case you are exporting and importing with Corrade, then most likely Corrade has already cached the textures within the ZIP file. In such cases, Corrade will avoid having to re-upload textures and will thereby not have to pay the upload fee again.
Furthermore, by not setting
False, if the process of uploading a texture fails or the entire import process fails, you can re-issue the
importxml command and Corrade will skip the textures that it has already uploaded to the grid.