General Blender Issues

The place for artists, modellers, level designers et al to discuss their approaches for creating content for OGRE.
Post Reply
cryingraven

General Blender Issues

Post by cryingraven »

Hi guys n gals.

I am finally playing around with Ogre and have found the only way for me to create levels on my Mac is to use Blender, export the scene, open VPC and convert the .xml to .mesh using the command line tools, export back to my Mac partition and then run the game.

First question: Is there a simpler way of creating .mesh on a Mac? Preferably without having to rely on Windows?

Second question: For the life of me I cannot get any textures to display on the meshes I load into my level. Upon inspecting the .material file I notice that there is no texture specified. I then manually add a texture but still I get only a grey block. I then copy and paste a material definition from the ogre example.material and get the same result. The only way I get a difference onscreen is by selecting the rustedmetal.jpg texture as my texture. This results in an orange block (that does not resemble the texture at all) but at least it isn't grey :)

I figured the problem may be in the fact that I didn't specify a texture in blender, but rather created a coloured material for the meshes. I then went back into blender and changed my material from using Stucci texture to using an image texture and re-exported the meshes and looked at the created .material file. Still it makes no reference to any image files, nor any texture coords nor any texture repitions as specified in blender.

Can anyone please tell me how to create a scene in blender and actually make it appear in an Ogre app, please? I would really appreciate that VERY MUCH indeed :)

Last question: How do i use the .scene file to load a scene? I know this must be the most stupid question of the bunch but at the moment I am forced to ignore it completely, name all the meshes in my scene numerically cube001, cube002 etc and then load them in manually using a for loop and string creation routine.

Back to the texturing part: I create a plane and texture it using

Code: Select all

ground->setMaterialName("Examples/Rockwall");
and it works perfectly. Later on in the same function I do this:

Code: Select all

for (int x = 1; x < 9; x++)
{
			sprintf(scenery,"Cube.00%d.mesh",x);
			sprintf(sceneryName,"SceneryPart%d",x);
			
			GenericEntity = mSceneMgr->createEntity(sceneryName,scenery);
			mSceneMgr->getRootSceneNode()->attachObject(GenericEntity);
			GenericEntity->setMaterialName("Examples/Rockwall");
		   }
and all I get is a bunch of grey meshes on top of a textured plane.

Please help me out here...please! I have been stuck on this for days now. I have thus far managed to get the Newton physics lib to compile into my app and now need some scenery to test Newton on and for the life of me I have had so much trouble trying to get scenery into my level that I havent even been able to think about testing it out.

I thank you in advance for any help on the matter.

For interrest sake, here is my exported .material file after specifying textures for the cubes.
BTW, it gets exported as JapLevel.material but each one of my meshes when inspected in it's .xml format reveals that it is looking for scene.mesh. Go figure...

Code: Select all

material Walls/SOLID
{
	technique
	{
		pass
		{
			diffuse 0.524899 0.401376 0.237636
			specular 0.500000 0.500000 0.500000 12.500000
		}
	}
}
material Floor/SOLID
{
	technique
	{
		pass
		{
			diffuse 0.187121 0.107596 0.020073
			specular 0.500000 0.500000 0.500000 12.500000
		}
	}
}
material WallCorner/SOLID
{
	technique
	{
		pass
		{
			diffuse 0.860636 0.878031 0.599721
			specular 0.500000 0.500000 0.500000 12.500000
		}
	}
}

User avatar
NeOmega
Halfling
Posts: 86
Joined: Mon Apr 04, 2005 2:30 am
Location: Washington State, USA

Post by NeOmega »

second question answer:

be sure when you create the model, and when you try to view it in OGRE, that the texture is in the same folder as the model... it's much easier that way.
cryingraven

tried it

Post by cryingraven »

Tried it just now. Still no go.

I found a post in the forum about what settings to choose in blender when exporting but it wasn't too descriptive about what it should be. I am new to 3d modelling and have only ever worked with Quark before.

I just started learning Blender last week in order to use it with Ogre so I know there is still lots for me to learn about blender. By following some of what I found in the post I now get it to export my material file using multiple passes and specifying the texture.

Yet it still doesn't load the textures. I have all my textures in the default ./media/materials/textures/ dir and it is from here that the example materials find thier textures from so I know the filesystem is set up correctly. Just to test your theory I copied them into the ./media/models/ directory where the meshes are and then ran the app again. No go. Not with using the .material file nor the SetMaterial() method...

Can this be a Blender export settings problem or is this code related do you think?
reimpell
OGRE Contributor
OGRE Contributor
Posts: 570
Joined: Mon Mar 01, 2004 10:35 am
Location: Hamburg, Germany

Post by reimpell »

Exporter FAQ on the wiki wrote:Q. I added a texture to the material definition file after export, why doesn't it display?
See the FAQ.
cryingraven

Thanks a million

Post by cryingraven »

I was going through the tutorials and got to the materials section and noticed the option to use an image as opposed to procedural materials. I figured: I know how to create meshes, how to scale, rotate and place them where I want, how to texture them and I have the exporter set up...I now know everything...

I whould have gone on to the UV section... silly little person, me!

To quote the documentation: I is a lot more work but the result looks great.

Thanks a lot. It really made my day :)
reimpell
OGRE Contributor
OGRE Contributor
Posts: 570
Joined: Mon Mar 01, 2004 10:35 am
Location: Hamburg, Germany

Post by reimpell »

The tex2uvbaker script may be able to convert your procedural textures into image textures.
User avatar
NeOmega
Halfling
Posts: 86
Joined: Mon Apr 04, 2005 2:30 am
Location: Washington State, USA

Post by NeOmega »

Oh yeah... I assumed you knew the model needs UV textures.... also it is best to keep your textures in sizes of powers of 2.... ie 64x64 or 512x512 etc....
Post Reply