Page 1 of 1

Conversion script woes

Posted: Sat Jun 21, 2014 5:52 pm
by daveangel
Frustrating afternoon, been spent the morning texturing my new ship, but cannot get it into dat format properly with textures.

Obj2DatTexNorm tells me

File does not provide texture coordinates! Materials will not be exported.
Done.


I've looked at the mtl file coming out of wings, and i cant see anything obvious?

Can anyone help?

Code: Select all

# Exported from Wings 3D 1.5.3
newmtl Nose
Ns 100.0
d 1.0
illum 2
Kd 1.0 1.0 1.0
Ka 1.0 1.0 1.0
Ks 1.0 1.0 1.0
Ke 0.0 0.0 0.0
map_Kd Swiftfire_nose.png

newmtl Swiftfire_cockpit
Ns 100.0
d 1.0
illum 2
Kd 1.0 1.0 1.0
Ka 1.0 1.0 1.0
Ks 1.0 1.0 1.0
Ke 0.0 0.0 0.0
map_Kd Swiftfire_top.png

newmtl Swiftfire_top
Ns 0.0
d 1.0
illum 2
Kd 1.0 1.0 1.0
Ka 1.0 1.0 1.0
Ks 0.0 0.0 0.0
Ke 0.0 0.0 0.0
map_Kd Swiftfire_top.png

newmtl default
Ns 0.0
d 1.0
illum 2
Kd 0.7898538076923077 0.8133333333333334 0.6940444444444445
Ka 0.7898538076923077 0.8133333333333334 0.6940444444444445
Ks 0.0 0.0 0.0
Ke 0.0 0.0 0.0



Re: Conversion script woes

Posted: Sat Jun 21, 2014 8:31 pm
by daveangel
Well, with much investigation, its wings that gets upset when you assign the same map to multiple materials.

Cant see a way back to good apart from deleting the uvmaps. Lots of work lost, but a lesson learnt i guess.

Re: Conversion script woes

Posted: Sat Jun 21, 2014 9:23 pm
by JensAyton
For reference, texture coordinates are in the OBJ file, not the MTL file. Texture coordinates are defined on “vt” lines, and are the second vertex parameter in “f” lines. For example, here is a box with texture coordinates:

Code: Select all

mtllib ./box.mtl
g Box

v -2.5 -2.5 -2.5
v -2.5 2.5 -2.5
v 2.5 2.5 -2.5
v 2.5 -2.5 -2.5
v -2.5 -2.5 2.5
v 2.5 -2.5 2.5
v 2.5 2.5 2.5
v -2.5 2.5 2.5

vn 0 0 -1
vn 0 0 1
vn 0 -1 0
vn 1 0 0
vn 0 1 0
vn -1 0 0

vt 0 0
vt 0 1
vt 1 1
vt 1 0

usemtl box
f 1/1/1 2/2/1 3/3/1
f 3/3/1 4/4/1 1/1/1
f 5/1/2 6/2/2 7/3/2
f 7/3/2 8/4/2 5/1/2
f 1/1/3 4/2/3 6/3/3
f 6/3/3 5/4/3 1/1/3
f 4/1/4 3/2/4 7/3/4
f 7/3/4 6/4/4 4/1/4
f 3/1/5 2/2/5 8/3/5
f 8/3/5 7/4/5 3/1/5
f 2/1/6 1/2/6 5/3/6
f 5/3/6 8/4/6 2/1/6
And here it is without:

Code: Select all

mtllib ./box.mtl
g Box

v -2.5 -2.5 -2.5
v -2.5 2.5 -2.5
v 2.5 2.5 -2.5
v 2.5 -2.5 -2.5
v -2.5 -2.5 2.5
v 2.5 -2.5 2.5
v 2.5 2.5 2.5
v -2.5 2.5 2.5

vn 0 0 -1
vn 0 0 1
vn 0 -1 0
vn 1 0 0
vn 0 1 0
vn -1 0 0

usemtl box
f 1//1 2//1 3//1
f 3//1 4//1 1//1
f 5//2 6//2 7//2
f 7//2 8//2 5//2
f 1//3 4//3 6//3
f 6//3 5//3 1//3
f 4//4 3//4 7//4
f 7//4 6//4 4//4
f 3//5 2//5 8//5
f 8//5 7//5 3//5
f 2//6 1//6 5//6
f 5//6 8//6 2//6

Re: Conversion script woes

Posted: Sun Jun 22, 2014 12:16 am
by Stormrider
daveangel wrote:
Well, with much investigation, its wings that gets upset when you assign the same map to multiple materials.
It can be done... if you've got the latest wings save I'd be happy to take a look.

Re: Conversion script woes

Posted: Sun Jun 22, 2014 9:16 am
by spud42
i think this is the same problem i am having with my design. no matter what i try i dont get a correct .dat file after running the script. Thanks to stormrider i have a semi textured ship but i need to know how to fix this or where i am going wrong . I dont want to impose on someone else to finish my models for me.. kind of takes the shine off the creation process....

Re: Conversion script woes

Posted: Sun Jun 22, 2014 11:15 am
by daveangel
Well, after much trial and error, i have a fully textured craft. I can only suggest try to export often and check the obj2dattexnorm output and count the textures!

Stormrider, really appreciate the offer, at one point yesterday my hair was well and truly pulled out.

I've named it the 'Swift-fire', and will start to put the oxp together properly shortly.

Image

If anybody wants a play with the model, or can improve it, its hosted here

http://www.filedropper.com/swiftfire