irrb 0.4 (Blender Exporter)

Announce new projects or updates of Irrlicht Engine related tools, games, and applications.
Also check the Wiki
pippy3
Posts: 155
Joined: Tue Dec 15, 2009 7:32 am

Post by pippy3 »

A small bug/ enhancement:

irrb only exports the first layer. It would be great if it exported from selected layers.

Most advanced blender users like to hide construction models on hidden layers, but have exportable meshes on different layers.
pc0de
Posts: 300
Joined: Wed Dec 05, 2007 4:41 pm

Post by pc0de »

pippy3 wrote:irrb only exports the first layer. It would be great if it exported from selected layers.
Hello pippy3 - irrb 0.4 supports exporting objects in visible layers. Objects that exist _only_ in hidden layers, are not exported.

Are you using version 0.4? If so, please post a link to an example .blend file that isn't being exported as you would expect. Thanks.
floppyfreak
Posts: 117
Joined: Sat Apr 19, 2008 10:14 am

problem with irrbmesh export:no textures with blanks in path

Post by floppyfreak »

I have done some testing with the irrbmesh export. The loader does not display texture files when the filename contains blanks: c:\some dir\ will not display any textures, while c:\somedir\ will work well. This problem occurs only with binary export.
It also happens with the iwalktest.
Any way to fix this?
pc0de
Posts: 300
Joined: Wed Dec 05, 2007 4:41 pm

Post by pc0de »

Hey floppyfreak, I just ran a couple of tests with a texture file stored in a directory that contained spaces in the name and I wasn't able to duplicate the problem.

Please send me your irrb.log file and the generated .irrbmesh file that you're having a problem with. Thanks.
pc0de
Posts: 300
Joined: Wed Dec 05, 2007 4:41 pm

Post by pc0de »

Thanks for the files. It looks like the call to imeshcvt (converts .irrmesh to .irrbmesh) is failing. The reason you can't see the cube in iwalktest is because the scene file contains a reference to cube.irrbmesh which doesn't exist because of the conversion error. I need to add a warning to the irrb interface when this happens.

Please verify that you have the "IMESHCVT" environment variable defined and that it is set to the full path of where you have imeshcvt.exe installed. For example, if you saved imeshcvt.exe to "c:\irrb\tools\imeshcvt.exe" then you would set:

IMESHCVT=c:\irrb\tools\imeshcvt.exe

If you have it set up correctly, then try running it from a dos prompt without any parameters to see if it displays "usage" info.
floppyfreak
Posts: 117
Joined: Sat Apr 19, 2008 10:14 am

Post by floppyfreak »

I had set the variables in a batch file I start blender with:

Code: Select all

set IMESHCVT=C:\programming\irrbUtils-0.4-win32\imeshcvt
set IWALKTEST=C:\programming\irrbUtils-0.4-win32\iwalktest -i "$1" -a "$2
C:\Programme\"Blender Foundation"\Blender\blender.exe
What would be the correct method to set these variables?
(and: stil not clear, why export works with "c:\somedir" and not with "c:\some dir")
floppyfreak
Posts: 117
Joined: Sat Apr 19, 2008 10:14 am

Post by floppyfreak »

I just noticed I have the following output in std out:

Code: Select all


C:\Dokumente und Einstellungen\Georg Koppitz>set IMESHCVT=C:\programming\irrbUti
ls-0.4-win32\imeshcvt

C:\Dokumente und Einstellungen\Georg Koppitz>set IWALKTEST=C:\programming\irrbUt
ils-0.4-win32\iwalktest -i "$1" -a "$2

C:\Dokumente und Einstellungen\Georg Koppitz>C:\Programme\"Blender Foundation"\B
lender\blender.exe
Compiled with Python version 2.6.2.
Checking for installed Python... got it!
C:\programming\irrbUtils-0.4-win32\imeshcvt -v 1.7 -i C:\somedir\mdl\Cube.irrmes
h  -o C:\somedir\mdl\Cube.irrbmesh -a C:/somedir/
imeshcvt 0.4 Copyright(C) 2008-2009 Tubras Software, Ltd

 Input Mesh: C:\somedir\mdl\Cube.irrmesh
Output Mesh: C:\somedir\mdl\Cube.irrbmesh
C:\programming\irrbUtils-0.4-win32\imeshcvt -v 1.7 -i C:\some dir\mdl\Cube.irrme
sh  -o C:\some dir\mdl\Cube.irrbmesh -a C:/some dir/
imeshcvt 0.4 Copyright(C) 2008-2009 Tubras Software, Ltd

 Input Mesh: C:\some
Output Mesh: dir\mdl\Cube.irrmesh

Error: Input Mesh Doesn't Exist
pc0de
Posts: 300
Joined: Wed Dec 05, 2007 4:41 pm

