User talk:Nixnerd

From OpenSimulator

(Difference between revisions)
Jump to: navigation, search
(New page: How to create terrain files for OpenSim This tutorial explains how to create terrain files for OpenSim using the Gimp. Requirements: Linux operating System, The Gimp (or other suitable ...)
 
m
 
(15 intermediate revisions by 2 users not shown)
Line 1: Line 1:
How to create terrain files for OpenSim
+
'''How to create terrain files for OpenSim'''
  
 
This tutorial explains how to create terrain files for OpenSim using the Gimp.
 
This tutorial explains how to create terrain files for OpenSim using the Gimp.
  
Requirements:
+
'''Requirements:'''
  
Linux operating System,
+
Linux operating System,<br>
The Gimp (or other suitable drawing package, such as PhotoShop)
+
The Gimp (or other suitable drawing package, such as PhotoShop)<br>
xxd (or similar binary editing tool)
+
A RAW file exporter for GIMP - available from [http://registry.gimp.org/plugin?id=3457]<br>
Kate (or suitable word processor that can cut and paste text columns)
+
xxd (or similar binary editing tool)<br>
OpenSim
+
Kate (or suitable word processor that can cut and paste text columns)<br>
 +
OpenSim<br>
 +
 
 +
'''Method:'''
 +
 
 +
Download the Gimp RAW plugin from the above link - and extract the raw.c file. You need the Gimp dev package installed to compile the plugin - so make sure you have that package installed. Compile the raw.c file and put the resulting binary file into your /home/gimp_2.2/plug-ins folder. Restart the Gimp - if it's already running.
  
Method:
 
 
Use Gimp or Photoshop to create a 256 x 256 image, this will be the terrain height-map. High areas are white – low areas are black. See the example below:
 
Use Gimp or Photoshop to create a 256 x 256 image, this will be the terrain height-map. High areas are white – low areas are black. See the example below:
  
Line 22: Line 26:
 
Open a console window in the same directory you saved the image in and type the following:
 
Open a console window in the same directory you saved the image in and type the following:
  
xxd -c 3 myrawfile.raw output.txt (then press enter!)
+
'''xxd -c 3 myrawfile.raw output.txt''' (then press enter!)
  
 
This will now have copied and converted the RAW file into a text file called output.txt
 
This will now have copied and converted the RAW file into a text file called output.txt
  
 
Download the example terrain RAW file from Linden Labs :
 
Download the example terrain RAW file from Linden Labs :
http://www.archive.org/download/Sample_RAW_File_1/brilliant_terrain.zip
+
[http://www.archive.org/download/Sample_RAW_File_1/brilliant_terrain.zip]
and then extract the file called brilliant_terrain.raw from the zip file into your current working directory.
+
and then extract the file called '''brilliant_terrain.raw''' from the zip file into your current working directory.
  
 
Alternatively you can save a RAW terrain file from the OPENSIM grid server console by typing in:
 
Alternatively you can save a RAW terrain file from the OPENSIM grid server console by typing in:
 
+
'''
terrain save RAW brilliant_terrain.raw
+
terrain save RAW brilliant_terrain.raw'''
  
 
Which will save a RAW copy of your OpenSim terrain file into the OpenSim bin directory – so move the file into your current working directory.
 
Which will save a RAW copy of your OpenSim terrain file into the OpenSim bin directory – so move the file into your current working directory.
Line 38: Line 42:
 
This binary RAW file needs to be converted into a text file too – so in the same directory as the RAW files type the following command into the console:
 
This binary RAW file needs to be converted into a text file too – so in the same directory as the RAW files type the following command into the console:
  
xxd -c 13 brilliant_terrain.raw island.txt (then press enter!)
+
'''xxd -c 13 brilliant_terrain.raw island.txt''' (then press enter!)
  
Whichever method you chose to follow above, you should now have two text files in your current working directory. One made earlier from the image file, called output.txt and one called island.txt
+
Whichever method you chose to follow above, you should now have two text files in your current working directory. One made earlier from the image file, called '''output.txt''' and one called''' island.txt'''
  
Open the Kate text editor and open output.txt and island.txt. Go to the Edit menu and ensure that Block Selection Mode and overwrite is turned on in both cases.  
+
Open the Kate text editor and open '''output.txt''' and '''island.txt'''. Go to the Edit menu and ensure that '''Block Selection Mode''' and '''overwrite''' is turned on in both cases.  
  
 
[[Image:image2.jpg]]
 
[[Image:image2.jpg]]
  
You should make sure both files files have exactly 65,536 lines of data in them, before proceeding. Copy the column of numbers from the output.txt file and paste it into the column of numbers in the island.txt file, as shown below.
+
You should make sure both files files have exactly 65,536 lines of data in them, before proceeding. Copy the column of numbers from the '''output.txt''' file and paste it into the column of numbers in the '''island.txt''' file, as shown below.
  
 
[[Image:image3.jpg]]
 
[[Image:image3.jpg]]
  
Close the output.txt file and save the island.txt file, choosing to save over the original version. Close the Kate text editor.
+
Close the '''output.txt''' file and save the''' island.txt''' file, choosing to save over the original version. Close the Kate text editor.
  
Now to turn the island.txt file back into a binary file – open a console into directory where the file is and type:
+
Now to turn the '''island.txt''' file back into a binary file – open a console into directory where the file is and type:
  
xxd -r -c 13 brilliant_terrain.raw island.txt myisland.raw
+
'''xxd -r -c 13 brilliant_terrain.raw island.txt myisland.raw'' '(then press enter
  
Copy the myisland.raw file from your current working directory into the OpenSim bin directory and start OpenSim in the usual manner.
+
Copy the '''myisland.raw''' file from your current working directory into the OpenSim bin directory and start OpenSim in the usual manner.
  
 
In the OpenSim console type the following:
 
In the OpenSim console type the following:
  
terrain load RAW myisland.raw (then press enter!)
+
'''terrain load RAW myisland.raw''' (then press enter!)
  
 
You should then be able to connect your SecondLife client to your OpenSim server – in the usual manner and see the your new island in all it's glory!
 
You should then be able to connect your SecondLife client to your OpenSim server – in the usual manner and see the your new island in all it's glory!
Line 66: Line 70:
 
If you find the island looks a little too tall (i.e. to many high mountains), then try typing in the OpenSim console:
 
If you find the island looks a little too tall (i.e. to many high mountains), then try typing in the OpenSim console:
  
terrain rescale 15 30 (then press enter!)
+
'''terrain rescale 15 30''' (then press enter!)
  
 
Which will rescale the terrain to fit between 15 and 30 metres high.
 
Which will rescale the terrain to fit between 15 and 30 metres high.
Line 73: Line 77:
  
 
[[Image:image4.jpg]]
 
[[Image:image4.jpg]]
 +
 +
'''Create and edit BVH animations using Blender 2.58a'''
 +
 +
For those of you wishing to use Blender 2.58a to create and edit BVH animations, you'll be pleased to know that the Blender developer Cambell Barton (ideasman42 on Blender IRC) has kindly created a fix to the Blender BVH exporter - to allow BVH animations to be exported in the correct format to then be imported into SL/IW/Opensim.
 +
 +
The updated BVH exporter now features a check box to enable "Root Transform Only", along with options to export Euler Native and other arbitrary rotations.
 +
 +
You WILL need to check the "Root Transform Only" when exporting BVH's - to be able to import them into SL/IW/Opensim correctly.
 +
 +
The updated export_bvh.py and __init__.py files are available from:
 +
 +
http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-extensions&revision=2247
 +
 +
These files should replace the existing named files inside the /scripts/addons/io_anim_bvh/ folder.
 +
 +
My thanks go to Cambell for putting up with me nagging him incessantly to fix the issue, along with badgering him on IRC and via e-mail :)
 +
 +
Please note however, so far the revised exporter files have only been tested by me, briefly and only using Blender 2.58a

Latest revision as of 09:11, 1 November 2011

How to create terrain files for OpenSim

This tutorial explains how to create terrain files for OpenSim using the Gimp.

Requirements:

Linux operating System,
The Gimp (or other suitable drawing package, such as PhotoShop)
A RAW file exporter for GIMP - available from [1]
xxd (or similar binary editing tool)
Kate (or suitable word processor that can cut and paste text columns)
OpenSim

Method:

Download the Gimp RAW plugin from the above link - and extract the raw.c file. You need the Gimp dev package installed to compile the plugin - so make sure you have that package installed. Compile the raw.c file and put the resulting binary file into your /home/gimp_2.2/plug-ins folder. Restart the Gimp - if it's already running.

Use Gimp or Photoshop to create a 256 x 256 image, this will be the terrain height-map. High areas are white – low areas are black. See the example below:

Image1.jpg

Ensure you save the image as colour (not greyscale) and save it as an RGB RAW format file. This will mean each pixel in the image will be represented by 3 bytes, in the order Red, Green, Blue – in the saved RAW file.

To convert the RAW image file into a form that can be edited in a text editor, it must to be converted from binary file format into text file.

Open a console window in the same directory you saved the image in and type the following:

xxd -c 3 myrawfile.raw output.txt (then press enter!)

This will now have copied and converted the RAW file into a text file called output.txt

Download the example terrain RAW file from Linden Labs : [2] and then extract the file called brilliant_terrain.raw from the zip file into your current working directory.

Alternatively you can save a RAW terrain file from the OPENSIM grid server console by typing in: terrain save RAW brilliant_terrain.raw

Which will save a RAW copy of your OpenSim terrain file into the OpenSim bin directory – so move the file into your current working directory.

This binary RAW file needs to be converted into a text file too – so in the same directory as the RAW files type the following command into the console:

xxd -c 13 brilliant_terrain.raw island.txt (then press enter!)

Whichever method you chose to follow above, you should now have two text files in your current working directory. One made earlier from the image file, called output.txt and one called island.txt

Open the Kate text editor and open output.txt and island.txt. Go to the Edit menu and ensure that Block Selection Mode and overwrite is turned on in both cases.

Image2.jpg

You should make sure both files files have exactly 65,536 lines of data in them, before proceeding. Copy the column of numbers from the output.txt file and paste it into the column of numbers in the island.txt file, as shown below.

Image3.jpg

Close the output.txt file and save the island.txt file, choosing to save over the original version. Close the Kate text editor.

Now to turn the island.txt file back into a binary file – open a console into directory where the file is and type:

'xxd -r -c 13 brilliant_terrain.raw island.txt myisland.raw '(then press enter

Copy the myisland.raw file from your current working directory into the OpenSim bin directory and start OpenSim in the usual manner.

In the OpenSim console type the following:

terrain load RAW myisland.raw (then press enter!)

You should then be able to connect your SecondLife client to your OpenSim server – in the usual manner and see the your new island in all it's glory!

If you find the island looks a little too tall (i.e. to many high mountains), then try typing in the OpenSim console:

terrain rescale 15 30 (then press enter!)

Which will rescale the terrain to fit between 15 and 30 metres high.

Here's what my island – made from the first image in these instructions looks like:

Image4.jpg

Create and edit BVH animations using Blender 2.58a

For those of you wishing to use Blender 2.58a to create and edit BVH animations, you'll be pleased to know that the Blender developer Cambell Barton (ideasman42 on Blender IRC) has kindly created a fix to the Blender BVH exporter - to allow BVH animations to be exported in the correct format to then be imported into SL/IW/Opensim.

The updated BVH exporter now features a check box to enable "Root Transform Only", along with options to export Euler Native and other arbitrary rotations.

You WILL need to check the "Root Transform Only" when exporting BVH's - to be able to import them into SL/IW/Opensim correctly.

The updated export_bvh.py and __init__.py files are available from:

http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-extensions&revision=2247

These files should replace the existing named files inside the /scripts/addons/io_anim_bvh/ folder.

My thanks go to Cambell for putting up with me nagging him incessantly to fix the issue, along with badgering him on IRC and via e-mail :)

Please note however, so far the revised exporter files have only been tested by me, briefly and only using Blender 2.58a

Personal tools
General
About This Wiki