This blog post tries to provide information to those who are looking for a starter tutorial on preparing mesh models and getting them in-world.
Mesh models, just like sculpted prims, are created outside of the virtual environment using third-party software and imported in-world by uploading the model in a particular format. The only file format currently supported is COLLADA, which uses the .dae file extension. Most professional and free modelling software have support for exporting 3D models to this format. Over these guides, we will use the popular and free Blender software to illustrate the process of modeling, texturing, exporting and importing the model.
Our mesh research has been concentrated in Second Life so far, although we welcome developments for mesh support in OpenSim-based environments. The latest version of OpenSim software, released in October 2011, does have mesh support but it is classed as an experimental feature. Some of the major OpenSim-based grids have adopted this version although reports from users highlight that it can be unstable for uploads and difficulties with texture information have been experienced. Note: Not all regions will support mesh due to older/different versions of the software.
Creating a model
Today we will be using a model of a coffee mug as an example. However, since this post is not meant as a modeling tutorial, I’m assuming that you have a model in Blender you would like to upload. Alternatively, if you want to follow along using this example, you can download the .blend file from our Dropbox.
Note: This work is licensed under a Creative Commons Attribution-NonCommercial 3.0 Unported License. You are free to use the provided .blend file and upload the coffee mug mesh for educational and personal use on websites, in-world, tutorials etc., with name credit to Thom Lunasea. Commercial distribution of the .blend file or the coffee mug mesh object is not licensed.
I created this model without using any pre-defined shapes or template files. Unlike designing sculpted prims, you can create mesh models without any specially prepared objects; you are free to use all of Blender’s tools to create, manipulate and extend the topology of your objects since your model does not need to adhere to a fixed structure of vertices. This means that you can create, extrude, duplicate and deform your objects in any way you want, including the Generate and Deform modifiers in Blender.
It is still good to consider the complexity of your mesh models, in order to keep the number of vertices low. Complex objects with a large number of vertices have a higher cost than simple objects in terms of upload cost, in Second Life, and server resources it requires.
Exporting to a .dae file
As I mentioned, you can even use modifiers to create your models. There is one caveat to this, however. Second Life and OpenSim won’t understand the information about modifiers in the COLLADA file unless you prepare your mesh object in the right order. The reason for this is that the COLLADA file we are about to export doesn’t contain any specific information about the modifiers, only the shape and orientation of the mesh cage.
When you apply the modifiers, Blender adapts your model by calculating and adding additional vertices between the existing vertices, so the mesh cage exactly describes the shape you created with the modifiers.
The coffee mug model does use a subdivision modifier to make the object look round and smooth, and we want to keep that shape in-world. To prevent the imported object from looking very blocky, you will need to apply any modifiers before exporting. In this case we only have one object, but if your model consists of more than one object, you need to apply the modifiers on each object.
I typically stick to the following process:
- Keep all modifiers intact and active during the entire modelling process. This lets you keep control over your mesh cage and modifier settings at all times.
- Save the .blend file again before preparing the export, just to be sure.
- Click Apply on all modifiers.
- Export to COLLADA (explained below).
- Make sure not to save the .blend file now, or the modifiers will be gone forever.
- quit Blender without saving, or
- choose File > Open recent > select the same file from the list, or
- press CTRL-Z / CMD-Z multiple times to undo the modifier application, until all modifiers are back.
- The modifiers are now back safely. Continue modelling and exporting.
Please note that the coffee mug .blend file still has the subdivision modifier; you will need to apply it before exporting.
So, how does the export work? After preparing the model as explained before, you can export your model by selecting File > Export > COLLADA. In Blender’s Export/Save dialog, you will notice the Export only selected checkbox. If you have more than one object in your Blender scene and you only want to export some of them (or just one), make sure that those objects are selected before exporting, and tick this checkbox. Note: it’s okay if you accidentally export your camera and lamp objects; those objects don’t have vertices and won’t end up in your in-world object.
Finally, click the Export COLLADA button to save your .dae file so we can upload it to our virtual environment.
Importing the .dae file
Before you try importing your model, please ensure that your virtual world environment and your viewer do support mesh. Second Life and their official viewer support mesh, but many other third party viewers support mesh also.
Another thing to be aware of when you’re importing your model into Second Life is that it requires you to take short test (the Mesh IP Tutorial) before you can upload models. Additionally, your SL account needs to contain payment information, although you do not actually have to be a paying user anymore. For more information on these prerequisites, please visit the Mesh article in the SL knowledge base.
For this test, I’m using the Linden Lab V3 viewer, but the import procedure will be similar if not exactly the same when you’re using a different viewer that supports mesh. To import your model, select the menu option Build > Upload > Model, which prompts you to select a .dae file. When you select your model file, the Upload Model dialog pops up. It displays a preview of your model along with an impressive number of settings, most of which we can ignore for now.
Look at the preview of your model at the right. The preview area lets you zoom in and rotate around your model just like you would in-world. The preview will show a grey clay model of your object by default, so click on the Textures checkbox below the preview area to see the object with the material/texture that was saved into the model. Take a good look at your model from different angles, to make sure that everything looks smooth, and that you don’t see any strange artifacts or holes in your object. We’ll be looking at some possible problems – along with other upload settings – in the next blog post.
For now, let’s stick with the most basic settings.
- At the top of the dialog, name your model. This name will appear in your inventory when you upload the model.
- On the Level of Detail tab, the High level will show the .dae file you just selected. The highest level is used for close-up views, and each lower level is used to display a simpler version of your object as you zoom out. By default, the lower detail levels are generated automatically, but this makes your object look rather chunky or mangled. You can preview how this looks by selecting the corresponding level of detail below the preview area. I recommend setting the Medium and Low level to Use LoD above which means that your model is used for those levels as well, keeping it well-defined even when you’re zooming out.
- On the Upload options tab, tick the Include textures checkbox to include the object’s texture in the upload.
- On the Upload options tab, check the Scale value. The default value of 1.0 will create a rather large object when you rez it. I use a scale value of 0.1 to keep it at a reasonable size.
- Click on the Calculate weights & fee button. The calculation, which may take a few seconds to complete, determines the upload fee and land impact for your object. In my case, the upload fee was L$27. If you are uploading to Second Life, but would like to do test uploads first, try connecting to the Aditi test grid. Uploads to the test grid are free.
- If you’re happy with the settings, click the Upload button. After the upload, which takes a few seconds again, the new object will appear in your inventory.
- You can now use your new object like any other object. Happy rezzing!