best format for models + blender [need an advice]
best format for models + blender [need an advice]
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...
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?
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?
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.)
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.)
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:
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:
EDIT:
Here is what i get in console of my app:
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:Unknown data object in x file: AnimTicksPerSecond
Mesh without material found in x file.
Loaded mesh: cube.x
Code: Select all
NewtonCollision *collision = NewtonCreateConvexHull(pWorld, mb->getVertexCount(), varray, sizeof(float)*3, 0);
I gues that meshbuffer mb that even does not exist with cube.x is meant to be that 0x00000000 adress.Unhandled exception at 0x00406db1 in Demo1.exe: 0xC0000005: Access violation reading location 0x00000000.
you can find it here-
http://irrlicht-plugins.googlecode.com/ ... 0to%20B3D/
http://irrlicht-plugins.googlecode.com/ ... 0to%20B3D/
thank you. i have a little experience with python so i took a look at script.. So we have an error like this:
error occours here:
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:
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
with
I hope im not wrong
By the way, what can/should i write into "Export Action" field in the script?
Fixed script: Download
this means that we want to use arm_action but it is not even created.UnboundLocalError: local variable 'arm_action' referenced before assignment
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)
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)
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)
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)
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.
It looks like i almost fixed mirrored mesh problem. I didnt find bug, its more like dirty trick than bug fix The hack is that we simply multiply BASE_MATRIX by another matrix which mirrors our base matrix.
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?
Code: Select all
mirrorMatrix = Mathutils.Matrix([ 1, 0, 0, 0], \
[ 0,-1, 0, 0], \
[ 0, 0, 1, 0], \
[ 0, 0, 0, 0])
Download
EDIT:
You know, i like here talking to myself, but maybe someone could help me with that inverted normals stuff?
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.
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.