[SOLVED]exporting Blender>Ogre>Bones

Started by efaj, December 27, 2011, 02:11:11 PM

Previous topic - Next topic

raft

i've similar results:



it's indeed animated but we see no results because all animation values are zero. have a look at skeleton file, all rotation and translations are zero. somehow your exporter does not export animation values.

missing polygons are interesting. i thought your model might be like that but obviously not. what is the polygon count of your model? there are 439 polygons in this file. i want to learn if some polygons aren't exported or got lost somewhere.

also, does your exporter have a viewer? if so, try to open exported files with that. OgreMax has a viewer and it's very useful to find who's fault incorrectly viewed models are ;)


raft

this is how your model looks in OgreMax viewer:


seems as this is caused by your exporter.

btw, which exporter are you using? if this one, seems as it provides many options
http://www.ogre3d.org/tikiwiki/Blender+Exporter

efaj

#17
The model in blender has:
Vertices: 197
Faces: 407
Edges: 567

So... if I'm not mistaken, there's actually more polygons there? o.o It may be possible that blender uses quads while the exporter converts them to triangles... but, I can't get into depth without Blender crashing on my netbook.

I'm using this one: http://www.ogre3d.org/forums/viewtopic.php?f=8&t=61485&sid=19886363f853b0709858c42dccc8abfb
It's for blender 2.6x, the current release and the one I'm using is 2.61... It has no viewer, and no options. What's used apparently is Ogre Meshy... which I couldn't get to work on Linux, nor now on the netbook on Windows.

However, it seems 2.49 has many more scripts (despite a HORRIBLE interface), like a Poly Reducer that keeps UV maps. And that exporter is 2.49... I'm gonna try it and post the results.

Edit:
How it should have looked:


While taking this image... I had an idea: My root bone is connected to the chest bone, but there's an offset... maybe the chest got moved by that offset. I'll see if my netbook cooperates on this one.

Edit2:
The animation itself was lost from Blender... I'm looking into this... weird thing is all the keyframes are correctly... just not moving anything. but that's something for me to mess with Blender. Maybe after remaking the animation and fixing the root bone it will all work with the 2.6 exporter.

raft


efaj

IT'S ALIVE!
After remaking the animation, it did work! Using the 2.6 exporter and bones beta.
Only issue is still the missing vertices which didn't have anything to do with the root bone's offset after all.

raft

cool :) about missing vertices, have you encountered anything similar in Ogre forums?

maybe after all settled, you write a wiki page for other blender users ;)

efaj

Yup, I was thinking on it.

And I haven't been able to find anything about that in ogre forums... googling I ended up back on this topic before finding anything. So, I started animating another object to see if the same happened or at least the cause was clearer...
And, I did find where were the options for this exporter.... my bad. But, I also found another error:

From the above, everything was checked on with that error except "Only animated bones". The options as you see where used in a future test which output the same.

On the left side there's also the options of the exporter, though I didn't find "shared geometry". Are there any settings that may help?
Do you know what's that Exception about?

raft

i guess the exception happens because an index refer to a vertice or UV coordinate that is ahead of array size. please re-download the beta, it should throw a more meaningful exception for that

you can try switching off 'optimize arrays' and 'reorganize buffers' options

efaj

#23
I re-downloaded, but the warning was the same... but, since you mentioned it, the error was related to having 2 materials on the same mesh. So I split them in 2 meshes, and no prob now.

And, I finally found out the cause of the "missing vertices": They were vertices that didn't belong to any bone.

So now I'm gonna ask for a wiki account and get that entry going.

Edit: Wiki page is up. http://www.jpct.net/wiki/index.php/Exporting_from_Blender_to_Bones#Exporting
I linked to the Bones beta for now since I don't know if/when the main version will have the jme fix.

bili

#24
Thanks to both! Im in similar boat as efaj. Hopefully I can use the info here to sort out my model issues.

@efaj: can you briefly outline some instructions on how can I locate vertices that do not belong to any bones in blender?

efaj


  • Select the object
  • Go to Edit mode
  • On the Properties panel (change one into Properties if you don't have it while keeping a 3D view panel), on the Object Data tab, go to "Vertex Groups".
  • Be sure you have NO vertex selected by pressing A_key to select all, and pressing it again to unselect all.
  • Now, for each vertex group:
  • Select it and press "Select", and then hover over the 3D view panel, and press H_key. This will hide all vertices from that group. (The Outline "has" even a "hide" option, but it doesn't work for me, maybe it does for you and saves you work... if not, you'll have to use what I just said)
Every vertex that remains has no bone assigned. So either you do what I did and remember their positions and go to weight paint mode... OR you do the smart way and add them to a vertex group from there:
With those missing vertices still selected, on the Properties panel, click the Vertex Group you want to add them to, and click "Assign".

After you are done, use Alt+H_key to make all the hidden vertices visible again.

The following may just be me, or may be because I haven't experimented enough but here goes in case after all that you are still missing vertices:
HOWEVER, I noticed that maybe because of how Blender has different weights, that it seems only those on max weight (red on weight paint mode) are counted, so after this you may want to test your model on LoadBonesFormatSample.java from Bones's examples. Then, whatever is missing from there, you go to vertex paint mode to paint it for the corresponding bone.

raft

cool, I'm glad you finally  solved the issue :)

i've removed the beta link and made this the official release.

for meaningful exception, last time was my bad, an arithmetic error, now it should throw a meaningful exception instead of ArrayIndexOutOfBoundsException

raft

and of course thanks for the wiki page :D

efaj

Alright, I changed the wiki link to point at just the Bones webpage (Since I was already linking to something, might as well link to the site just in case someone would read it without Bones).

And the wiki page was no prob, just giving back for the help and awesome engine that is jpct+Bones  :P
I had been analyzing several java 3d engines, and the software mode was exactly what I wanted... Skeletal animations and software mode were all the things I needed on an engine.

I'll try to contribute some more in the future. And while I'm on it, your glFont and texturePack are also great

bili

@efaj: thanks for your instruction but after I done that, there is no vertex left so I guess all vertex were assigned to bone groups accordingly.

But my problem is still the same, any guess what may cause the problem in the pic included below?