Author Topic: 3DS -> XML  (Read 3275 times)

Offline mystara

  • int
  • **
  • Posts: 79
    • View Profile
3DS -> XML
« on: March 17, 2007, 06:20:36 pm »
Hello,

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

Cheers!

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 11745
    • View Profile
    • http://www.jpct.net
Re: 3DS -> XML
« Reply #1 on: March 17, 2007, 07:16:09 pm »
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.

Offline mystara

  • int
  • **
  • Posts: 79
    • View Profile
Re: 3DS -> XML
« Reply #2 on: March 18, 2007, 05:05:13 pm »
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?

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 11745
    • View Profile
    • http://www.jpct.net
Re: 3DS -> XML
« Reply #3 on: March 18, 2007, 07:22:32 pm »
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.

Offline mystara

  • int
  • **
  • Posts: 79
    • View Profile
Re: 3DS -> XML
« Reply #4 on: March 18, 2007, 08:24:04 pm »
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?


Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 11745
    • View Profile
    • http://www.jpct.net
Re: 3DS -> XML
« Reply #5 on: March 19, 2007, 12:12:42 am »
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.

Offline mystara

  • int
  • **
  • Posts: 79
    • View Profile
Re: 3DS -> XML
« Reply #6 on: March 19, 2007, 08:40:33 am »
Thanks :)