best format for models + blender [need an advice]

Post your questions, suggestions and experiences regarding to Image manipulation, 3d modeling and level editing for the Irrlicht engine here.
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

Although .x should also somehow work (but it's known for the problematic export from every tool) you should be able to use b3d (just read some previous posts in here to find the exporter).
Luke
Admin
Posts: 449
Joined: Fri Jul 14, 2006 7:55 am
Location: Australia
Contact:

Post by Luke »

roxaz:

I'll have a look, I mainly trying to get it to work with animation meshes, as static meshes are pretty easy.

inverting the normals back should be pretty easy if that's the only problem, but check that the bones are not still mirrored, that's were I had some problems.

I'm sorry the code is so bad, it was the first time I've used python, it needs a rewrite when it is working.
Luke
Admin
Posts: 449
Joined: Fri Jul 14, 2006 7:55 am
Location: Australia
Contact:

Post by Luke »

JPulham:

yeah b3d works fine with lightmaps, it always has. But the blender exporter doesn't yet export lightmaps (there were no lighmaps in blender when I was making it).
roxaz
Posts: 575
Joined: Tue Jan 23, 2007 8:35 pm
Location: LT

Post by roxaz »

dwmitch wrote:You might be better off learning a bit about python scripting, making your own format, and implementing a loader for said format.

I haven't found a single Blender export script that will do animations and work in Irrlicht. I've tried all of the X exporters, then when I take a look at the file in wordpad (have to open it anyway to remove a semicolon that shouldn't be there, otherwise it won't load in Irrlicht) it doesn't export the animation. And that's with the one X file exporter that doesn't crash.

OBJ is good for static meshes, but I have not found a single decent script for animated meshes of any format that Irrlicht supports, and I've spent at least a total of ten hours searching over the past few months.
Yes, that would be great, but experience is needed and i dont feel myself to be able to finish such a big job. In the other hand inventing bicycle isnt a sollution either.
Luke wrote:roxaz:

I'll have a look, I mainly trying to get it to work with animation meshes, as static meshes are pretty easy.

inverting the normals back should be pretty easy if that's the only problem, but check that the bones are not still mirrored, that's were I had some problems.

I'm sorry the code is so bad, it was the first time I've used python, it needs a rewrite when it is working.
i tried to invert normals by multiplying them by -1 (i saw that in directx exporter) but i had no luck. if bones are inverted then maybe you can multiply bones matrix by my mirrorMatrix?

P.S. Code is not as bad as you think ;)
BlindSide
Admin
Posts: 2821
Joined: Thu Dec 08, 2005 9:09 am
Location: NZ!

Post by BlindSide »

Wow thanks for your work roxaz Im glad I suggested to look at the B3D script! For inverted normals please take a look at the direct x exporter as it supports an option to flip normals. There is probably a script or a function in blender somewhere that flips normals too. If all else fails then just leave the mesh mirrored and set an inverted scale in Irrlicht 8)
vermeer
Posts: 2017
Joined: Wed Jan 21, 2004 3:22 pm
Contact:

Post by vermeer »

I haven't found a single Blender export script that will do animations and work in Irrlicht.
Actually, lots of people have used with success x format here. And there are several others which work. As I allways say, tho, I'd bet for b3d and md5.

Indeed, I have used also succesfully x and md5 animations done in blender, for other engines.

It'll be really nice once b3d and md5 are running well on irrlicht...
Finally making games again!
http://www.konekogames.com
roxaz
Posts: 575
Joined: Tue Jan 23, 2007 8:35 pm
Location: LT

Post by roxaz »

BlindSide wrote:Wow thanks for your work roxaz Im glad I suggested to look at the B3D script! For inverted normals please take a look at the direct x exporter as it supports an option to flip normals. There is probably a script or a function in blender somewhere that flips normals too. If all else fails then just leave the mesh mirrored and set an inverted scale in Irrlicht 8)
thats exactly what i did. dx exporter inverts normals by multiplying them by -1, this doesnt work with b3d. I already wrote it in earlyier, read the thread :P
dwmitch
Posts: 52
Joined: Thu Nov 09, 2006 9:29 pm

