irrb 0.4 (Blender Exporter)

Announce new projects or updates of Irrlicht Engine related tools, games, and applications.
Also check the Wiki
pc0de
Posts: 300
Joined: Wed Dec 05, 2007 4:41 pm

Post by pc0de »

@NoName4ever
Thanks. Collada - yes, after the 1st release of irrb I questioned if I should just focus on improving Collada support within Irrlicht itself... Turns out I'm mostly interested in the Blender -> Irrlicht pipeline and there are shortcuts to be had using .irr & .irrmesh/.irrbmesh.

@random
empty in the center, will this structure stay when exporting the scene?
Parenting should work. Blender Empties are exported as Irrlicht empty scene nodes (ISceneNode implemented by CEmptySceneNode).
have partial a smoothing effect for the mesh will this also stay
Other than converting to Irrlicht's coordinate system, irrb exports the normals as Blender generates them so you should be okay here.
s there a list what will ne exported and what not?
Most of it is covered in the irrb manual and in the short list at the top of the irrb wiki.
RobbyRob
Posts: 21
Joined: Fri Mar 02, 2007 4:30 pm
Location: Germany

Post by RobbyRob »

Hi pcode,

again one question concerning the irrbmesh files; I completely switched to linux, adjusted my game frame in Irrlicht and no it's time for irrb;
so far everything works fine with blender and irrb under linux, but I have problems installing imeshcvt;
I tried to set the environment variable to my directory home/etc/environment
IMESHCVT=/home/robert/.blender/scripts/blender/imeshcvt

and set the script path in Blender to the directory, where I have stored irrb utilities;
but i didn't get the button for binary meshes, I guess my environment setting is not correct,


thanks for any help

Robert
pc0de
Posts: 300
Joined: Wed Dec 05, 2007 4:41 pm

Post by pc0de »

Hello RobbyRob. First, try entering "echo $IMESHCVT" in a terminal. If the output isn't "/home/robert/.blender/scripts/blender/imeshcvt" then environment variable isn't being persisted.

If the output is such that the environment variable is properly set, try running imeshcvt in a terminal by entering its full path "/home/robert/.blender/scripts/blender/imeshcvt" and report back those results (should be imeshcvt version and usage).

Also, which distribution/version of Linux are you using?
RobbyRob
Posts: 21
Joined: Fri Mar 02, 2007 4:30 pm
Location: Germany

Post by RobbyRob »

Hello pcode,

after writing $IMESHCVT in a terminal I got the right path, so environment variable is set correctly;

running imeshcvt brings following report:
imeshcvt 0.4 Copyright(C) 2008-2009 Tubras Software, Ltd

usage: imeshcvt <options> -i[input file] -o<output file>

<options> - Generic options:
-a : folder archive
-v : target mesh version
<options> - Mesh Manipulator options:
-f : flip surfaces
-n : recalculate normals
-s : recalculate normals smooth
-t : create tangents

[input file] - Input mesh file to convert or report on.
if no output mesh is specified, info is
displayed for the input mesh. Required.

<output file> - Output mesh file to convert to.

and I use Ubuntu 9.1 Linux kernel 2.6.31,

hope this helps , it's not so urgent, because I am now on vacation for two weeks (without computer, ugh),

Thank you

Robert
pc0de
Posts: 300
Joined: Wed Dec 05, 2007 4:41 pm

Post by pc0de »

I hope you had a good vacation - email/pm me one of your irrb.log files. This file is located in the scene output directory and is generated when you run the irrb exporter.
draemb
Posts: 5
Joined: Thu Jul 22, 2010 9:44 am

Post by draemb »

Hi, sorry for the no-answer

the problem was just that you can't have 2 different UV-Coordinates on 2 different UV layers, otherwise irrb (or irrlicht) doesn't use the second coordinates or uses them in the wrong way and you got something awful

I'm now using your billboard and transparent material stuff

I had some questions :

is it possible to make a billboard turn only for the horizontal axes and not for the vertical axe ?

for exemple I modeled a chain texture that I put on a plane. Now i'm turning around this plane. When I turn horizontally, the render is good, it seems to be real chain.

But if I turn vertically, because the plane is a good billboard, it turns the same way, and that's something i'd like to avoid


2nd question :

I'm modeling a tree. I'm using planes for the leaf.

I tried all the standard transparent material types but none of them satisfies me :

first, I got a error when exporting with trans_alphach_ref : Index error, tuple index out of range

