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.
roxaz
Posts: 575
Joined: Tue Jan 23, 2007 8:35 pm
Location: LT

best format for models + blender [need an advice]

Post by roxaz »

So tell me what is the best format for models to use in irrlicht, and what is the best model format to export from blender? I tried to use .x but one exporter exported completely invisible model, other exporter made my physics to scream like a little girl (i gues there were mesh buffer problems), another exporter completely not working... i dont know what to choose... :|
BlindSide
Admin
Posts: 2821
Joined: Thu Dec 08, 2005 9:09 am
Location: NZ!

Post by BlindSide »

I used X exporter with success when tweaking some little options. Search this forum for the best exporter, i remember somebody made some good changes to the original. But I had a problem too in the end because the bones were not attached correctly to the model. I had to open it up in milkshape and attach them.

I think it is hard to export to a good working model for free, that is the sad truth. OR Maybe you can somehow improve B3D exporter?
roxaz
Posts: 575
Joined: Tue Jan 23, 2007 8:35 pm
Location: LT

Post by roxaz »

and what improvements B3D needs? and plz remind me, what modeler's native format is B3D?
BlindSide
Admin
Posts: 2821
Joined: Thu Dec 08, 2005 9:09 am
Location: NZ!

Post by BlindSide »

Blitz3D. Get lukes old exporter from the google source repository and try to fix it up. Aside from the model supposedly coming out mirrored, it currently throws a python error and doesnt work at all. :?

Im sure if you find the python bug the mirror thing should be easy (Well not any harder than X thats for sure). Just flip the normals in blender than give it a negative scale in irrlicht.


If you cant be bothered the blender X exporter version 2.42 or something works fine for the most part for me. (Only bones are not attaching correctly.)
roxaz
Posts: 575
Joined: Tue Jan 23, 2007 8:35 pm
Location: LT

Post by roxaz »

maybe 2.42 works with irrlicht... but i get error in my physics part of the code so there is something wrong :?

EDIT:
Here is what i get in console of my app:
Unknown data object in x file: AnimTicksPerSecond
Mesh without material found in x file.
Loaded mesh: cube.x
So we have a problem, but we still can use cube i gues, we loaded it right? Next, newton stops and makes my app crash at this line:

Code: Select all

NewtonCollision *collision = NewtonCreateConvexHull(pWorld, mb->getVertexCount(), varray, sizeof(float)*3, 0);
And debuger does not react when i keep mouse over the "mb->getVertexCount()" so it means that mb has no value / is not created or whatever... Output gives this:
Unhandled exception at 0x00406db1 in Demo1.exe: 0xC0000005: Access violation reading location 0x00000000.
I gues that meshbuffer mb that even does not exist with cube.x is meant to be that 0x00000000 adress.
roxaz
Posts: 575
Joined: Tue Jan 23, 2007 8:35 pm
Location: LT

Post by roxaz »

i have an idea. what if i use ogre mesh format? blender has quite nice exporter and mesh format is 100% working with irrlicht(i gues). what do you think?
Saturn
Posts: 418
Joined: Mon Sep 25, 2006 5:58 pm

Post by Saturn »

There is no animation support in irrlicht for ogre meshes yet.
vermeer
Posts: 2017
Joined: Wed Jan 21, 2004 3:22 pm
Contact:

Post by vermeer »

b3d and sio2 md5...
Finally making games again!
http://www.konekogames.com
roxaz
Posts: 575
Joined: Tue Jan 23, 2007 8:35 pm
Location: LT

Post by roxaz »

maybe anyone could provide me with Luke's b3d exporter for blender? getting proper x mesh out of blender seems to be mission impossible
bitplane
Admin
Posts: 3204
Joined: Mon Mar 28, 2005 3:45 am
Location: England
Contact:

Post by bitplane »

Submit bugs/patches to the tracker!
Need help right now? Visit the chat room
JPulham
Posts: 320
Joined: Sat Nov 19, 2005 12:06 pm

Post by JPulham »

does the B3D work with lightmaps yet???
pushpork
roxaz
Posts: 575
Joined: Tue Jan 23, 2007 8:35 pm
Location: LT

Post by roxaz »

thank you. i have a little experience with python so i took a look at script.. So we have an error like this:
UnboundLocalError: local variable 'arm_action' referenced before assignment
this means that we want to use arm_action but it is not even created.
error occours here:

Code: Select all

    if ToggleStatic==0:
        chunk_buf=chunk_buf+write_chunk_node(0,rangestart,rangeend,arm_action)
    else:
        chunk_buf=chunk_buf+write_chunk_node(0,rangestart,rangeend,arm_action)
you see, two "chunk_buf=chunk_buf+write_chunk_node(0,rangestart,rangeend,arm_action)" lines are completely identical. So if we press ToggleStatic button we set it to 1, but arm_action is being created only when button is not pressed.
Lets see what write_chunk_node does with arm_action:

Code: Select all

    if ToggleStatic==0:
        if arm_action:
            chunk_buf=chunk_buf+write_chunk_anim(rangeend-rangestart)
            chunk_buf=chunk_buf+write_chunk_bones(None)
As we see, if we export static mesh - arm_action has no meaning for function. So if you dont want to get error while exporting static mesh, replace

Code: Select all

    if ToggleStatic==0:
        chunk_buf=chunk_buf+write_chunk_node(0,rangestart,rangeend,arm_action)
    else:
        chunk_buf=chunk_buf+write_chunk_node(0,rangestart,rangeend,arm_action)
with

Code: Select all

    if ToggleStatic==0:
        chunk_buf=chunk_buf+write_chunk_node(0,rangestart,rangeend,arm_action)
    else:
        chunk_buf=chunk_buf+write_chunk_node(0,rangestart,rangeend,0)
I hope im not wrong :)

By the way, what can/should i write into "Export Action" field in the script?

Fixed script: Download
Last edited by roxaz on Wed May 23, 2007 5:10 pm, edited 1 time in total.
roxaz
Posts: 575
Joined: Tue Jan 23, 2007 8:35 pm
Location: LT

Post by roxaz »

JPulham wrote:does the B3D work with lightmaps yet???
take a look here
roxaz
Posts: 575
Joined: Tue Jan 23, 2007 8:35 pm
Location: LT

Post by roxaz »

It looks like i almost fixed mirrored mesh problem. I didnt find bug, its more like dirty trick than bug fix :lol: The hack is that we simply multiply BASE_MATRIX by another matrix which mirrors our base matrix.

Code: Select all

mirrorMatrix = Mathutils.Matrix([ 1, 0, 0, 0], \
                                [ 0,-1, 0, 0], \
                                [ 0, 0, 1, 0], \
                                [ 0, 0, 0, 0])
But one problem still remains... Normals are flipped and i still cant find a way to invert them. Anyway inverting normals is much easyier job than mirroring all your mesh :)

Download

EDIT:
You know, i like here talking to myself, but maybe someone could help me with that inverted normals stuff? :roll:
dwmitch
Posts: 52
Joined: Thu Nov 09, 2006 9:29 pm

Post by dwmitch »

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.
Those who call the faithful 'sheep' do not realize that they themselves are sheep. We follow one shepherd, they follow another.
Post Reply