tiistai 15. joulukuuta 2009

Tutorial to import scene from Blender to realXtend

Ogre mesh exporter plugin (http://www.ogre3d.org/wiki/index.php/Blender_Exporter)
Ogre scene exporter plugin (http://www.ogre3d.org/wiki/index.php/Blender_dotScene_Exporter)
ModreX trunk or branch 0.1.2-rc

First you need to export all meshes from the scene. Select all meshes in scene by pressing 'a'. Then select OGRE mesh export tool from File->Export->OGRE Meshes. Ensure that you have selected all meshes from the "Selected" box. Select your favorite options and ensure that you have selected at least options "Fix Up Axis to Y" and OgreXMLConverter. OgreXMLConverter option may require that you specify the path to your OgreXMLConverter in the properties section.

In some cases not all textures are copied to the destination directory. To export textures from .blender file select File->External Data->Unpack into files. This will extract all textures from scene to location of your .blender file.

After exporting meshes you need to also export the scene file. This includes information on where the objects are placed in the scene. Select scene export tool from File->Export->OGRE Scene. In this dialog, ensure that all meshes are selected and that "Fix Up Axis to Y" is NOT selected.

Now after exporting scene and mesh files, we are ready to import them. Copy scene-, material-, mesh and texture files to OpenSim bin folder. Ensure that the name of the scene and material files are same expect for the file extension of course. Boot up your simulator if it isn't already running. Apply offset if necessary with command "ogrescene offset x,y,z", where x, y and z are the offset values of x, y and z axis. X and Y values of the objects in Scene file need to be between 0-256m and Z needs to be higher than 0. Otherwise the objects won't show up. By applying the offset command you can affect these values. Note that usually waterlevel in OpenSim is at 20 meters. Import scene with command "ogrescene import X", where X is the name of the scene without the .scene file extension.

After inputting the import command it may take a while to import all the objects. Sometimes there might be errors when importing the scene or when exporting to OGRE format and objects might not view exactly the same as in Blender.

Notes by Antti: The above example .blend file was retrieved from this site: http://gryllus.net/Blender/StudentGallery.html

Also note that the export tools for blender are quite specific about the format of the textures. You need to create UV maps for the textures and have the TexFace selection on in the Blender material menu.

torstai 10. joulukuuta 2009

ModreX region in OSGrid

This is a feature that many people have asked for: the ability to use grid mode with ModreX. We have now made this simple test server for testing interoperability of ModreX regions in an OpenSim grid.

Getting the region in ModreX mode is a pretty straightforward procedure. First configure your region according to OSGrid instructions, then modify ModreX configurations. First thing to do is to enable the default Event Queue and disable RexEventQueue. Without this, once entered to ModreX region, one can't teleport or walk out of it. Second thing to set is the client stack plugin. Set clientstack_plugin configuration to "ModularRex.dll" instead of the default LL. This makes UDP listener spawn RexClientViews instead of LLClientViews. This is important when using realXtend features like meshes, particle scripts and so on.

Final thing to notice from ModreX options is the ClientView option. By default this option is in mode compatible. The compatible mode is ment for interoperability purposes, it supports both LL and realXtend clients. However there is a drawback, compatible mode doesn't support smaller avatar update messages. This means that clients spend twice as much bytes on avatar update messages in compatible mode than in Naali or 0.4 mode. Both Naali and 0.4 mode do support these smaller avatar update messages, but SL client crashes on these messages, so these modes shouldn't be used in grids where SL clients are also used. Differences with Naali and 0.4 modes aren't that great, but as you can expect 0.4 supports the older realXtend clients and their features and is also compatible with Naali clients. Naali mode contains a bit more experimental packets that aren't handled properly in realXtend 0.4 series clients.

Now that the region is configured it can be added to the grid. Although you can see from the picture that the region is working in the grid it is still lacking some features. User needs to press Shift+R (on the 0.42 realXtend viewer) to switch to OGRE rendering and to view the scene properly. Currently grid mode doesn't support realXtend authentication or realXtend avatars. Also at time of the testing there were some problems uploading textures and the physics engine crashed few times. Mediaurls are disabled from the client since it didn't receive rex_mode flag in login response.