Blender Texture mapping issue.

Blake

Addon Developer
Addon Developer
Joined
Mar 9, 2009
Messages
295
Reaction score
241
Points
58
Location
Lehi, Utah
Hello all.

I have been lurking here for some time, and even had an account on the old board (I believe).

I am putting together a workflow using blender and I am running into a funny problem that I cannot seem to find a solution for and I am wondering if anyone has seen it.

I am trying to use Blender's UV mapping and it appears very slick. Everything looks great in Blender but when I pull up my 'ship' (a simple cube right now) in Orbiter the texture is inverted (backward and upside down). I have gone throught he Blender tutorials on UV mapping and I cannot see what I am doing wrong.

Simple workflow:
- I unwrap the model in Blender and save the layout to a .tga file.
- Pull the .tga into PhotoShop and paint.
- Save as .DDS file (using NVidia plugin).
- Load image into Blender and lineup with layout.
- Export using the Orbiter export plugin without generating .DDS. (I cannot get the generate dds option to work without error--that may be the next problem to tackle).

If anyone can tell me the dumb thing I am doing wrong I would appreciate.

Thanks.
 
Hello all.

I have been lurking here for some time, and even had an account on the old board (I believe).

I am putting together a workflow using blender and I am running into a funny problem that I cannot seem to find a solution for and I am wondering if anyone has seen it.

I am trying to use Blender's UV mapping and it appears very slick. Everything looks great in Blender but when I pull up my 'ship' (a simple cube right now) in Orbiter the texture is inverted (backward and upside down). I have gone throught he Blender tutorials on UV mapping and I cannot see what I am doing wrong.

Simple workflow:
- I unwrap the model in Blender and save the layout to a .tga file.
- Pull the .tga into PhotoShop and paint.
- Save as .DDS file (using NVidia plugin).
- Load image into Blender and lineup with layout.
- Export using the Orbiter export plugin without generating .DDS. (I cannot get the generate dds option to work without error--that may be the next problem to tackle).

If anyone can tell me the dumb thing I am doing wrong I would appreciate.

Thanks.

Had this same problem with Wings3d. The problem is that Orbiter treats UV coordinates with (0,0) being the upper left and the 3d modeller treats UV coordinates with (0,0) being the lower left (or vice versa, i don't remember).

Just manually flip the texture until it works, or export your UV coordinates accordingly.
 
Hmmm, strange, it's always worked for me. Are you sure your normals are pointing the right way? (Are you seeing the inside or outside of the box?).

If you are seeing the wrong side you can flip them by selecting the face(s) and using W >> "Flip Normals"
 
You always have to flip your texture vertically for use with Orbiter. I have to keep two sets of textures - one normal for my 3D modelling program and one flipped vertically for use with Orbiter. There may or may not be some option in blender to treat the texture coordinates as if they are flipped, but I haven't found that option yet (it would be easier than keeping 2 copies of textures).
 
Thanks for the replies, I will play with this and report what I find.

Edit:

It works well if I save the layout from Blender to a .tga file and then open that in Photoshop. Copy the layout layer so that it can be on top, then create other layers to paint your texture. When you are done save as Photoshop file and then hide all layers except those you want visible on the texture. Then select Image/Rotate Canvas/Flip Canvas Vertical.

Save as .DDS.

It would be nice to be able to pull this image back into Blender, but if you used the layout correctly you should not have to.

I have only tried this with simple shapes so far, and have not tried putting several layouts on one texture, but it seems Blender has a way of supporting that.

Would love to hear from anyone else using Blender to do UV mapping.
 
Last edited:
I've never had any problems with flipped textures in blender. I'm not sure if it's because of blender or blend2msh.

I can't think of anything, but if you can find anything that fixes please post it so I can figure what is going on.
 
I've never had any problems with flipped textures in blender. I'm not sure if it's because of blender or blend2msh.

I can't think of anything, but if you can find anything that fixes please post it so I can figure what is going on.

I'm not using the export script to generate the texture file. I get a 'Access to <orbiter directory> denied.' error when I enable the option to build the texture file. This is an error dialog that's thrown up by DxTex.

I'm using a .dds file created in Photoshop. If I flip the Photoshop file then it works fine, but I cannot use it to line things up in Blender. I imagine if I could get past the error above the script generated texture would work--then I could see it in Blender.
 
I'm not using the export script to generate the texture file. I get a 'Access to <orbiter directory> denied.' error when I enable the option to build the texture file. This is an error dialog that's thrown up by DxTex.

I'm using a .dds file created in Photoshop. If I flip the Photoshop file then it works fine, but I cannot use it to line things up in Blender. I imagine if I could get past the error above the script generated texture would work--then I could see it in Blender.

Sounds like you're on Vista with UAC turned on?

If so, the Program Files directory is read-only. You'll need to either run the program as administrator or move Orbiter somewhere other than "Program Files".
 
Sounds like you're on Vista with UAC turned on?

If so, the Program Files directory is read-only. You'll need to either run the program as administrator or move Orbiter somewhere other than "Program Files".

No, XP (tried Vista and went back).

I probably should have played with the export script a bit more. I am trying to develop into a folder other then 'Orbiter' so in the export script I set the Orbiter directory to my 'shadow' folder which has only a sub set of the folders from Orbiter that I need. When I'm ready to run I then move everything into the Orbiter folder. I set the DxTex tool path to the 'real' orbiter path. DxTex does not like this setup and complains about access--don't know why.

If I set the paths to the Orbiter directory then it all works.

I am trying to develop a workflow where I have source files in one folder that create output files that go into an 'Orbiter' directory structure that can then be easily zipped and moved to the 'real' Orbiter directory. Pointing the export script to the secondary structure works for exporting the mesh, but not for creating the textures.

Anyway, I think I am getting there.

Thanks for the help.
 
Update...

I have the exporter working now and creating the texture file. Everything looks good in Blender, but I must still flip the resulting .dds texture in Orbiter.

Is there a detailed walkthrough using Blender to Orbiter somewhere? My google skills are failing me on that one.

It is not a big deal to flip the texture, but I would rather not have to.

Thanks.
 
Are you using Guy Webb's Orbiter mesh exporter Python script? If so, you can edit the script so that you won't need to flip the texture.

Open the orbiter_export.py file with Blender's text editor, and turn on syntax highlighting and line numbers. Go to line 577. It should read:
Code:
outputFile.write(str(self.TextureCoordinates[1]) + '\n')
Change that to:
Code:
outputFile.write(str(1 - self.TextureCoordinates[1]) + '\n')
This flips the UV coordinates vertically on export.


While you're at it, change line 570 from:
Code:
outputFile.write(str(self.Normal[0]) + ' ')
to:
Code:
outputFile.write(str(self.Normal[0] * -1) + ' ')
This will fix a problem with wonky normals caused by the change from a right- to a left-handed coordinate system.

Save the changes, and you won't need to flip the textures anymore.
 
Last edited:
George, I have not had a chance to try this until now, but it works great. Thanks.

(Why has the code not been corrected in SourceForge?)
 
Back
Top