I don't understand what does it mean but I red the manuel ("If the alpha channel value is greater than 127, a pixel is written to the target, otherwise not"

i didn't understand either but maybe is it the solution?

the material that is almost what I want is trans_alphach but when you have got 2 meshs with this material you can see the second one through the (normally) non-transparent part of the first one.

For example for my tree I don't see the leaf of the foreground cause I got leaf in the back ground and I see them through the leaf of the foreground


maybe there is a better material for those things?

trans_add makes the leaf transparent, i'd like solid leaf but be able to see through the hole between the leaf

screen of this problem :
Image
pc0de
Posts: 300
Joined: Wed Dec 05, 2007 4:41 pm

Post by pc0de »

draemb wrote:problem was just that you can't have 2 different UV-Coordinates on 2 different UV layers
Hmm, both Blender & Irrlicht support multiple UV layers (Irrlicht supports 2 per material). The separate UV layers are required for Irrlicht's Lightmap, NormalMap, and several other materials. Have a look at the lightmapping tutorial to see how to setup 2 different layers of UV's.
draemb wrote:is it possible to make a billboard turn only for the horizontal axes and not for the vertical axe ?
Irrlicht's billboard scene node "always looks to the camera". If you want to constrain it to a specific axis, you would need to create a custom scene node.
draemb wrote:2nd question
Trees can be tricky :), especially when using different images on your billboards. It's important to remember that which billboard scene node (image) renders first depends on the position of the camera. In this example:Image
there are 2 billboard images, they are similar but vary enough that it doesn't matter which one renders first. Notes:
  • These leaf textures are "professionally done" - they are included with the SpeedTree demo included in the UDK download.

    I use "trans_alphach" as material type because it think it gives the best results for these textures.
Here's the difference between trans_alphach_ref (left) & trans_alphach (right):
Image
trans_alphach looks a little nicer but costs a little more when rendering.
draemb
Posts: 5
Joined: Thu Jul 22, 2010 9:44 am

Post by draemb »

pc0de wrote: Irrlicht's billboard scene node "always looks to the camera"
In irrEdit you can easyly create "vertical billboard" that follow the camera for the horizontal axes only

i thought it was implemented in irrlicht but then it seems to be a new scene node written by Ambiera?

I wasn't using any billboards for my tree but I guess this is the optimal way

but the fact renders first the mesh through the second one is actually a problem for other stuff (like prison's bar ?). If you can see the bar behind through the one in the foreground because you used trans_alphach 2 times, it's not very nice nor real


(for the layers, of course you can have 2(or more) layers per material, otherwise i wouldn't be able to put any normalmap on my scene; but on complex model, if I have 2 different uv calculation; for example I reset all the face on the first layer, and I unwrap them in the second one, I got some errors in Iwalktest )
pc0de
Posts: 300
Joined: Wed Dec 05, 2007 4:41 pm

Post by pc0de »

draemb wrote:i thought it was implemented in irrlicht but then it seems to be a new scene node written by Ambiera?
I don't know what irrEdit is doing but it currently isn't implemented in Irrlicht. There is a patch out there that needs some work though: Patch 1809815.
draemb wrote:I wasn't using any billboards for my tree but I guess this is the optimal way
Depends on your needs. Your method should work the way you are expecting to. Have you tried playing with ZBuffer/ZWriteEnable in the generated billboard material?
Any chance you can post a link to your .blend file with the textures packed in the .blend file?
draemb wrote:I have 2 different uv calculation
You can export 2 different/independent sets of UV coordinates per material, irrb chooses how many UV coordinates to export based on the type of material that is exported. What type of material are you trying to create? Can you post a link to the .blend for this problem as well? Thanks.
xDan
Competition winner
Posts: 673
Joined: Thu Mar 30, 2006 1:23 pm
Location: UK
Contact:

Post by xDan »

Hello,

Blender, for some obtuse reason, doesn't seem to support alpha painting, but I notice some other exporters support this by allowing a second vertex colour layer which you can paint in black and white and this is exported as alpha.

Have you considered adding this functionality? ;)

p.s. irrb is the greatest Irrlicht addon!

p.p.s., another simple question, I'm getting very long filenames in my exported irrmesh with 0.3, is this fixed in a later version?
Example:

Code: Select all

<texture name="Texture1" value="../../../../../../../../../../c:Documents and Settings/Daniel/My Documents/Dev/Engine/projects/Puzzle/media/finalscene/stone3_color.jpg"/>
pc0de
Posts: 300
Joined: Wed Dec 05, 2007 4:41 pm

Post by pc0de »

Hey xDan, I'm away from my development machine for the next couple of days, so I'll look into Blender's vertex/alpha functionality when I get back.

Regarding the long filenames - by default irrb writes out file references using relative paths. You can shorten the path by copying the texture into a directory underneath the directory your mesh is being exported to. irrb also has an option to automatically copy textures from their original location.
xDan
Competition winner
Posts: 673
Joined: Thu Mar 30, 2006 1:23 pm
Location: UK
Contact:

Post by xDan »

Hey xDan, I'm away from my development machine for the next couple of days, so I'll look into Blender's vertex/alpha functionality when I get back.
Cool :)
Regarding the long filenames - by default irrb writes out file references using relative paths. You can shorten the path by copying the texture into a directory underneath the directory your mesh is being exported to. irrb also has an option to automatically copy textures from their original location.
Hmm, I think this is a different problem. It only occurs when I put "." as the Output Directory, to export to the current directory.

