PDA

View Full Version : Blender 2.5.9 and S3D


blueduck
11-20-11, 06:52 PM
Hello Mates,

I've got a problem using Blender 2.5.9 with S3D - hope you can help me!
I would like to change the mapping of the roofs of some buildings in the harbor_kit.dat.
As long as the object just uses one texture (TGA) there is no problem with remapping or moving the triangles of the object.
Just if I try to add a new (second or higher) TGA to the object, the object will be shown right in Blender but after the import into the harbor_kit.dat it will not be shown or the object looks completely “de-textured” with a mess in the textures.


Here is what I tried so far:

Started S3D with habor_kit.dat of Stock LSH3V5.1 and added the already present texture Bricks_roof_D.TGA.

http://www.lsh3.com/ftp/support/pics/screen01.jpg

Saved the modified DAT.

Then I exported the TGA files "SUBCENTE.TGA" and "Bricks_roof_D.tga" as well as the 3D-Model of node 2482, subnode 2478 “SubCenter_lod00” to the same folder as the TGAs

http://www.lsh3.com/ftp/support/pics/screen02.jpg

Export-Settings in S3D:

http://www.lsh3.com/ftp/support/pics/screen03.jpg

Then I switched to Blender, imported the Wavefront (.obj), selected EditMode, created a new Material “Bricks_roof_D_9d0740f” with part of the parentID of the new texture and assigned the new Texture to the material.

Selected 4 of the roof-triangles assigned the new material. Changed to UV/ImageEditor and “Unwrapped” and repositioned the triangles. I saved this state of work as a .blend-file because the result in Blender looks ok so far.

http://www.lsh3.com/ftp/support/pics/screen04.jpg

Then I tried to export this work to a Wavefront (.obj). Selected all Triangles (a-key) then chose “File – Export - Wavefront (.obj)” and tried different settings for the checkable Options.

http://www.lsh3.com/ftp/support/pics/screen05.jpg

No matter which settings I used (maybe not all or the correct combination) the import into S3D failed.

The settings when reimporting the OBJ are

http://www.lsh3.com/ftp/support/pics/screen06.jpg

And the result is not changed to the original:

http://www.lsh3.com/ftp/support/pics/screen01.jpg

Now I ran absolutely out of any idea what might be wrong!

I hope someone can help!

Regards
Blueduck

Hans Witteman
11-20-11, 07:04 PM
Hello Mates,

I've got a problem using Blender 2.5.9 with S3D - hope you can help me!
I would like to change the mapping of the roofs of some buildings in the harbor_kit.dat.
As long as the object just uses one texture (TGA) there is no problem with remapping or moving the triangles of the object.
Just if I try to add a new (second or higher) TGA to the object, the object will be shown right in Blender but after the import into the harbor_kit.dat it will not be shown or the object looks completely “de-textured” with a mess in the textures.


Here is what I tried so far:

Started S3D with habor_kit.dat of Stock LSH3V5.1 and added the already present texture Bricks_roof_D.TGA.

http://www.lsh3.com/ftp/support/pics/screen01.jpg

Saved the modified DAT.

Then I exported the TGA files "SUBCENTE.TGA" and "Bricks_roof_D.tga" as well as the 3D-Model of node 2482, subnode 2478 “SubCenter_lod00” to the same folder as the TGAs

http://www.lsh3.com/ftp/support/pics/screen02.jpg

Export-Settings in S3D:

http://www.lsh3.com/ftp/support/pics/screen03.jpg

Then I switched to Blender, imported the Wavefront (.obj), selected EditMode, created a new Material “Bricks_roof_D_9d0740f” with part of the parentID of the new texture and assigned the new Texture to the material.

Selected 4 of the roof-triangles assigned the new material. Changed to UV/ImageEditor and “Unwrapped” and repositioned the triangles. I saved this state of work as a .blend-file because the result in Blender looks ok so far.

http://www.lsh3.com/ftp/support/pics/screen04.jpg

Then I tried to export this work to a Wavefront (.obj). Selected all Triangles (a-key) then chose “File – Export - Wavefront (.obj)” and tried different settings for the checkable Options.

http://www.lsh3.com/ftp/support/pics/screen05.jpg

No matter which settings I used (maybe not all or the correct combination) the import into S3D failed.

The settings when reimporting the OBJ are

http://www.lsh3.com/ftp/support/pics/screen06.jpg

And the result is not changed to the original:

http://www.lsh3.com/ftp/support/pics/screen01.jpg

Now I ran absolutely out of any idea what might be wrong!

I hope someone can help!

Regards
Blueduck

Hi mate,

I don't use Blender but it seem a UVW id problem just make sure your UV template correspond to change done.

hope it help a bit.

Best regards Hans

Madox58
11-21-11, 05:43 PM
It would be easier to figure out if We had the obj and mtl files to look at.
:yep:

