User:Jacek Antonelli/Object Import and Export

Introduction
These are my notes for implementing Object Import and Export in Imprudence. That is, the ability to load and save prims in SL as files on your hard drive, to keep backups and such.

Format
In what file format shall objects be saved?

The obvious answer is XML, specifically the XML format used by libopenmetaverse's TestClient when exporting. The key here is cross-compatibility, both with the TestClient and with other tools that use that format. I think Prim.Blender might use it, perhaps others.

Another option worth considering would be JSON, because XML sucks. But cross-compatibility is more important than being a bit less sucky, so I don't think JSON is the way to go (yet). Maybe in the future, as a second supported format.

I'll need to find some documentation for the XML format, or else figure it out from a sample.

Handling Permissions
The anarchic thing to do would be to make any object exportable, regardless of whether you own it or have the proper permissions. But I'm not an anarchist, so I plan to add some permission checks.

It seems to me that to export an object, one ought to have the ability to modify it. Possibly also the ability to copy it, but that's a bit of a judgement call. If you can modify an object, you could in theory go through each prim manually and write down the parameters for each, and then reconstruct it. Or, more practically, write LSL scripts to clone it. So, mod objects are already "at risk". The exception here is texture references, including sculpty textures. These cannot be effectively copied via LSL, unless you also have access to the textures themselves. I'm not sure yet how best to deal with textures.

Of course, being an open source project, there would be nothing to stop someone nasty from compiling their own version with the permissions check disabled. Providing this feature would add another weapon to content thieves' arsenals. However, they already have plenty of similar tools at their disposal. CopyBot and the TestClient both make it a simple matter to export any object without regard for permissions. And this tool has significant legitimate uses, namely making it easier for builders to make backup copies of their creations, to move their creations to be moved from SL to OpenSim and vice versa, and to use offline building tools to edit their creations.