3DS Max exported meshes have no textures

The place for artists, modellers, level designers et al to discuss their approaches for creating content for OGRE.
hdeboer332
Gnoblar
Posts: 20
Joined: Sun Dec 11, 2011 2:55 pm

3DS Max exported meshes have no textures

Post by hdeboer332 »

I'm simply trying to replace the tutorials' OgreHead with an axe.

Image

I tried with both Multiverse and OgreMax. I exported to a .mesh file which was accompanied by a .material file.

I put the .mesh in
"C:\Users\admin\Downloads\Programs\OgreSDK_vc10_v1-7-3\media\models"

and the .material in
"C:\Users\admin\Downloads\Programs\OgreSDK_vc10_v1-7-3\media\materials\scripts"

Image

So, the axe handle and head are completely seperated and there are no textures, it's just.. white.

What am I doing wrong?
User avatar
Kojack
OGRE Moderator
OGRE Moderator
Posts: 7157
Joined: Sun Jan 25, 2004 7:35 am
Location: Brisbane, Australia
x 535

Re: 3DS Max exported meshes have no textures

Post by Kojack »

I put the .mesh in
"C:\Users\admin\Downloads\Programs\OgreSDK_vc10_v1-7-3\media\models"

and the .material in
"C:\Users\admin\Downloads\Programs\OgreSDK_vc10_v1-7-3\media\materials\scripts"
Where did you put the textures? They need to be copied into one of the ogre resource directories too.
hdeboer332
Gnoblar
Posts: 20
Joined: Sun Dec 11, 2011 2:55 pm

Re: 3DS Max exported meshes have no textures

Post by hdeboer332 »

Forgot to mention, I did add them to
"C:\Users\admin\Downloads\Programs\OgreSDK_vc10_v1-7-3\media\materials\textures"

I just noticed this though, in the .material file, it sais this:

Code: Select all

material metal3
{
	technique
	{
		pass
		{
		}

	}

}



material metal2
{
	technique
	{
		pass
		{
		}

	}

}



material metalring
{
	technique
	{
		pass
		{
			ambient 0.294118 0.294118 0.294118 1
			diffuse 0.588235 0.588235 0.588235 1
			specular 0.184841 0.184841 0.184841 1 59

			texture_unit
			{
				texture brushed_metal3.jpg
				colour_op_ex add src_texture src_current
				colour_op_multipass_fallback one one
				transform -0.071555 4.09938 0 0.00880236 -4.09938 -0.0715552 0 1.00865 0 0 1 0 0 0 0 1
			}
		}

	}

}



material handle
{
	technique
	{
		pass
		{
		}

	}

}



material metalpiramides
{
	technique
	{
		pass
		{
			ambient 0.294118 0.294118 0.294118 1
			diffuse 0.588235 0.588235 0.588235 1
			specular 0.3087 0.3087 0.3087 1 70
		}

	}

}



material axewood
{
	technique
	{
		pass
		{
		}

	}

}



material metalsnake
{
	technique
	{
		pass
		{
			ambient 0.294118 0.294118 0.294118 1
			diffuse 0.588235 0.588235 0.588235 1
			specular 0.3087 0.3087 0.3087 1 70

			texture_unit
			{
				texture snakeskin bump.jpg
				colour_op_ex add src_texture src_current
				colour_op_multipass_fallback one one
				transform 3 0 0 0 0 3 0 0 0 0 1 0 0 0 0 1
			}
		}

	}

}



material metalaxe
{
	technique
	{
		pass
		{
		}

	}

}



material metalhat
{
	technique
	{
		pass
		{
		}

	}

}



material axemetal
{
	technique
	{
		pass
		{
		}

	}

}
It only mentions two texture files, there are about 10. That isn't right..

I just tried to export to .scene instead of mesh using OgreMax and this creates a buttload of .mesh files along with a .secene file and a .material file. But that material file is the same as the previous one, it's only mentioning two texture files.

1. Am I to understand exporting to .scene splits the object up into multiple meshes which I should then link inside of my ogre project. If so, what's the .scene file for?
2. What am I doing wrong, how can I make the mesh (or meshes) export with a material file that properly links texture files to the object?
User avatar
Kojack
OGRE Moderator
OGRE Moderator
Posts: 7157
Joined: Sun Jan 25, 2004 7:35 am
Location: Brisbane, Australia
x 535

