Term Project – Final Report
CSCE 4313 Programming Languages – Fall 2008
Incorporating Existing Solutions
Chad Ferrari Import-Export Team Abstract
Exporting is a reality. The easiest way utilizes prim.blender, which takes in a specifically formatted .prims file and can export to Collada. There are other ways to export, including directly to SL XML or by reading geometry data from OpenGL. Importing on the other hand, is not so easy. While there are others who have done some research on the subject, most are discouraged by the math of converting polygons to prims. Along with potential to break copy protection, no one I have found has dared to complete importing.
1. Problem
Our team is working on importing and exporting objects into and out of Second Life and Open Sim. The purpose of this is to be able to transfer our work from the Second Life server to our own Open Sim environment, as well as import new structures into the virtual world. We chose KML and Collada as the external formats we would import. Therefore, our sub-problems included parsing out the KML and Collada files, taking those results and making them fit the Second Life environment, turn that into a format that can be imported, and exporting. My contribution to this project involved researching existing methods of importing and exporting objects into and out of Second Life to find if they may help our efforts. This was a rather broad objective, as it encompassed every facet of the overall goal, both on importing and exporting. Along with finding existing solutions, procuring those which seamed feasible was a bit of a problem. Many were closed source or pay solutions, which are not ideal for our purposes.
2. Objective
The primary objective of my team was to import KML files into Second Life or Open Sim. Another objective was to be able to export objects from either environment. The objective of my sub-project was to find and adapt existing solutions for importing and exporting objects for our use.
3. Related Work
Autodesk has an island where they showcase work in modeling within Second Life. While it seems they may be working on an import solution, it does not look like they have accomplished that. The extent of their work seems to be importing building plans, and then building upon them with Second Life’s own toolset. Adrian Herbez of www.purplestatic.com has written some interesting Maya scripts, but I have yet to look at them extensively.
Term Project – Final Report
CSCE 4313 Programming Languages – Fall 2008
Inivis (www.inivis.com) has three tools for importing to Second Life, though none are ideal. Their sculpted prim builder probably works well, but we are not using sculpties. Their box creator does not make very good models, unless they are very boxy. Their triangle creator was the best, but produces models with too many prims, and it does not link them together. All of their products are also closed source. The product Henshin IV (http://ai-designstudio.net/) looked to hold some promise, but being a pay product is discouraging. It does not import existing models either. It simply provides a toolset to build offline and import.
4. Architecture
4.1 Design Overall design of the project: Casey has developed a parser which takes a KML/Collada file and returns vector arrays. Andres and Ben have been working on a converter to take KML values and format them for SL XML. John has been working on taking large objects in KML/Collada and breaking them down to prim sizes. Tim has been working on converting KML/Collada coordinates to something workable in Second Life. Matt has been working on exporting prims from Open Sim and Second Life, and has found methods to import and export SL XML. Second Life Triangle Builder o Imports .tri files from modeling software into Second Life o Not open, not portable to Open Sim o Limited to note card size Prim.blender o Build with prims in Blender o Export to many formats, including Collada o Cannot convert existing models to prims o Prim.blender.importer is a good resource for parsing, manipulating, and exporting prims OGLE o Intercepts OpenGL data to read 3D data o Results can be messy o Requires Windows XP and OpenGL 2.0
Design of my subproject:
Term Project – Final Report 4.2 Testing
CSCE 4313 Programming Languages – Fall 2008
Testing the Second Life Triangle Builder involved building models and opening samples in AC3D and saving them as .tri files. After copying the contents of the .tri file to a note card in the triangle builder, it would size and position the prims appropriately. On some models, it encountered a math error and failed part of the way through. The size of a note card is a limitation, and prims are not joined. The amount of triangles created can make for a mess as well. Opening the prim.blender script in Blender worked well, and it was possible to import .prims files and export them. It was not possible to import a different type of model, as opening it would simply mix that model in with recognized prims. However, exporting that file as a Collada file did work. It would not import SL-XML, but the .prims file is remarkably similar to SL-XML, and Matt is working on a script to convert between the two. OGLE would not run on any of my systems as of yet. It requires Windows XP and OpenGL 2.0. After installing and configuring OGLE and its requirements, hitting a hotkey combination will start it reading OpenGL data and saving it to a .obj file, which can be read by many modeling softwares.
5. Results
While I have not found much in the way of importing solutions, exporting should not be terribly difficult. By modifying the prim.blender.importer script, all data on prims can be output to a chat window, which can then be copied and cleaned up into SL XML or .prims format. From there, prim.blender can load the .prims file and export it as a Collada file. By using the open source importer script, this method will work for both Second Life and Open Sim. The problem others seem to be having in regards to importing into Second Life is the conversion between common 3D modeling formats and a prim based system. We should continue to look towards a home grown solution for this rather than searching for what others have done, as they do not have much.
6. Conclusions
6.1 Summary Exporting is now a reality. No one outside the University seems to have solved the problem of importing, so it is up to us to figure that one out. There are actually many different ways to export, from getting prim details directly, using an export command to retrieve a SL XML file, or reading the output of OpenGL directly to take a snapshot. Some are better than others, and none are as easy as clicking a button, but more people have found creative ways to export than import. 6.2 Impact One impact of my research is that I have found it not feasible to continue to look for existing import methods at this point. The greater impact though, is helping Matt get to the point to where we can export files into Collada format. It is now possible, or at least very easy to
Term Project – Final Report
CSCE 4313 Programming Languages – Fall 2008
accomplish, reading data about prims in Second Life, parsing those out to SL XML or a .prims file, then import that into Blender with prim.blender and export it as a Collada file. 6.3 Future Work Finalizing work on exporting would be the best use of my research. With the various methods I have found, it is very possible to build a good exporter. My research has not turned up much on piecing together an importer, and most sources indicate more searching will not turn up much more. To continue on import, more work ought to be done converting a common format like KML or Collada into a prim based system.
References
[1] [2] [3] [4] [5] [6] Prim dot Blender, http://sourceforge.net/projects/primdotblender OGLE, http://ogle.eyebeamresearch.org/ Inivis, http://www.inivis.com/secondlife.html AutoDesk Island in Second Life Purple Static, http://www.purplestatic.com/ Henshin IV, http://ai-designstudio.net/