Hans Witteman
11-21-11, 06:08 PM
It would be easier to figure out if We had the obj and mtl files to look at.
:yep:

Hi mate,

And yep with file it is a lot easier to pin point the problem!

Best regards Hans

the_frog
11-21-11, 06:58 PM
Hello blueduck!

Seems you want to add a material to a model. To have that done without problems as those you described, I use following procedure:

1. export the model with the original material
2. replace the linked material by the desired 2nd one
3. export again the model but make sure with a different name (add something such as _2nd_mat)
4. import the *.obj into the 3D editor, delete the 3D object (the material, however, remains)
5. import the *_2nd_mat.obj and you have the two material, both with the correct ID
6. start re-mapping or whatsoever

There might be easier and more sophisticated pathways but this one works smoothly with Wings3D and I guess with Blender, too.

the_Frog

Madox58
11-21-11, 07:25 PM
I'd probably open the mtl file in NotePad and rename things.
But I haven't seen the files and trying to trouble shoot things like this without the original files is to much time wasted.
Simple solution? Send the files, get the answer.
The days of mistrust are supposed to be behind us.

blueduck
11-22-11, 05:37 PM
Thank you mates for your reply!



Hans made me have a look at the .mtl files and I compared the S3D export with the Blender export and realized that the materials were inverted.
http://www.lsh3.com/ftp/support/pics/screen08.jpg

After changing the order and deleting the “Ni”-Parameter it worked fine!
http://www.lsh3.com/ftp/support/pics/screen09.jpg

My conclusion: Blender export has to be modified by hand to arrange the materials and their parameters in the order of the S3D export.

So I tried the next building: Ny_building07:
http://www.lsh3.com/ftp/support/pics/screen001.jpg

All the steps as described before, rearranged the materials in the blender exported .mtl but the import result is this, although I followed the_Frogs hint to delete the 3D-Object first:
http://www.lsh3.com/ftp/support/pics/screen002.jpg


I uploaded the package with the S3D exported and Blender exported files to:
http://www.lsh3.com/ftp/support/pics/Blender_S3D.7z (http://www.lsh3.com/ftp/support/pics/Blender_S3D.7z)


Maybe you could give me another hint!

Regards
Blueduck

Madox58
11-22-11, 06:10 PM
Got your files Mate.
Will look into this ASAP.

Regards!
:salute:

Hans Witteman
11-22-11, 08:49 PM
Hi mate,

Glad to see you sorted out.:Kaleun_Salute:

Best regards Hans

skwasjer
11-22-11, 11:37 PM
If the material id postfix is missing in an mtl name (see the MTL S3D generates), S3D will first try to attempt to match materials by name, but will otherwise fall back to taking the order in which the materials are listed in the MTL file. So if the order is different, the material name not exactly matching that in S3D, and the id postfix is missing too, then it will cause incorrect uvmap index assignment as you have experienced.

There's a few ways you can work:
- always use material id's in the material name.
- always make sure each material name is unique (but this isn't always the case), but matching both in S3D and 3D app.
- if not, simply ensure you've got the same order of materials both in your 3D editor and S3D.

As such, I do not know why you still have this issue on your second attempt. Hope privateer can tell you.

Madox58
11-23-11, 05:53 PM
Hi Mate,

I looked at the files and did an import with S3D.
Edit the MTL as you did the other building.
Blender is doing an oddball job on MTL things.
Why they would code it to do it that way is beyound me.

Add the cement texture to the assigned textures in S3D before importing your adjusted mesh.
You'll need to move the assigned textures in S3D up or down to get what you want.

I also saw that the original mesh has a few inverted faces so you may want to flip those.
And you may want to adjust the original UV's as the streakiness seems to be a weird UV layout when a different texture is used.

:yep:

iambecomelife
11-23-11, 06:49 PM
Hi Mate,

I looked at the files and did an import with S3D.
Edit the MTL as you did the other building.
Blender is doing an oddball job on MTL things.
Why they would code it to do it that way is beyound me.

Add the cement texture to the assigned textures in S3D before importing your adjusted mesh.
You'll need to move the assigned textures in S3D up or down to get what you want.

I also saw that the original mesh has a few inverted faces so you may want to flip those.
And you may want to adjust the original UV's as the streakiness seems to be a weird UV layout when a different texture is used.

:yep:

I have noticed the newer versions of S3ditor will render my ship's skins incorrectly. They show the exact same streaking problem. In the actual game engine they look fine. Not sure this is what's going on, but you might want to check.

Madox58
11-23-11, 06:56 PM
I have noticed the newer versions of S3ditor will render my ship's skins incorrectly. They show the exact same streaking problem. In the actual game engine they look fine. Not sure this is what's going on, but you might want to check.


Yes, You are right.
I forgot S3D does not tile the textures the way most 3D modeling programs do.
So you'll need to check in Game.