Author Topic: [SOLVED]exporting Blender>Ogre>Bones  (Read 12331 times)

Offline raft

  • Moderator
  • quad
  • *****
  • Posts: 1972
    • View Profile
    • http://www.aptalkarga.com
Re: exporting Blender>Ogre>Bones
« Reply #15 on: December 31, 2011, 05:10:26 pm »
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 ;)


Offline raft

  • Moderator
  • quad
  • *****
  • Posts: 1972
    • View Profile
    • http://www.aptalkarga.com
Re: exporting Blender>Ogre>Bones
« Reply #16 on: December 31, 2011, 06:48:38 pm »
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

Offline efaj

  • byte
  • *
  • Posts: 32
    • View Profile
Re: exporting Blender>Ogre>Bones
« Reply #17 on: January 01, 2012, 06:38:39 am »
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.
« Last Edit: January 01, 2012, 07:40:10 am by efaj »

Offline raft

  • Moderator
  • quad
  • *****
  • Posts: 1972
    • View Profile
    • http://www.aptalkarga.com
Re: exporting Blender>Ogre>Bones
« Reply #18 on: January 01, 2012, 06:52:42 pm »
well, good luck ;)

Offline efaj

  • byte
  • *
  • Posts: 32
    • View Profile
Re: exporting Blender>Ogre>Bones
« Reply #19 on: January 04, 2012, 03:00:33 pm »
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.

Offline raft

  • Moderator
  • quad
  • *****
  • Posts: 1972
    • View Profile
    • http://www.aptalkarga.com
Re: exporting Blender>Ogre>Bones
« Reply #20 on: January 04, 2012, 03:10:37 pm »
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 ;)

Offline efaj

  • byte
  • *
  • Posts: 32
    • View Profile
Re: exporting Blender>Ogre>Bones
« Reply #21 on: January 04, 2012, 04:47:41 pm »
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?

Offline raft

  • Moderator
  • quad
  • *****
  • Posts: 1972
    • View Profile
    • http://www.aptalkarga.com
Re: exporting Blender>Ogre>Bones
« Reply #22 on: January 04, 2012, 05:12:54 pm »
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

Offline efaj

  • byte
  • *
  • Posts: 32
    • View Profile
Re: exporting Blender>Ogre>Bones
« Reply #23 on: January 04, 2012, 07:34:27 pm »
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.
« Last Edit: January 04, 2012, 09:42:35 pm by efaj »

Offline bili

  • byte
  • *
  • Posts: 39
    • View Profile
Re: exporting Blender>Ogre>Bones
« Reply #24 on: January 05, 2012, 01:35:14 am »
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?
« Last Edit: January 05, 2012, 01:38:33 am by bili »

Offline efaj

  • byte
  • *
  • Posts: 32
    • View Profile
Re: exporting Blender>Ogre>Bones
« Reply #25 on: January 05, 2012, 11:11:31 am »
  • 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.

Offline raft

  • Moderator
  • quad
  • *****
  • Posts: 1972
    • View Profile
    • http://www.aptalkarga.com
Re: exporting Blender>Ogre>Bones
« Reply #26 on: January 05, 2012, 01:07:33 pm »
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

Offline raft

  • Moderator
  • quad
  • *****
  • Posts: 1972
    • View Profile
    • http://www.aptalkarga.com
Re: exporting Blender>Ogre>Bones
« Reply #27 on: January 05, 2012, 01:08:49 pm »
and of course thanks for the wiki page :D

Offline efaj

  • byte
  • *
  • Posts: 32
    • View Profile
Re: [SOLVED]exporting Blender>Ogre>Bones
« Reply #28 on: January 05, 2012, 04:56:08 pm »
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

Offline bili

  • byte
  • *
  • Posts: 39
    • View Profile
Re: exporting Blender>Ogre>Bones
« Reply #29 on: January 05, 2012, 06:09:56 pm »
@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?