applying a texture to an mesh exported from blender

flangicusmechanicas

07-03-2013 19:29:05

Hi any and all, I'm having some issues applying a texture to an cylinder object I've made in blender. I used the blender to ogre exporter and now have a mesh file, along with a texture file (.png) that was applied to it in blender. How would I go about applying this texture to the object? I've been looking around but can't seem to find an answer on the forum or mogre wiki, have I missed something?

I'm using VB.net (but I assume it's not a ton of effort to "translate" from another language version of mogre) with mogre, I made my own "framework" based on tutorial 5 (i think it was 5).

I can only imagine this needs to be run in createscene(), after I dim the entity..?

If anyone can spare a moment to help with that, it would be appreciated.

other things I need to do but can probably find out about myself, if you already know how to do this then please let me know;
add textbox to write in to the window
add clickable button in the window
"reset" the scene (IE kill everything except the window itself, and then re-run the createscene code)

wolen

07-03-2013 21:27:56

Hi, I have same problem but I found only one amateur solution. There must be a better solution but for me it was enough. I used OgreMeshMagick.exe and setted my material (http://www.ogre3d.org/tikiwiki/MeshMagick) you must have prepared you texture in material.
You can have some simple material like:

material Venus
{
technique
{
pass
{
ambient 0.588235 0.588235 0.588235 1
diffuse 0.588235 0.588235 0.588235 1
fog_override true
scene_blend alpha_blend
texture_unit
{
texture_alias 0
texture venus.png
}
}
}
}


I dont know if it helpfull but this will set texture without any programming. And about your buttons. Have you triyed Miyagi?

flangicusmechanicas

08-03-2013 07:53:27

Ok, I'll give that a go, I'll let you know how it goes.

Have you triyed Miyagi?

Not entirely sure what that is, I'll give it a look tonight.

Thanks very much!

wolen

08-03-2013 18:08:34

Miyagi is GUI for Mogre http://www.ogre3d.org/tikiwiki/Miyagi

flangicusmechanicas

18-03-2013 10:47:54

Hiya, sorry for the pause between posts.

I've made a material as shown in your example, but I'm unsure of how to actually apply it to the entity; I assume it uses the setmaterial function, but I don't know how to set my material to a variable. Would you be able to offer any help with that? I'm really struggling to work this out.

wolen

20-03-2013 15:45:31

Now I am little bit confused. I thought you exported object.mesh from blender and you have troubles with a texture. If I am right so you just use OgreMeshMagick.exe and rename material. Firstly you find what material is used. (command info) and after that you set your material -material=:before:after:. I don't know what is VB syntax (using C#) but if you setted material you just create an entity and a sceneNode. Material should be applied because Ogre load it into your mesh object.

flangicusmechanicas

21-03-2013 11:03:18

I used meshmagick but it didn't seem to actually do anything in my actual program
Info etc from meshmagick (changed material name from _missing_material_texture to sylinder.material, and submesh 0 name from _missing_material_ to 0):

http://i.imgur.com/jXoIcOC.png

in the program it still uses a blank white texture/material. I managed to use "QTmesheditor" which did apply the texture to the mesh successfully (ogremeshy views it with correct texture), but this causes my program to crash with a "SEHException" when it completes this line, specifically crashing on the name of the mesh (different filename as it is NOT the meshmagick version):

Dim smallscale As Entity = sceneMgr.CreateEntity("smallscale", "micromrotatscale2.mesh")

in ogremeshy:
http://i.imgur.com/1PdszBD.png

in the program:
http://i.imgur.com/AQE60Gt.png

in a nutshell: meshmagick renamed the material but didn't actually change it in the program, QTmesheditor worked but crashes the program when MOGRE tries to load it.

link to QTmesheditor: http://www.hogpog.com.br/index.php/en/a ... mesheditor -on chrome you can right click->translate if needed



Apologies if I've missed something obvious :?

wolen

21-03-2013 12:48:24

Here my skills endings =(. My last idea: Make sure you have material in Media/materials/scripts, texture in Media/material/textures and your object in Media/models. And look into Ogre.log if you can found some error like loading material or something like it.

flangicusmechanicas

21-03-2013 22:18:11

For my purposes, I'm allowed to be a bit lazy and just use text overlay to solve the problem (for now), but if/when i get a chance to come back to this I will add a post with a fix if I've managed to find one.

Here my skills endings =(
thanks for you advice so far though, it's actually been really useful! :D