Blender Exporter Issue

The place for artists, modellers, level designers et al to discuss their approaches for creating content for OGRE.
Post Reply
User avatar
Game_Ender
Ogre Magi
Posts: 1269
Joined: Wed May 25, 2005 2:31 am
Location: Rockville, MD, USA

Blender Exporter Issue

Post by Game_Ender »

I am using the ogrexml exporter for blender and when I export my single .blend model file (which I imported from a sinlge .obj model file) i get about 45 seperate .mesh.xml files. I have spent several hours slapping toghether a little c++ tool to paste all the files toghether, but there has to be something I am doing wrong.

Each xml file contains only one submesh.

Edit Update: I looked at the .obj file I have and it appears that the mesh is composed of a bunch of "objects". So i commented out all the seperate "g" lines in the .obj(which appear to define the seperate object names) before importing and the export finnally outputed one file. It would be nice if you could just tell the exporter to put them in one file.
reimpell
OGRE Contributor
OGRE Contributor
Posts: 570
Joined: Mon Mar 01, 2004 10:35 am
Location: Hamburg, Germany

Re: Blender Exporter Issue

Post by reimpell »

Game_Ender wrote:It would be nice if you could just tell the exporter to put them in one file.
Blender can join several mesh objects into a single mesh object: Select the objects you want to join, choose "Object->Join Objects" or press the corresponding hotkey (crtl+j). More information can be found in Blender's manual.
User avatar
walaber
OGRE Expert User
OGRE Expert User
Posts: 829
Joined: Sat Oct 02, 2004 2:20 pm
Location: California, USA
Contact:

Post by walaber »

this is a bit unrelated, bit I don't think worth creating a new thread. I've noticed with the Blender exporter that exporting un-textured models (just diffuse/ambient color) often leads to missing polygons.

if I have a simple object, and export it with no texture/uv, I often experience missing polygons when loaded in Ogre (not reversed normals, but completely missing polygons). if I add a texture to the object, it is exported perfectly. anyone else experience this behavior? right now I'm using the exporter that came with the 1.0.2 source release of Ogre with Blender 2.7...
Go Go Gadget OGRE!!
Image
reimpell
OGRE Contributor
OGRE Contributor
Posts: 570
Joined: Mon Mar 01, 2004 10:35 am
Location: Hamburg, Germany

Missing polygons

Post by reimpell »

walaber wrote:this is a bit unrelated, bit I don't think worth creating a new thread. I've noticed with the Blender exporter that exporting un-textured models (just diffuse/ambient color) often leads to missing polygons.
Hmm, this is strange. If the "Game Engine Materials" option is set, the exporter intentionally skips polygons if the face draw mode is set to invisible or the face is hidden in edit mode (I will remove the later case as it doesn't seem to affect the game engine display). Also, I realized that I missed the case to skip invisible faces if there is no texture assigned.

Without the "Game Engine Materials" option set, materials with the "ENV" option set are exported with "depth_func always_fail" and therefore invisible.

Unfortunately, I am not able to reproduce the bug. Can you please send me such a failing .blend file?
User avatar
Game_Ender
Ogre Magi
Posts: 1269
Joined: Wed May 25, 2005 2:31 am
Location: Rockville, MD, USA

I was looking for that command

Post by Game_Ender »

Thank your reimpell, I had been looking through a bunch of blender tutorials just trying to get information on basic commands. I had not thought to run a search for the manual.
User avatar
walaber
OGRE Expert User
OGRE Expert User
Posts: 829
Joined: Sat Oct 02, 2004 2:20 pm
Location: California, USA
Contact:

Post by walaber »

reimpell - Sure, I'll send you a failing file... I think however it only happened when I used "Game Engine Materials"... I'll double-check, and once I have a clearer idea of the criteria that causes the problem I'll send you a .blend.

thanks again for this fantastic exporter by the way, I live by it! :P
Go Go Gadget OGRE!!
Image
User avatar
walaber
OGRE Expert User
OGRE Expert User
Posts: 829
Joined: Sat Oct 02, 2004 2:20 pm
Location: California, USA
Contact:

Post by walaber »

okay, here's a picture. the problem definately happens when exporting using the "Game Materials" option.

Image

:arrow: here's the .BLEND
Go Go Gadget OGRE!!
Image
reimpell
OGRE Contributor
OGRE Contributor
Posts: 570
Joined: Mon Mar 01, 2004 10:35 am
Location: Hamburg, Germany

Post by reimpell »

walaber wrote:the problem definately happens when exporting using the "Game Materials" option.
Many thanks for the blend file and the pictures. I still can't reproduce the bug using the linux version of Blender 2.37. I guess that Blender does not properly initialize the unused face.image and face.mode or face.flag values. This could result in a false positive for the check against invisible or hide flags of these faces. It may help to use the Make TexFace Editing (F9) button, as I expect it to correctly initialize the face values. However, if my guess is right, replacing the lines

Code: Select all

				# game engine materials
				if face.image:
					if (not(face.mode & Blender.NMesh.FaceModes['INVISIBLE'])
						and not(face.flag & Blender.NMesh.FaceFlags['HIDE'])):
						faceMaterial = GameEngineMaterial(data, face)
with

Code: Select all

				# game engine materials
				if face.image:
					faceMaterial = GameEngineMaterial(data, face)
in the export_mesh function of the script should remove that problem, but also the possibility to mark faces as invisible.
User avatar
walaber
OGRE Expert User
OGRE Expert User
Posts: 829
Joined: Sat Oct 02, 2004 2:20 pm
Location: California, USA
Contact:

Post by walaber »

ok, thanks for the tip. and thanks again for the fantastic exporter!
Go Go Gadget OGRE!!
Image
odyssey
Gnoblar
Posts: 13
Joined: Thu Mar 17, 2005 6:44 pm

Post by odyssey »

Umm, okay ..

..this may be too off base already but, are you certain all your Normals are facing OUT ?

To make certain, select your object and go into edit mode; select all vertices and press Ctrl + N. At the prompt, confirm that you do in fact want all your Normals facing out.

It may not be a dropped poly after-all. :)
User avatar
walaber
OGRE Expert User
OGRE Expert User
Posts: 829
Joined: Sat Oct 02, 2004 2:20 pm
Location: California, USA
Contact:

Post by walaber »

no they're definately pointing out, I have "show normals" chosen in edit mode and checked them all.
Go Go Gadget OGRE!!
Image
Post Reply