Main Menu

3DS -> XML

Started by mystara, March 17, 2007, 06:20:36 PM

Previous topic - Next topic

mystara

Hello,

Are there any means for converting from a 3DS model to the proprietary XML format used in jpct?

Cheers!

EgonOlsen

You may serialize a World to XML. So just add the object to a (dummy) world and create a XML from that. You may then get the object back from the (dummy?) world after loading the XML. It's a bit of an overhead but not much.

mystara

D'oh,
That's exactly what I was looking for. Somehow I managed to miss it.

So, in keeping with my new tradition, I have another stupid question.

I've exported a scene (with models and textures) to XML by the method you mention above. It contains a texture_list element with a number of texture elements.
When the scene is loaded back (using Loader) it mentions that the textures have been "added to texture manager" but the scene is rendered without textures. I've tried changing the names of the textures in the XML file, but nothing different happens.

Any ideas? Is there something else I have to do to make the textures work?

EgonOlsen

Like when loading a 3DS, you've to add the textures to the TextureManager with the proper names by yourself. The Loader doesn't do this for you.

mystara

Thanks for the reply,
I did consider this, but the XML has caused the textures to be 'added' to TextureManager (via the XML file), which prevents me from loading them.

My current approach simply performs 'replaceTexture' on each texture. But I'm wondering if there's a better approach to this?


EgonOlsen

The behaviour is the same as it is with the 3ds loader. You may add them before loading the model with the correct names and Loader will use them or, if you don't, Loader will add dummy textures with the correct names that you may replace afterwards. Which way you prefer is up to you.

mystara