irrb 0.4 (Blender Exporter)
Thank you for providing such a quality exporter for the Irrlicht community. This has the potential to greatly assist media in many future Irrlicht developments.
Programming Blog: http://www.uberwolf.com
-
- Posts: 117
- Joined: Sat Apr 19, 2008 10:14 am
I use this great tool to make a little project that lets you fly through a scene in a flight simulator like the old descent games, that means you can fly in all directions and turn round all axes.
The only problem I have is the filepaths. I can't find a way to just copy the output of the exporter into another directory. What I always have to do is to rename filenames in the irr and the irrmesh files. Do I have a misunderstanding?
The only problem I have is the filepaths. I can't find a way to just copy the output of the exporter into another directory. What I always have to do is to rename filenames in the irr and the irrmesh files. Do I have a misunderstanding?
I don't think so... I've received similar complaints which likely means the documentation on this topic should prolly be re-worked.
Let's see if I can clear it up a bit:
As you are already aware, each irrb scene (.irr) file contains a reference to a mesh (.irrmesh) file for each mesh node. This tag looks something like this:
The "trick" is to have irrb automatically create the correct value for your needs.
You can control how irrb creates the value using the "Mesh Path" input variable located in the exporters interface.
There are currently three options available for setting Mesh Path:
If you enter "$filename" into Mesh Path, only the mesh file name will be written to the tag value:In order for the scene loader to find meshes that have used this option, each mesh must either exist in the directory the application runs from or it must be located in a folder that has been defined using IFileSystem.addFolderFileArchive(...) by your application. If you're using iwalktest, you can add Folder archives to "iwalktest.cfg" (see <filesystems>).
Full Path.
If you enter "$fullpath" into Mesh Path (or leave it blank), the full path will be written to the tag value:This is convenient when you're using iwalktest for viewing scenes.
Relative Path.
If Mesh Path is NOT set to $filename, $fullpath, or blank, then irrb uses what you enter into Mesh Path as a prefix for the tag value. For example, if "data/meshes/" is entered into Mesh Path, the following tag value would be generated:The scene loader will then expect "data/meshes/cow.irrmesh" to exist off of your application directory or a directory that has been defined by your application via IFileSystem.addFolderFileArchive(...).
Note that this same logic is also used for generating texture path values located in .irrmesh files.
It may also be helpful to show how I've been using the exporter:
I have a "base" folder setup that contains all of my scenes: "c:\irrbScenes\".
When I start a new scene, i create a folder underneath the base:
"c:\irrbScenes\irrbCinema\".
And then another directory underneath that to store meshes in:
"c:\irrbScenes\irrbCinema\meshes\"
In the exporter's interface I set "Mesh Directory" to:
"c:\irrbScenes\irrbCinema\meshes\"
This tells irrb where to store all of the generated .irrbmesh files.
When I'm initially viewing/testing my Blender work in iwalktest, I leave Mesh Path set to blank. That way the full mesh path is written to the tag value and the scene loader always finds the mesh files.
If I ever get to the point where I need to distribute the scene and mesh files with an actual application... , I would set Mesh Directory to a relative path that makes sense to my application and then set it up so the install copies the scene and mesh files to the appropriate locations relative to the application.
Let me know if you still have questions. I'd also be interested in suggestions that would help make this topic less confusing.
Let's see if I can clear it up a bit:
As you are already aware, each irrb scene (.irr) file contains a reference to a mesh (.irrmesh) file for each mesh node. This tag looks something like this:
Code: Select all
<string name="Mesh" value="c:\test\meshes\cow.irrmesh" />
You can control how irrb creates the value using the "Mesh Path" input variable located in the exporters interface.
There are currently three options available for setting Mesh Path:
- File Name Only - $filename
Full Path - $fullpath or blank
Relative Path - (user entered value)
If you enter "$filename" into Mesh Path, only the mesh file name will be written to the tag value:
Code: Select all
<string name="Mesh" value="cow.irrmesh" />
Full Path.
If you enter "$fullpath" into Mesh Path (or leave it blank), the full path will be written to the tag value:
Code: Select all
<string name="Mesh" value="c:\test\meshes\cow.irrmesh" />
Relative Path.
If Mesh Path is NOT set to $filename, $fullpath, or blank, then irrb uses what you enter into Mesh Path as a prefix for the tag value. For example, if "data/meshes/" is entered into Mesh Path, the following tag value would be generated:
Code: Select all
<string name="Mesh" value="data/meshes/cow.irrmesh" />
Note that this same logic is also used for generating texture path values located in .irrmesh files.
It may also be helpful to show how I've been using the exporter:
I have a "base" folder setup that contains all of my scenes: "c:\irrbScenes\".
When I start a new scene, i create a folder underneath the base:
"c:\irrbScenes\irrbCinema\".
And then another directory underneath that to store meshes in:
"c:\irrbScenes\irrbCinema\meshes\"
In the exporter's interface I set "Mesh Directory" to:
"c:\irrbScenes\irrbCinema\meshes\"
This tells irrb where to store all of the generated .irrbmesh files.
When I'm initially viewing/testing my Blender work in iwalktest, I leave Mesh Path set to blank. That way the full mesh path is written to the tag value and the scene loader always finds the mesh files.
If I ever get to the point where I need to distribute the scene and mesh files with an actual application... , I would set Mesh Directory to a relative path that makes sense to my application and then set it up so the install copies the scene and mesh files to the appropriate locations relative to the application.
Let me know if you still have questions. I'd also be interested in suggestions that would help make this topic less confusing.
-
- Posts: 117
- Joined: Sat Apr 19, 2008 10:14 am
works good now. The keyhint is to give the example with the "$filename" to be put into the mesh path and texture path fields. Perhaps it'd help those like me, who do not read manuals carefully enough, to give a checkbox like "Don't include pathname into .irr file" and "don't include pathname into irrmesh file".
Another thing not concerning your work is, that I just found out, my prog stil doesn't work with it, because the level loader of irrlicht (when I say eg irrSceneMgr->loadScene(puf); ) doesn't search the .irrmesh files in the directory the .irr is located. Most likely I will have to write flexible settings of the working path of irrlicht. Well, a few more lines...
My project is in on
http://www.odf-forum.de/forum/viewtopic ... 41bd7d4b72
Its an early alpha, when it is more, I'l let you know.
Another thing not concerning your work is, that I just found out, my prog stil doesn't work with it, because the level loader of irrlicht (when I say eg irrSceneMgr->loadScene(puf); ) doesn't search the .irrmesh files in the directory the .irr is located. Most likely I will have to write flexible settings of the working path of irrlicht. Well, a few more lines...
My project is in on
http://www.odf-forum.de/forum/viewtopic ... 41bd7d4b72
Its an early alpha, when it is more, I'l let you know.
Yes, checkboxes crossed my mind when i was writing up the previous post.
It doesn't seem unreasonable to me to patch the scene loader to look for .irrmesh files in the same directory as the .irr file, or even relative to it.
Maybe one of the devs could weigh in and say why this may or may not be a good idea.
It doesn't seem unreasonable to me to patch the scene loader to look for .irrmesh files in the same directory as the .irr file, or even relative to it.
Maybe one of the devs could weigh in and say why this may or may not be a good idea.
-
- Posts: 117
- Joined: Sat Apr 19, 2008 10:14 am
In my experience irrb always uses just one set of uv data in the output even if I have defined more in blender. If I understand the concept of irr::video::E_VERTEX_TYPE EVT_2TCOORDS correctly, there is the option in irrlicht to use a second set. How can I do that with irrb? If not, will it be in future versions? any alternative?
Awesome work Thanks
I have two suggestions though!
1) an option to combine all meshes into one mesh on exporting
2) export directory(ies) set to the current (.blend's) directory by default
(at the moment I still use the .b3d exporter because it has these features...)
Edit: actually it seems 2) can be done just by putting a . in the path
I have two suggestions though!
1) an option to combine all meshes into one mesh on exporting
2) export directory(ies) set to the current (.blend's) directory by default
(at the moment I still use the .b3d exporter because it has these features...)
Edit: actually it seems 2) can be done just by putting a . in the path
irrb should be generating the second set of UV coords. Please have a look at this tutorial: Light Mapping - it explains how to use two sets of UV coordinates. Let me know if you still have questions or problems.floppyfreak wrote:How can I do that with irrb?
I'll have look at adding this capability.xDan wrote:1) an option to combine all meshes into one mesh on exporting
-
- Posts: 117
- Joined: Sat Apr 19, 2008 10:14 am
Works as it shouldpc0de wrote:irrb should be generating the second set of UV coords. Please have a look at this tutorial: Light Mapping - it explains how to use two sets of UV coordinates. Let me know if you still have questions or problems.floppyfreak wrote:How can I do that with irrb?
and I really, really love the results
Thanks for the encouragement fellas - it's nice to see someone else using it.
Yes, please let me know if you find any problems as I'm preparing for a bug fix release (0.3) within the next 2-3 weeks.
After that I will be focusing on adding animation info to .irrmesh, which leads me to several questions... But, I think I'll start another thread for that when the time comes.
Yes, please let me know if you find any problems as I'm preparing for a bug fix release (0.3) within the next 2-3 weeks.
After that I will be focusing on adding animation info to .irrmesh, which leads me to several questions... But, I think I'll start another thread for that when the time comes.