Exporting Prim Data From Second Life
Every Second Life player that has aspired to build their own grand project at some point has yearned for more powerful tools. Second Life has made a building and texturing toolset that is incredibly easy for the average user with no familiarity with 3D modeling, but lacking in ability compared to full-scale 3D software. There are also times when you want to build things without being connected to the grid, and import them later. To fill this niche, Jeffrey Gomez has created an excellent plugin for Blender called prim.blender. The plugin is open source Python code, released under the GPL license and reads and writes a simple xml format that stores Second Life “prim” (primitive, a building block object) information. This is a great piece of software that allowed the creation of the wonderful libsecondlife headquarters shown below.

To complete the circle, I’ve been working on an object exporter named primexport to get prim data out of Second Life and in to Blender. This will eventually allow you to build structures in-world, export them and do the texture mapping, then import the finished product to Second Life. For now it’s still in very early beta, once a couple more issues are worked out a public beta will be available from the libsecondlife website. Here’s an example of a motorcycle created in Second Life and exported in to Blender. This is different from just grabbing the raw OpenGL data because it’s stored in an xml format that describes the prim information, so it can be edited and imported back in to Second Life with an existing import script.
If you look closely you’ll see a cube on the middle of the seat, which is the invisible prim that avatars sit on when they ride the bike. Transparency isn’t handled so it’s fully visible in prim.blender, and you also might notice a part of the seat is missing, hence why the software is early beta and still being worked on heavily. The rough edges should be smoothed over soon enough, and this could be a fundamental change in how Second Life information is treated. Traditionally, data in the SL metaverse is thought of as being locked up in a black box, and bought and sold between agents. By putting prim information in to an xml format, it can be transferred between grids, stored in versioning systems, downloaded from websites or peer-to-peer software, and integrated in to the rest of the web in general. It also brings the intellectual property of builders to about the same level of security that webpages, where anyone is free to view and copy the html source code. Should security measures be built in to primexport to try and hold on to the SL permissions system? Should such artificial restrictions be thrown to the wind so the virtual wild west can be embraced? What implications will this have for the Second Life building process, the economy, and intellectual property in the metaverse?

September 14th, 2006 at 10:40 am
Good stuff John.
September 20th, 2006 at 5:22 pm
Working on creating a hardened schema for the .prims. If you’re interested in contributing, check here:
https://gna.org/task/?3685
Looking for testers!
June 8th, 2007 at 10:54 am
Any updates on the progress of this or a chance of getting hold of it John?
I don’t mind what stage it’s at and would be more than willing to put lot’s of testing in as a thank you.
Thanks
AD
September 1st, 2007 at 4:45 am
[...] According to John Hurliman, Jeffrey Gomez created a plugin for blender that allows the software program to import and export [...]
January 7th, 2008 at 2:39 pm
In Opensim, the values for prim data are exportable in xml format and also are stored in the sqlite database. Many of the values are converted to percentages to calculate mass however.. Here is an example of an exported xml file of prim data: http://pastebin.ca/844758
In your eyes, would it be easy to create an xml converter / prim.blender import based on this data?
in opensim x is 0 - 50,000 and y is 50,000 - 0
cut in prim.blender xml is a value based on 0.00 - 1.00
January 7th, 2008 at 2:41 pm
sorry, that last bit was an example of the difference in xml values.. 0 - 50000 is and 50000 - 0 is .. respective to cut x and y in prim.blender
January 7th, 2008 at 2:42 pm
ack! the comment feature is removing the code snippits. hopefully you get the idea.
January 7th, 2008 at 7:44 pm
krisbfunk: The Second Life official viewer has support for exporting in an LLSD (XML) format that libsecondlife has also adapted, so they share a common import/export format. This is basically just a wrapper around the unpacked values that are sent over the wire in the SL protocol, and I would be in favor of sticking with that format and writing a converter to go from the OpenSim custom format back to the original unpacked network format in LLSD form. I have a standalone program that can read these files (and do various things like edit UV mapping and export to OBJ format) at http://wiki.secondlife.com/wiki/Prim_Mapper
January 11th, 2008 at 2:21 pm
How can you export the xml file? I guess that it need a lsl script inside one object in second life. Do you write it yet?
Thanks!