Post by dwmitch »

roxaz wrote: Yes, that would be great, but experience is needed and i dont feel myself to be able to finish such a big job. In the other hand inventing bicycle isnt a sollution either.
It's not really that big of a job. I have little to no practical knowledge of Python and I constantly have to use the print(str(dir(<module>))) to figure out how to work it in Blender and I'm making fair progress.

It's also not hard to implement loaders in Irrlicht once you've looked over the existing loaders and have a basic understanding of mesh buffers. Of course, try changing it to where you have direct control over the D3D renderstates and you'll be opening a whole can of worms.
Those who call the faithful 'sheep' do not realize that they themselves are sheep. We follow one shepherd, they follow another.
dwmitch
Posts: 52
Joined: Thu Nov 09, 2006 9:29 pm

Post by dwmitch »

vermeer wrote:
I haven't found a single Blender export script that will do animations and work in Irrlicht.
Actually, lots of people have used with success x format here. And there are several others which work. As I allways say, tho, I'd bet for b3d and md5.

Indeed, I have used also succesfully x and md5 animations done in blender, for other engines.

It'll be really nice once b3d and md5 are running well on irrlicht...
What's the most popular exporter around here for X files? I used one I got from the FAQ/tool list but I have to manually remove a semicolon to get it to work and even after baking the action it still only exports the root frame.
Those who call the faithful 'sheep' do not realize that they themselves are sheep. We follow one shepherd, they follow another.
roxaz
Posts: 575
Joined: Tue Jan 23, 2007 8:35 pm
Location: LT

Post by roxaz »

dwmitch wrote:
roxaz wrote: Yes, that would be great, but experience is needed and i dont feel myself to be able to finish such a big job. In the other hand inventing bicycle isnt a sollution either.
It's not really that big of a job. I have little to no practical knowledge of Python and I constantly have to use the print(str(dir(<module>))) to figure out how to work it in Blender and I'm making fair progress.

It's also not hard to implement loaders in Irrlicht once you've looked over the existing loaders and have a basic understanding of mesh buffers. Of course, try changing it to where you have direct control over the D3D renderstates and you'll be opening a whole can of worms.
maybe you are right, maybe you are not. i gues all fun would start with animations, bones and other stuff
dwmitch
Posts: 52
Joined: Thu Nov 09, 2006 9:29 pm

Post by dwmitch »

Never thought of the bones. Of course, I plan on using vertex keys, so it probably never would have come up.

I've been messing around with the DX exporter from the FAQ forum, and I finally got it to export the animation. The problem is Irrlicht won't recognize the joints.

The test file was a very cheaply made robotic claw. It was supposed to extend, grab, then retract. Opening the file everything was in place, but when I loaded it into Irrlicht I got errors saying something to the effect that all but the root bones were invalid. Is there a specific naming convention you have to keep to when setting the armatures up in Blender?
Those who call the faithful 'sheep' do not realize that they themselves are sheep. We follow one shepherd, they follow another.
oldskoolPunk
Posts: 199
Joined: Wed Nov 29, 2006 4:07 am

Post by oldskoolPunk »

The .x exporter bundled with Blender has worked fine for me since version 2.42 Here are a few tips to help you along.

