Texture isn't applying to ship [SOLVED]

Discussion and information relevant to creating special missions, new ships, skins etc.

Moderators: winston, another_commander

User avatar
Poro
Deadly
Deadly
Posts: 249
Joined: Sun Jan 03, 2010 1:51 am
Location: Don't look in your aft view...
Contact:

Texture isn't applying to ship [SOLVED]

Post 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.
Last edited by Poro on Fri Jul 02, 2010 3:42 pm, edited 1 time in total.
User avatar
Kaks
Quite Grand Sub-Admiral
Quite Grand Sub-Admiral
Posts: 3009
Joined: Mon Jan 21, 2008 11:41 pm
Location: The Big Smoke

Post 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...
Hey, free OXPs: farsun v1.05 & tty v0.5! :0)
User avatar
Poro
Deadly
Deadly
Posts: 249
Joined: Sun Jan 03, 2010 1:51 am
Location: Don't look in your aft view...
Contact:

Post by Poro »

Yup.

CONFIG ---> shipdata.plist shipyard.plist
MODELS ---> model.dat
TEXTURES ---> modeltexture.png
another_commander
Quite Grand Sub-Admiral
Quite Grand Sub-Admiral
Posts: 6671
Joined: Wed Feb 28, 2007 7:54 am

Post by another_commander »

Latest.log after Shft-restart?
User avatar
Smivs
Retired Assassin
Retired Assassin
Posts: 8408
Joined: Tue Feb 09, 2010 11:31 am
Location: Lost in space
Contact:

Post 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.
Commander Smivs, the friendliest Gourd this side of Riedquat.
User avatar
Poro
Deadly
Deadly
Posts: 249
Joined: Sun Jan 03, 2010 1:51 am
Location: Don't look in your aft view...
Contact:

Post 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
Last edited by Poro on Fri Jul 02, 2010 3:31 pm, edited 1 time in total.
User avatar
Poro
Deadly
Deadly
Posts: 249
Joined: Sun Jan 03, 2010 1:51 am
Location: Don't look in your aft view...
Contact:

Post 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.
User avatar
Svengali
Commander
Commander
Posts: 2370
Joined: Sat Oct 20, 2007 2:52 pm

Post by Svengali »

Hello Poro. Please check your model for face intersections.
User avatar
Poro
Deadly
Deadly
Posts: 249
Joined: Sun Jan 03, 2010 1:51 am
Location: Don't look in your aft view...
Contact:

Post 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.
User avatar
Eric Walch
Slightly Grand Rear Admiral
Slightly Grand Rear Admiral
Posts: 5536
Joined: Sat Jun 16, 2007 3:48 pm
Location: Netherlands

Post 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?
User avatar
Poro
Deadly
Deadly
Posts: 249
Joined: Sun Jan 03, 2010 1:51 am
Location: Don't look in your aft view...
Contact:

Post 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?
User avatar
Kaks
Quite Grand Sub-Admiral
Quite Grand Sub-Admiral
Posts: 3009
Joined: Mon Jan 21, 2008 11:41 pm
Location: The Big Smoke

Post 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?
Hey, free OXPs: farsun v1.05 & tty v0.5! :0)
User avatar
Poro
Deadly
Deadly
Posts: 249
Joined: Sun Jan 03, 2010 1:51 am
Location: Don't look in your aft view...
Contact:

Post 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.
User avatar
Kaks
Quite Grand Sub-Admiral
Quite Grand Sub-Admiral
Posts: 3009
Joined: Mon Jan 21, 2008 11:41 pm
Location: The Big Smoke

Post 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... :(
Hey, free OXPs: farsun v1.05 & tty v0.5! :0)
User avatar
DaddyHoggy
Intergalactic Spam Assassin
Intergalactic Spam Assassin
Posts: 8515
Joined: Tue Dec 05, 2006 9:43 pm
Location: Newbury, UK
Contact:

Post 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.
Selezen wrote:
Apparently I was having a DaddyHoggy moment.
Oolite Life is now revealed here
Post Reply