material doesn't work

2square

29-09-2008 16:52:04

I am new to OGRE, and am having problems with material which works with Ogre but doesn't work with Mogre.

I have a skinned mesh with a material which I exported out of Blender using the OGRE Mesh Exporter. I was able to display the mesh with the material on OGRE using the following:

Entity *ent = mSceneManager->createEntity("Mannequin", "Mannequin.mesh");
ent->setCastShadows(true);
mSceneManager->getRootSceneNode()->createChildSceneNode()->attachObject(ent);

However, when I display the same mesh using Mogre I get only the default grey material:

Entity ent = sceneMgr.CreateEntity("Mannequin", "Mannequin.mesh");
ent.CastShadows = true;
SceneNode node = sceneMgr.RootSceneNode.CreateChildSceneNode("MannequinNode");

The paths are set appropriately on my resources.cfg, lighting is enabled and I am able to display the other meshes like ninja.mesh, robot.mesh with their material.

The relevant parts in Ogre.log are:

....
11:20:09: Parsing script Scene.material
11:20:09: Parsing script Mannequin.material
11:20:09: Parsing script deferred.material
...
11:20:10: Creating viewport on target 'Simple Mogre Form Window', rendering from camera 'SimpleCamera', relative dimensions L: 0.00 T: 0.00 W: 1.00 H: 1.00 ZOrder: 0
11:20:10: Mesh: Loading Mannequin.mesh.
11:20:10: Skeleton: Loading MannequinArmature.skeleton
11:20:10: WARNING: the mesh 'Mannequin.mesh' includes vertices without bone assignments. Those vertices will transform to wrong position when skeletal animation enabled. To eliminate this, assign at least one bone assignment per vertex on your mesh.
...

I have almost exhausted all possibilities I could think of, and desperately need some fresh perspective to solve this.

2square

30-09-2008 17:47:10

24 views .. no replies :?

ProfesorX

30-09-2008 19:18:11

I don't know if this affects, but this line in C++:

mSceneManager->getRootSceneNode()->createChildSceneNode()->attachObject(ent);


Shouldn't be in C#:

sceneMgr.RootSceneNode.CreateChildSceneNode().AttachObject(ent);


?

~[L]~

30-09-2008 23:57:46

@ProfesorX :
Yes, and, if he's using C++, that's not a pure managed C++ application,because he's using * instead of ^

MOGRE it's not only for C# !!!!

Dew~

2square

01-10-2008 01:30:30

Sorry for missing that. Actually my code looks like this:


Entity ent = sceneMgr.CreateEntity("Mannequin", "Mannequin.mesh");
ent.CastShadows = true;
SceneNode node = sceneMgr.RootSceneNode.CreateChildSceneNode("MannequinNode");
node.AttachObject(ent);


but even when I use

sceneMgr.RootSceneNode.CreateChildSceneNode("MannequinNode").AttachObject(ent)

it doesn't make any difference to the material not showing.