1. To "attatch" the bones to the mesh, they must be the parent of the mesh.
2. All bones must have a parent bone, except of course for the "master" bone.
3. You MUST apply scale and rotation (Ctrl-A) to both the mesh AND the armature object before export.
4. .x does NOT support vertex animations (.md2 works well for that)
5. All animations MUST be baked before export, or your animations will not look like you expect.
6. All character actions must be recorded in the same Blender action (I can't seem to get multiple Blender actions to export to the same x file)
7. Remember to rewind to frame 1 before export.
8. I have to uncheck "Flip z" , and export as if exporting to a right-handed system. If not, my mesh appears inside out. (regardless of normals vector)
9. I do not recommend using "swap zy" button or even rotating in Blender at all. This can cause your recorded animations to go all weird (bones think they are moving forward when they are actually moving upward!) I just rotate in my code.

I tried to remember everything. I hope this helps a little. I am very excited about the continued work on the .b3d exporter. I am told this is the only way to control bones in Irrlicht (for ragdolls, head tracking, and such...)
Signature? I ain't signin nuthin!
vermeer
Posts: 2017
Joined: Wed Jan 21, 2004 3:22 pm
Contact:

Post by vermeer »

What's the most popular exporter around here for X files?
Right now, Ben's. Before, become very famous and used Jox modification of it: it adapted well to irrlicht specific matters.

Actually, many of them you cn avoid just at artist user level: bones, armatures and materials, must notbe blender's standard way: no "." No Bone.001. But Bone001. for example.

That list is very good. But there's yet more stuff: like check normals, ensure no double vertex exist previous to asign weights, etc. It saves a lot of probs if people follow that list. I made a huge thread long time ago, but am unable to find now in the forums.

X format has a problem in 4 ways (at least):

- It must be very of a kind to load well in irrlicht (mview.exe from DX SDK 8.x is actually neeeded, and that's a win app, not easy to find either)

-Blender exporter and Max exporter are usable, but you need to know *way* more stuff than with less complex formats. In blender, there's many things to care of, and is not problem for a Bledner expert, but usual irrlicht game developer is not.

- Blender has included since allways the direct x v7 , and some ppl think they can expect bones and weihts animations from it.

-With x exporter, you need to bake animations, which surpass, by all means, blender animation knowledge of newbies.

With b3d, many of these issues are gone, no extra editing needed, etc. As far as I remember, no bake needed, as he does an actual internal bake of what happens inside blender, which in results, is the same than you manually baking.

With md5, Der_ton used pose mode or something code wise, to allow support constraints, you simply either will have to care, all is taken. Only issue here is go to text editior, and edit there to put the path to your texture, that's all. (surely dumb easy to add or fiz a line in the exporter, or add your own utility to add it later on. )
Finally making games again!
http://www.konekogames.com
dwmitch
Posts: 52
Joined: Thu Nov 09, 2006 9:29 pm

Post by dwmitch »

Actually, I'm going to have to second vermeer's vote of b3d, now that I've figured out how to use it.

I messed around with it yesterday (after having given up on it because it seemed like it wasn't exporting animations), finally got it to work, and it's the only animated format I've been able to get to work after exporting from Blender.

There are a couple of issues, though. For one, from what I can tell it only uses vertex colors instead of material colors. Set the material to blue in Blender and it exports white, and if you set diffuse and/or ambient color in Irrlicht it's still white.

Another thing is that it doesn't export animations the way you'd think it would. For example, if you have an animation that's 50 frames in Blender, export to b3d, then set the frame loop to 1 - 50 there will be so little movement that unless you're paying close attention you'd think it's a static mesh.

It seems that to figure up the animation loop, assuming you want to play the first animation and it's 10 frames, it would be obj->setFrameLoop(0,(BlenderEndFrame - 1)*100), and theoretically (I say that because I have yet to test), with BlenderStartFrame not necessarily being the first frame of the action in general, obj->setFrameLoop((BlenderStartFrame - 1)*100, (BlenderEndFrame - 1) * 100) in order to get the full range of animations.

It also seems that you need to pass a value in the thousands to the animation speed. For example, for a 50 frame animation to get it to play around the same speed (maybe a little faster) than it did in Blender, I have to set the frame loop to the range of 0 - 4,900 with a speed of 2,000.

I don't know why it's like this, as I've read nothing about the b3d file format or looked at Irrlicht's b3d handler, but keep those things in mind and b3d is probably the best you'll find for Blender.
Those who call the faithful 'sheep' do not realize that they themselves are sheep. We follow one shepherd, they follow another.
Dorth
Posts: 931
Joined: Sat May 26, 2007 11:03 pm

Post by Dorth »

It's simple and you've already figured it out.
When you bring the b3d format in Irrlicht, everything related to time is times 100, so basically, a framerate of 30 becomes 3000, an animation of 50 frames 5000, etc. ;)

I'm sure there'd be some way to bring it back by a hundred, likelly a file conversion or in the b3d loader of Irrlicht :)
Post Reply