Texture Coordinates not Exporting From Blender

Problems building or running the engine, queries about how to use features etc.
EricCPeterson
Gnoblar
Posts: 1
Joined: Fri Apr 25, 2025 3:49 pm

Texture Coordinates not Exporting From Blender

Post by EricCPeterson »

Ogre Version: Ogre 14.3.4 Win32 Build
Operating System: Win 10 Pro 64 for Workstations
Render System: OpenGL

I'm integrating a bunch of equipment models for use in an interactive semiautomated prompting/monitoring system. The equipment models were built in Solidworks 2024 and 2025.

I've exported STL from Solidworks and imported the STL into Blender 4.4.

In Blender I've created and assigned one material to a model. Then I enter edit mode, faces, select the two faces of a raised placard, create and assign a second material. The second material has a texture that needs to be basically face extents mapped to the two selected faces, which are aligned with the object's principle axes. I set up the texture material wiring diagram as shown and everything looks fine in the preview and render viewports.

I've installed Blender2Ogre 0.6.2, enabled it, set the add-on preference path to the Ogre Win32 release build's OgreXMLConverter.exe. I've also set the preference path to OgreMeshUpgrader.exe, although I don't know what that's for. I use File/Export/Ogre3D, verify that export materials is checked on, and export the mesh, scene, and materials. There are no warnings or errors. Export goes all the way to binary mesh and I don't even see the intermediary xml mesh file.

I rename the two materials to something unique, like objectname.001.material and objectname.002.material, and then go into the scene file and rename the two material references there to match the new material file names.

When my Win32 Ogre application initializes, it loads up my objects and displays them, but any faces that should present a text placard are just noisy gray and black uniformly covering the second material faces. There are no Ogre warnings or errors as the application starts up.

It doesn't appear that the exporter is handling the texture coordinates correctly. Is there a change to the mapping and texture pipeline I can make that will work? In a perfect world I'd align and autofit a UV gizmo to the selected faces and abandon the offsets, rotations, and scale factors, but I can't find a way to do that; the UV Editing tab doesn't seem to do anything. It's clear that STL models import texture coordinate-free, and I can't get the UV Editing screen to do anything at all for the object or for the selected faces despite the presence of the texture coordinate and mapping processes in the material pipeline.

Image

rpgplayerrobin
Orc Shaman
Posts: 735
Joined: Wed Mar 18, 2009 3:03 am
x 411

Re: Texture Coordinates not Exporting From Blender

Post by rpgplayerrobin »

Can you create a minimal reproducible blender project that creates the invalid mesh/texture coordinates?
In that case I can try to export it from Blender 4.4 myself and see if it also messes up things for me.

User avatar
sercero
Bronze Sponsor
Bronze Sponsor
Posts: 499
Joined: Sun Jan 18, 2015 4:20 pm
Location: Buenos Aires, Argentina
x 180

Re: Texture Coordinates not Exporting From Blender

Post by sercero »

Why are you using Blender2Ogre 0.6.2?

Are you aware of the official repo: https://github.com/OGRECave/blender2ogre?

EricCPeterson
Gnoblar
Posts: 1
Joined: Fri Apr 25, 2025 3:49 pm

Re: Texture Coordinates not Exporting From Blender

Post by EricCPeterson »

Correction. I am using the version from the github archive. I assumed the last version listed in changelog.txt would be the version I was looking at. The last version listed in the changelog file is 0.6.2.

Last edited by EricCPeterson on Wed Apr 30, 2025 12:16 am, edited 1 time in total.
User avatar
dark_sylinc
OGRE Team Member
OGRE Team Member
Posts: 5494
Joined: Sat Jul 21, 2007 4:55 pm
Location: Buenos Aires, Argentina
x 1365

Re: Texture Coordinates not Exporting From Blender

Post by dark_sylinc »

The plugin exports texture coordinates from UVs.

The picture you posted shows the material is not using UVs, but rather generated from its object. Those cannot be exported.

If you want the model to have UVs, you need to generate them. You can do so by entering Edit Mode, then select all faces, then in the UV menu chose one of the options (Unwrap, Smart UV Project, Cube Projection, etc). However it's likely the results out of the box won't be what you're looking for and the UVs will need manual tweak.

You will also need to tweak the Material to use the "UV" instead of "Object" (see the "Texture Coordinate" node on the left from the picture you posted) so you can see how those UVs look when rendered.