Re: 3DS Max exported meshes have no textures

Post by Kojack »

Ogremax probably doesn't like the kind of max material the axe uses. In max you need to use an ogremax material (it has a gui to set up the techniques, passes, texture units, etc).
http://www.ogremax.com/Documents/OgreMa ... rials.html


.scene is the list of which .mesh files are in a scene, with positions, scales and rotations for them all. There's also stuff in there like lights and cameras.
ogre itself doesn't understand .scene, but ogremax comes with example code for loading one.


For the head and handle separation, try here: http://www.ogremax.com/Documents/OgreMa ... eshes.html
hdeboer332
Gnoblar
Posts: 20
Joined: Sun Dec 11, 2011 2:55 pm

Re: 3DS Max exported meshes have no textures

Post by hdeboer332 »

I've been trying like pretty much every combination of grouping / linking etc. and setting various objects as SubMesh but it never really produces the desired result. I got really close once but for some reason the axe handle wasn't going through the axe head, instead the axe head was above the handle and in front of it.

What did net the desired result (I think) was exporting as .scene. But even then textures still don't work, guess I have to figure out how to convert the textures to OgreTextures. Could you pherhaps tell me where I can find the code to load .scene files into Ogre? Or is that for paying OgreMax customers only? Since I couldn't find it anywhere.

At least I can do other stuff while I figure the texture thing out :)
User avatar
Kojack
OGRE Moderator
OGRE Moderator
Posts: 7157
Joined: Sun Jan 25, 2004 7:35 am
Location: Brisbane, Australia
x 535

Re: 3DS Max exported meshes have no textures

Post by Kojack »

The scene loader code is in the "Ogremax Viewers" download on the main dowload page.
User avatar
Pyritie
Gnome
Posts: 363
Joined: Wed Feb 25, 2009 6:15 pm
Location: UK
x 8

Re: 3DS Max exported meshes have no textures

Post by Pyritie »

hdeboer332 wrote:It only mentions two texture files, there are about 10. That isn't right..
Are you exporting the entire scene or just "selected objects"? Try the latter if it's exporting too much. (Note that it will also try to export stuff like splines and other helpers as .meshes - just delete them)
I'm not entirely sure, but ogremax might just export all custom materials you have on your materials palette instead of just ones you're using... I forget
1. Am I to understand exporting to .scene splits the object up into multiple meshes which I should then link inside of my ogre project. If so, what's the .scene file for?
From how I use ogremax, it exports each object as a .mesh and the .scene tells you how they were placed in the scene. You can either load the .scene file directly (there's loads of tutorials and sample code on how to do this) or just convert it to your own world file format, or even just hard-code it if you want. It's just XML so it should be easy to read.

I personally convert the .scene to my own file format which stores all of the components game objects are made of, including relative positions/rotations of all of the meshes. At runtime I give each game object its own scene node and then make child scene nodes from it for attaching all of the other meshes onto it.
2. What am I doing wrong, how can I make the mesh (or meshes) export with a material file that properly links texture files to the object?
keep in mind that if you're using max's default materials, OgreMax won't know what to do with most of it if you're doing anything advanced with them. All of my textures as simple diffuse ones so they aren't a problem for me, but if you're doing stuff like bump maps and fancy stuff like that, it might not know how to use them.


Oh! One last thing to keep in mind: If your texture filename has any spaces in it, you'll need to put quotes around the filename in your .material file, but Ogremax doesn't add them automatically.

so your

Code: Select all

            texture snakeskin bump.jpg
should be

Code: Select all

            texture "snakeskin bump.jpg"
I would also recommend commenting out the other stuff in that material (such as the colour_op's and transform) until you've got the diffuse working.
I use Mogre, BulletSharp, LuaNetInterface, irrKlang, and Miyagi! | Ponykart (Showcase)
Image
hdeboer332
Gnoblar
Posts: 20
Joined: Sun Dec 11, 2011 2:55 pm

Re: 3DS Max exported meshes have no textures

Post by hdeboer332 »

Thanks Pyritie, I'll try to get this working again once I figure out how to make a camera follow an object (trying to make a 3d person cam). Can't do too many things at once :mrgreen:

To answer your question; I tried both exporting the entire scene to .mesh and selected objects only. Neither did what I'd expect them to do. And by that I mean that in both cases the textures were still missing ánd in one of those situations (dont remember which) the axe head didn't export along at all.