If we check for "." in the relpath function it seems to fix the problem:

Code: Select all

def relpath(path, start):

    if not path:
        raise ValueError("no path specified")

    # check for "." directory and change it to the full cwd path
    if start == '.' or start == './' or start == '.\\':
        start = os.getcwd()
    
    ...etc...
that's of course a hack and only fixes it for the "." directory, I don't know what would happen if you tried to export to "../somepath" kind of stuff.. I don't understand python enough to do any better than this.. Perhaps you can detect if "start" is a relative path, if so append it to the cwd and then pass through abspath. :?:
pc0de
Posts: 300
Joined: Wed Dec 05, 2007 4:41 pm

Post by pc0de »

xDan wrote:...vertex color alpha...
As you suspected Blender doesn't support painting alpha into the vertex colors. 2.49b vertex colors are stored as RGBA, but the alpha component is always set to 255 regardless of the opacity used to paint.
2.54 vertex colors are simply stored as RGB. I'll modify irrb 0.6 (Blender 2.54) to look for a vertex color layer named "alpha" and use that as the alpha value when exporting vertex colors.

Regarding relative paths - I think you should update to irrb 0.4. For portability I ended up modifying irrb to _always_ use relative paths when writing references to scene & mesh resources.

In version 0.4 of irrb I also removed the ability to set the mesh & texture locations through the interface. By default they are stored in "mdl/" & "tex/" sub-directories underneath the base (scene) directory. These default directories can be changed in "UserConfig.py" (0.4) or in "~/.irrb" for irrb version 0.6 and later. And finally, I modified irrb to _always_ copy images (external & packed) to the output texture directory. This will eliminate the long texture paths referencing the original location of your image files similar to the example you gave earlier.

*edit* :) vertex alpha support added to 0.6:
Image
xDan
Competition winner
Posts: 673
Joined: Thu Mar 30, 2006 1:23 pm
Location: UK
Contact:

Post by xDan »

That's awesome :)

Regarding paths, I just tried the latest Blender 2.49 version I can find, 0.5. And even with copying the textures, it has the same problem.

Here's the log: http://pastebin.com/0pTepiSY

Actually the problem isn't really with absolute paths - it does seem to be using a relative path, but in a screwed up manner.

e.g.

<texture name="Texture1" value="../../../../../c:Documents and Settings/Daniel/Desktop/New Folder/tex/stone3_color.jpg"/>

It's going up the directory tree 5 times to the root, then going back down... So it is indeed a relative path, just not a nice one. It only occurs when I put "." as the Output Directory (in the GUI). I'm afraid I'm still on Blender 2.49 so I can't test the latest exporter yet.
pc0de
Posts: 300
Joined: Wed Dec 05, 2007 4:41 pm

Post by pc0de »

Ahhh, I think I see what you're trying to do - export to a location relative to the .blend file.

The trouble is/was is that the absolute path is calculated from the working directory which is the location of the blender executable by default. This is what was causing the long relative resource paths to be generated.

I updated 0.5 to generate absolute paths relative to the .blend file if the "output directory" is set to a relative path. The files you need to update are iGUI.py & iExporter.py.

Note that if the .blend file hasn't been saved the .blend file path will be empty and irrb will then default to using the working directory. As a part of this update I also added the calculated "Output Directory" to the GUI stats that are displayed when the export finishes.

Let me know if this update fixes your problem. Thanks.
Post Reply