Page 1 of 2

Texture isn't applying to ship [SOLVED]

Posted: Thu Jul 01, 2010 1:44 pm
by Poro
PLEASE GO TO THE FIRST MESSAGE OF THE SECOND PAGE FOR THE SOLUTION

I'm working on my first ship, and having followed Giles' tutorial to the letter, I find that the model loads up fine in the game, it is stocked in the shipyard okay, but it never has any texture applied.

I've gone over everything I can think of, including:

Texture name (uppercase - lowercase)
Linux file permissions
Re-saving and exporting the texture from Wings3D
Re-saving the PNG from within GIMP
Re-exporting the model with different tessellation settings from within Wings (including none)
Checking the shipdata file and model dat file...

... all to no avail. All I get in the shipyard is the rotating model with a pinkish colourcast to it (rather than the white polygons that I sometimes see on untextured ships).

I can't upload any files right now, but does anyone have any ideas? I hope it's just a noob mistake somewhere.

Posted: Thu Jul 01, 2010 3:13 pm
by Kaks
Did you put the texture in the Textures directory? Oolite won't find it if it's in the same directory as the .dat file...

Posted: Thu Jul 01, 2010 5:04 pm
by Poro
Yup.

CONFIG ---> shipdata.plist shipyard.plist
MODELS ---> model.dat
TEXTURES ---> modeltexture.png

Posted: Thu Jul 01, 2010 5:05 pm
by another_commander
Latest.log after Shft-restart?

Posted: Thu Jul 01, 2010 5:57 pm
by Smivs
I've never done a model/texture from scratch but ...just a thought. What size is your texture? Normal Oolite textures are 512x512px but multiples work as well 1024x1024 or 2048x2048. The bigger the texture, the more detail you can get. I mention this because I don't think other sizes work.

Posted: Thu Jul 01, 2010 5:59 pm
by Poro
Gya! [NoteToSelf]Always check the logs[/NoteToSelf]

Sure enough the log said

Code: Select all

[mesh.error]: ***** Failed to find TEXTURES data (will use placeholder material)
 ..... from intio.dat (from file)
So off I go to the DAT file, and whilst it identifies the correct texture in the header... the entire texture section is missing. I used Obj2DatTex.py - shouldn't that have done it? Obj2DatTexNorm.py didn't procuce the correct output, and I can't find a copy of Obj2Dat.py to test, but with the 'Tex' suffix I would have thought that this would output the correct texture coordinates.

To reiterate, the DAT file contains the VERTS and FACES sections, but not the TEXTURES section.

Here is the terminal output when I run it:

Code: Select all

converting...
['Intio.obj']
Intio.obj->intio.dat
going to open material library file: Intio.mtl
Material Intio_auv -> IntioTexture.png
done
EDIT: REMOVED LONG LISTING OF PYTHON FILE, SINCE IT IS NO LONGER RELEVANT

Posted: Thu Jul 01, 2010 6:12 pm
by Poro
Smivs wrote:
I've never done a model/texture from scratch but ...just a thought. What size is your texture? Normal Oolite textures are 512x512px but multiples work as well 1024x1024 or 2048x2048. The bigger the texture, the more detail you can get. I mention this because I don't think other sizes work.
It's 512x512, I made sure Wings3d got that right.

Posted: Thu Jul 01, 2010 6:25 pm
by Svengali
Hello Poro. Please check your model for face intersections.

Posted: Thu Jul 01, 2010 6:35 pm
by Poro
Hi Svengali. Would a face intersection stop the whole texture section of the DAT file from being written? I'll fire up Wings3D when possible and have a look.

Posted: Thu Jul 01, 2010 7:02 pm
by Eric Walch
Poro wrote:
Hi Svengali. Would a face intersection stop the whole texture section of the DAT file from being written? I'll fire up Wings3D when possible and have a look.
I have also had a few occasions of missing texture in the dat file. But maybe it was already missing in the obj file. At the moment I can't remember how I fixed it, but is was always a small change somewhere. hmm.. sounds not that helpful. Maybe it were some unused texture definitions in wingz I had to delete first?

Posted: Thu Jul 01, 2010 8:12 pm
by Poro
Well, i guess my ship isn't going to be flying any time soon :( I made sure anything in the "Outline Window" within Wings had to be there (you mentioned unused texture definitions) and it still doesn't have any texture data coming out.

FYI within the OBJ file there are faces (f), vertex points (v), vertex normals (vn), and vertex texture points (vt). That's why I thought the problem may be with the py file... but then wouldn't everyone else's be messed up?


P.S. That is what (vt) stands for, right? Vertex texture?

Posted: Thu Jul 01, 2010 8:26 pm
by Kaks
no offence Kaks :P
No offence taken!

It might be more useful to look inside the generated .dat file, though: do you see any reference to the texture file name inside it?

Posted: Thu Jul 01, 2010 8:36 pm
by Poro
Kaks wrote:
It might be more useful to look inside the generated .dat file, though: do you see any reference to the texture file name inside it?
Yes indeed:
Poro wrote:
So off I go to the DAT file, and whilst it identifies the correct texture in the header... the entire texture section is missing... [snip]... To reiterate, the DAT file contains the VERTS and FACES sections, but not the TEXTURES section.

Posted: Thu Jul 01, 2010 9:28 pm
by Kaks
You might want to zip up the .obj, .mtl & .png files & send us the link. Without that, I really don't think I'll be able to help... :(

Posted: Thu Jul 01, 2010 10:47 pm
by DaddyHoggy
I think I might have done something similar when I created (exported) my first .obj file from AC3D.

I think I needed to have the .obj and the .png file in the same directory as the Obj2DatTex.py file.

If you've already done this, I'm at a loss.