OSM to DotScene(Octree) Converter 0.1

sharkyx

16-04-2006 03:52:31

Hi,

I exported a scene of mine once with OFusion and once with the Octopus exporter and gave the two resulting files to a friend of mine who likes playing with XML.

What I got back was a nice and small OSM2SCENE converter.

It is an XSLT file and a bit of Java code, which could be replaced by any other XSLT processor of your choice probably.

Invoke it with:
java -classpath path/to/the/osmconverter osm2scene myscene.osm myscene.scene

It is probably not 100% compliant with the latest dotscene and it does not convert everything from the .OSM files (like skybox settings).

If you are using the dotsceneoctree plugin, you might be happy to download the osm2dotsceneoctree.zip instead, which is a GUI tool and does the following:
  1. convert your osm to .scene[/*:m]
  2. copy meshes, materials and textures to output folder[/*:m]
  3. strips pathes from texture references in the .material files (the octopus exporter generated pathes, don't know if ofusion does this, too)[/*:m]
  4. invokes the dotsceneoctree compiler[/*:m]
  5. deletes all intermediate files[/*:m]
  6. leaving you with a .material, a .scene, a .bin, and your textures[/*:m][/list:u]

    Download all of this from the Tools section here:
    http://sharky-x.de/index.php?name=Downloads

    If anyone improves on that, I'd love to get a copy :D

    Regards,
    Jörg

IFASS

16-04-2006 11:58:33

Great! :D

I was actually just looking today into the possibility of converting OSM to Dotscene.. nice work!

Looking into it now.

IFASS

16-04-2006 12:10:11

Ok, it seems to work nicely, only two things:

If you point to an OSM file, and one of the folders in the path contains spaces it won't find the directory.

e.g:
Doesn't work:
C:\Documents and Settings\W. van de Ridder\Desktop\test.osm

Works:
C:\Yake\Blaat.osm

Also.. i don't see any .bin being generated, neither the meshes are copied to the destination directory.
The log says this:

Converting format from OSM to .scene...
Lightmap generation disabled!
Copying all necessary files manually...
Meshes...
Scene...
Materials...
Stripping paths from material files...
"blaat.material...
Copying textures to output directory...
Building octree...
Cleaning up...
Removing intermediate .mesh files
Removing log files
Removing backup files
Done!


should be okay right?

sharkyx

16-04-2006 12:17:58

In the luafile, in the function convert(), you can uncomment the call to cleanUp(). Then make a run and see what dotsceneconverter.log (or similar) in the outputdirectory says about your bin file. You should definitely get one, if you have any static geometry in your scene.

IFASS

16-04-2006 12:19:37

Hm, i used this file: http://ofusion.inocentric.com/resources/tutorials.zip
adobe_jail_final.max

Just exported to OSM and then converted to dotscene.

Edit:
Uncommenting CleanUp() worked at least for the missing .mesh files, they are there now. However, it might be due to the scene that there's no bin, in that case, it's okay.

sharkyx

16-04-2006 12:24:54

I tried it, and it works. Maybe you have spaces in your output directory, too?

IFASS

16-04-2006 12:27:06

I tried it, and it works. Maybe you have spaces in your output directory, too?

Hm.. no.. all needed files are there, only not a .bin file.
I have:
- material files
- textures
- .scene file
- .mesh files

I used the scene from the file posted above.. did you try that aswell?

sharkyx

16-04-2006 12:30:05

Yes, I used the exact same file. And as I said, go to levelconverter.wx.lua, line 296 and uncomment it with -- in the front. Then run the converter and look at the resulting logfiles in the output directory.

Afk for a bit.

sharkyx

16-04-2006 14:33:17

Another idea: Maybe the bin file is written to a wrong location?

IFASS

16-04-2006 14:48:24

Another idea: Maybe the bin file is written to a wrong location?

Thought about that too.. i'll look :)
Edit: Nope :(

Vectrex

16-04-2006 15:05:48

nice! I will be testing this out as I'm making a racing game so the mesh cutting octtree functionality is really important for proper culling of a race track.

sharkyx

16-04-2006 15:20:06

Another idea: Maybe the bin file is written to a wrong location?

Thought about that too.. i'll look :)
Edit: Nope :(


So what does the logfile say? What happens when you try to start sceneconvert.exe? Is it missing a dll maybe?

josericardo_jr

09-11-2006 09:46:54

Hi,

Very good tool! Congratulations :lol:

I have a problem using this. When I try to convert my OSM to Scene, I get an assertion error saying that vector subscription is out of range. Any advice?

Thanks a lot!

sharkyx

09-11-2006 12:43:33

Need more info. When exactly does it say that, at which step?

josericardo_jr

09-11-2006 13:09:11

Hi,

It's my error:



It happens when I click in Convert button.
Thanks a lot!

Ricardo

sharkyx

09-11-2006 21:56:07

Thats a problem in the dotscenecompiler (which I didn't write). Maybe it helps to check out the cvs version from ogreaddons/dotsceneoctree and compile a newer one, then replace the SceneConvert.exe with the freshly compiled version.

josericardo_jr

10-11-2006 09:42:50

Hi hadlop,

Thanks for your help.

I was making some tests and this error only occours when I check "Build Tangent Vectors" in oFusion exporter dialog. What is this option for and do I need it?

Thanks one mor time

Ricardo :lol:

sharkyx

10-11-2006 12:26:26

You need it when you need tangent vectors in shaders I think. But as you say this, it seems SceneConvert.exe does not support the new Ogre mesh formats. Have you tried a newer version from CVS, as I said earlier?

josericardo_jr

13-11-2006 09:54:42

Hi hardloop,

I update my cvs and compiled this tool but I get the same error :(. I will try to fix it in the source code and put it here for everyone :lol:

Ricardo

sharkyx

22-11-2006 04:51:17

Great!