Problems Loading Materials with .osm File

Ohndei

07-08-2006 19:29:52

My team and I are new to OFusion and are still learning how to use it properly. We are currently working to see how we might use .osm files to create levels for our game.

Currently, the materials needed for the objects in the scene are not being properly loaded/referenced/whatever. I am receiving an exception saying the Sky plane material "mySkyPlane" could not be found.

<skyTechnique type="1" material="mySkyPlane" drawFirst="yes" tiling="10" scale="2000" dist="5000" bow="0" xSegments="1" ySegments="1" />

"mySkyPlane" is defined in the .material file "TestScene.material" which is located both in the same directory as "TestScene.osm" as well as the materials/scripts/ directory of our Ogre build.

I'm sure its a simple fix, but we haven't been able to resolve it yet. What might we be doing wrong?

(As a side note, I noticed that when the trouble line was commented out, the scene meshes would be loaded, but without any textures.)

Thanks in advance.

----------

For reference, here's the .osm file:

<oe_scene>
<sceneManager type="0" />
<bkgcolor r="0.8" g="0.9" b="1.0" />
<lightColor r="0.5" g="0.5" b="0.5" />
<shadowTechnique type="0" tex_size="512" tex_count="1">
<color r="0" g="0" b="0" />
</shadowTechnique>
<skyTechnique type="1" material="mySkyPlane" drawFirst="yes" tiling="10" scale="2000" dist="5000" bow="0" xSegments="1" ySegments="1" />
<entities>
<entity name="Ground" hidden="false" filename="Ground.mesh" CastShadows="yes" ReceiveShadows="yes">
<position x="0" y="0" z="0" />
<rotation x="0" y="0" z="0" w="-1" />
<scale x="1" y="1" z="1" />
</entity>
<entity name="WoodenBox" hidden="false" filename="WoodenBox.mesh" CastShadows="yes" ReceiveShadows="yes">
<position x="-58.7097" y="1.12531" z="-227.292" />
<rotation x="0" y="0" z="0" w="-1" />
<scale x="1" y="1" z="1" />
</entity>
<entity name="WindowBox" hidden="false" filename="WindowBox.mesh" CastShadows="yes" ReceiveShadows="yes">
<position x="-189.661" y="0" z="-225.569" />
<rotation x="0" y="0" z="0" w="-1" />
<scale x="1" y="1" z="1" />
</entity>
<entity name="SphereNormals" hidden="false" filename="SphereNormals.mesh" CastShadows="yes" ReceiveShadows="yes">
<position x="85.3439" y="34.9391" z="-169.813" />
<rotation x="0" y="0" z="0" w="-1" />
<scale x="1" y="1" z="1" />
</entity>
</entities>
<lights>
<light name="Test" type="omni" on="true" CastShadows="no" intensity="1">
<position x="72.8693" y="5.71606" z="-21.1051" />
<rotation x="-0.707107" y="0" z="0" w="-0.707107" />
<scale x="1" y="1" z="1" />
<color r="1" g="1" b="1" />
<specular r="1" g="1" b="1" />
</light>
<!--
<light name="Omni01" type="omni" on="true" CastShadows="no" intensity="1.75021">
<position x="-411.849" y="370.589" z="-219.549" />
<rotation x="0" y="0" z="0" w="-1" />
<scale x="1" y="1" z="1" />
<color r="0.984314" g="1" b="0.505882" />
<specular r="0.984314" g="1" b="0.505882" />
</light>
<light name="Omni02" type="omni" on="true" CastShadows="no" intensity="1.675">
<position x="476.232" y="370.589" z="-219.549" />
<rotation x="0" y="0" z="0" w="-1" />
<scale x="1" y="1" z="1" />
<color r="0.87451" g="0.345098" b="0.203922" />
<specular r="0.87451" g="0.345098" b="0.203922" />
</light>
-->
</lights>
</oe_scene>

Ohndei

08-08-2006 20:55:55

Update:

I have solved the problem (mostly).

The application I was using (an extension of ExampleApplication) was not loading the resources before I was attempting to create the scene.

It was a simple fix. I simply moved the call to loadResources() so it was invoked earlier.

The textures still aren't being applied properly, but I suspect that is because the meshes need upgrading...

Lioric

08-08-2006 21:26:11

The textures not displaying is mostly related to your previous resource issue, its not because of the meshes needing upgrade

See your ogre.log file for hints on this