.x texture not showing in Panda3D.

I created a level and saved it in windows .x format. naturally Panda3D supports this format, however, the program I used saves the textures associated with the .x model in .stf format, which Panda3D doesn’t support.

The model itself loads just fine in Panda3D, but it shows up all in white. Is there any ‘easy’ way to re-texture it, In like the panda3D scene editor, or do I really need to start modeling all over again? :confused:

Just some general info on what I use to make my levels :
I use Leadwerks 3D World Studio to model my levels because it’s easy to use and gives reasonable results. Plus it exports as an .x format.

I’m new to python, so be easy on the answer. Explain it like you’re talking to a 5 year old :laughing:

Thanks
-pmt

texture = loader.loadTexture(“path/to/file.png”)
model.setTexture(texture)

texture is a variable that stores the loader texture. loader is useful thing that can loads models … and that is what you used no doubt but the method loadTexture is used for textures. “path/to/file.png” is the location of the file you want to load. model is your .x files that you loaded that is now white. setTexture method sets its texture with the variable texture that you have set on the line before.

Well, I’ve googled around a little, and here’s what I’ve figured out.

There are a lot of file formats for textures: JPEG, GIF, PNG, BMP, TIFF, and so forth. It looks like Leadworks (the guys who created 3D World Studio) created a new image format, STF, that nobody’s ever heard of. Naturally, it’s not supported by any other program. Why would they do this? As far as I can tell, it’s to force you to use their 3D engine and nobody else’s.

So long story short: if you can figure out how to convert these images from STF format to something normal — preferably JPEG or PNG — then you’ll be able to use these models in Panda3D.

In my short googling session, I didn’t find any converters out there. But then again, I only searched for about 3 minutes.

If you can’t find a converter, another approach would be to use a program like GLintercept. The idea here would be to run 3D World Studio in OpenGL mode, and then at some point, capture the textures using GLintercept. This is all purely theoretical, I’ve never actually used GLintercept so I couldn’t actually tell you how to do this or if it would work.

You could consider to convert all textures into a panda readable format.
Convert every texture from .stf to .png , and then open your model inside a TextEditor (X should be human readable if I remember correctly) and change the references to the textures from TEXTURENAME.stf to TEXTURENAME.png.
Use an editor with a search&replace function and be done with it in just a second…

This way your model should show up with the correct textures(that is of course, if the textures are in the right folder, which one that should be is also defined in the .X file)