Post by pc0de »

No wonder it works for me and not for you :roll: ... In your IExporter.py update line 652 & 653 to be:

Code: Select all

cmdline =  meshcvt + ' -v ' + self.gIrrlichtVersion + ' -i "' + iname + '"  -o "' + oname
cmdline += '" -a "' + iUtils.filterPath(self.gBaseDir) + '"'
Sorry for the trouble.
floppyfreak
Posts: 117
Joined: Sat Apr 19, 2008 10:14 am

Post by floppyfreak »

thanks a lot, it works as it should now
draemb
Posts: 5
Joined: Thu Jul 22, 2010 9:44 am

Post by draemb »

Hi,
i've been reading the 16pages very quickly so maybe i didn't see that my problem has already been fixed

So, here's the thing :

I'm actually working with Irrlicht 1.7, blender 2.49b and irrblend 0.4

I had some problem concerning normalmap.

So as usual I create my mesh low poly, i create a second mesh high resolution, I bake the normalmap and then I want to set the normalmap to my low-poly mesh


The tutorial is very clear so I guess i'm doing something wrong from the beginning

the tutorial says : first texture : colormap, second texture : "should be the normalmap"

so what I was doing was : creating a first uv_layer named "solid" where i put my colormap;

then create a second uv_layed named "normalmap_solid" where i put the normalmap.


after exporting with irrblend, I only had the colormap in the Iwalktest window

then after few try I found that if I named the first uv_layer "normalmap_solid" and I put the colormap on it
and then the second layer "solid" and i put the normalmap on it

I don't know why but it worked BUT the normal map is then put face-to-face without any UV calculation


so my questions are : "Am I doing something wrong about the uv_layer name ?

Is the normalmap material only made for face-to-face or is it possible to take in count the UV calculation?
pc0de
Posts: 300
Joined: Wed Dec 05, 2007 4:41 pm

Post by pc0de »

Hello draemb,

It looks like you are already aware that irrb 0.4 generates Irrlicht materials based on the UV layer name you assign in Blender.

The trick is that irrb picks the Irrlicht material type by scanning the UV layer names from top to bottom. When it finds a match, it uses that material type and stops searching. So if you name the layers "solid" and "normal_map_solid" in that order, irrb will generate a material type of EMT_SOLID because that matches first.

Because you want to create a material with a normal map, just rename the 1st UV layer to something that doesn't match one of existing Irrlicht material types ("color", "diffuse", etc). Depending on your requirements, the 2nd UV layer name then needs to be named "normal_map_solid", "normal_map_transparent_add_color", or "normal_map_transparent_vertex_alpha" (Irrlicht E_MATERIAL_TYPE enum without the "EMT_" prefix).

Regarding your 2nd question, If I remember correctly when you create a new UV layer, the UV coordinates from the active UV layer are copied into the new UV layer by default. With the new layer active, you can unwrap/reassign UV coordinates that are specific to that layer. irrb will then correctly export the 2 independent UV coordinates using the EVT_2TCOORDS vertex format.
draemb
Posts: 5
Joined: Thu Jul 22, 2010 9:44 am

Post by draemb »

thank you for this quick answer!

now it's completely clear with all this layer_name stuff

However it seems that whatever I do, (unwrapping again and again the mesh with the second layer active), the second layer keeps the uv_calculation of the first layer.

The weird thing is that the normalmap is well "spread" on blender (good textures and good uv_coordinates on the good uv_layer) BUT when I export it and run Iwalktest, the second layer (the normalmap) takes back the uv coordinates of the first layer.

Maybe it's because the second layer name is not recognized ? Or because you can only have one uv_calculation per material? A bug ?

Well I think I still doing something wrong
pc0de
Posts: 300
Joined: Wed Dec 05, 2007 4:41 pm

Post by pc0de »

Any chance you can post the .blend file so I can have a look? If you do, please pack the textures in the .blend file as well. Thanks.
NoName4ever
Posts: 10
Joined: Fri Dec 01, 2006 5:38 am

Post by NoName4ever »

Great project!

I love your coding style. Do you ever think of moving to Collada format as it should be more popular than .irr .

Anyway, I will use your code in my pet project. Keep up good work!
random
Posts: 158
Joined: Wed Aug 11, 2010 6:01 am

Post by random »

i have 3 questions i am actually doing a game in BGE but i am missing fonts(8px clear readable font) and gui options aswell there thatfor i am about to switch to irrlicht.

my mainscene belongs to a sky(spehere)box which a camera parented to an empty in the center, will this structure stay when exporting the scene?

My models (mainly spaceships) have partial a smoothing effect for the mesh will this also stay?

Is there a list what will ne exported and what not?
Post Reply