www.jpct.net
Bones - Skeletal and Pose Animations for jPCT/jPCT-AE => Bones => Topic started by: efaj on December 27, 2011, 02:11:11 pm
-
Exception in thread "main" java.util.NoSuchElementException: tag [-in] not found
at raft.jpct.bones.util.ComLineArgs.getArg(ComLineArgs.java:97)
at raft.jpct.bones.util.ComLineArgs.getArg(ComLineArgs.java:115)
at raft.jpct.bones.util.JMEOgreImporter.main(JMEOgreImporter.java:149)
It's not due to Bones, as the exporter (Blender 2.61 to Ogre) is giving my errors already, but I'm curious: What does this error mean? What in particular is missing? (And just in case, which is the file that I should pass to jmeOgre2Bones.sh ? )
-
if you give no arguments it will display a help
basic usage is as follows:
JMEOgreImporter [options] -in <ogre.mesh.xml> [ogre.mesh.xml...]
for example:
JMEOgreImporter -out myFile.bones -in MyOgre.mesh.xml
you got the exception because you give at least one argument but omit the mandatory -in tag
-
-infinite amounts of facepalm- Ok, now it got past that. And it got me more intrigued o.O
Skeleton created out of jME OGRE skeleton, 16 joints
Exception in thread "main" java.lang.NullPointerException
at raft.jpct.bones.BonesImporter.convertJMEMeshData(BonesImporter.java:438)
at raft.jpct.bones.BonesImporter.importOgre(BonesImporter.java:193)
at raft.jpct.bones.util.JMEOgreImporter.loadGroup(JMEOgreImporter.java:112)
at raft.jpct.bones.util.JMEOgreImporter.loadGroup(JMEOgreImporter.java:88)
at raft.jpct.bones.util.JMEOgreImporter.run(JMEOgreImporter.java:69)
at raft.jpct.bones.util.JMEOgreImporter.main(JMEOgreImporter.java:170)
The error the exporter gave me was regarding:
Error: root bone has non-zero transform (location offset)
So, I'd assume what should be missing is the armature/skeleton... but that line points to a mesh array, and it prints as if apparently the skeleton was alright.
Anyways, this time it goes to any Blender user out there:
Error: root bone has non-zero transform (location offset)
How do I fix that? I already tried CTRL+A to apply everything it gave me an option to and didn't help. In Edit Mode it doesn't work, so as to maybe set it to the bone directly.
-
are you sure you are using latest version? as mentioned in this thread (http://www.jpct.net/forum2/index.php/topic,2318.msg17998.html#msg17998) that exception is solved
i'm not a Blender guy. so I can't help you about that.
have you tried clearing transform of root bone?
-
Checking at the source, it looks like it was already applied on my version. And the modified date matches. Anyways, re-downloading from http://www.aptalkarga.com/bones/bones.zip .
Same thing happened... and now I downloaded ones preconverted. (Ninja is converted correctly though)
And about the transform issue... if I knew how, I would. I've been googling and asking around, and nothing found nor any reply yet.
-
interesting. i'll pm my email to you. if you send me mesh amd skeleton files, i'll have a look..
-
I followed this recomendations that seem to be in general more "export friendly" http://www.stonetrip.com/developer/forum/viewtopic.php?f=24&t=24553
Except for the way the bone is placed, instead of extending on X, it extends on Z (which is like Ninja is)
Now, the root bone error is gone and the exporter shows no error and the correct amount of animations, etc, exported.
Bones script gives the same errors though.
Sent you two, one before I applied the fix, and the latest with the fix.
-
plz go to my post #4 in http://www.jpct.net/forum2/index.php/topic,2475.0.html (http://www.jpct.net/forum2/index.php/topic,2475.0.html) thread for more details.
-
please download and try this version:
http://www.aptalkarga.com/bones/bones_beta.zip
this fixes the NullPointerException. indeed this is a workaround. i consider this as a jME bug. it places a null texture buffer among others. anyway..
but you will encounter another problem. it's either caused by jME or Blender exporter, I'm not sure yet. play with exporter options and try to switch off "shared geometry"
-
My exporter gives me no options... hmm... jME.
I'm going to browse around jME stuff and see what I can do and export stuff the way they do and see if there are related problems there.
Now I'm almost sure it has to be the exporter.
EDIT: Nope, I'm using the exporter they all use... at least the ones with 2.6
-
nope, it's jME. and I guess I fixed it. please re-download the beta from the link above
-
My laptop broke... I'll have to check this later... :'(
-
You know... I had downloaded it on my laptop, and now I was going to redownload it to my netbook to try it here... but it's downloading at 0.1 kbps o.O
Is your server undergoing maintenance or what?
-
must be a temporary or local issue. i can download with more than >300kbps
-
Yup, it downloaded smoothly now.
Alright, tried it and sweet! It's on screen and it shows me the animation option (I'm testing using the LoadBonesFormatSample...
But, it's not getting animated the walk and some faces are missing: Bottom chest area, all the back, and upper part of left leg (Also, there's some in both legs that when rotated show like weird parts of the texture, from the upper areas... maybe some chest but I also see some skin, so it may be head too, but I think it may be the model -Ok, never mind this, I found there's some extra faces inside the legs and I'm on them-)
*sigh* the netbook gets stuck with Blender... couldn't even check for those faces. I'll have to postpone the 3D dev for now. How did it looked in your test -if any-?
-
i've similar results:
(http://s13.postimage.org/9eutx49oj/front.jpg) (http://postimage.org/image/9eutx49oj/)
(http://s17.postimage.org/5oyvf7pd7/back.jpg) (http://postimage.org/image/5oyvf7pd7/)
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 ;)
-
this is how your model looks in OgreMax viewer:
(http://s17.postimage.org/5d50jcjl7/front.jpg) (http://postimage.org/image/5d50jcjl7/)
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
-
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:
(http://i597.photobucket.com/albums/tt57/efaj/link.png)
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.
-
well, good luck ;)
-
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.
-
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 ;)
-
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:
(http://i597.photobucket.com/albums/tt57/efaj/error.png)
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.
(http://i597.photobucket.com/albums/tt57/efaj/options.png)
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?
-
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
-
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.
-
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?
-
- 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.
-
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
-
and of course thanks for the wiki page :D
-
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
-
@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?
(http://farm8.staticflickr.com/7025/6641996655_3ebbc34fe3_b.jpg)
-
add a picture of your original model too.
-
here you go:
(http://farm8.staticflickr.com/7023/6642125493_a6a0d375b4_b.jpg)
-
If you have all your vertices as part of a vertex group, and with weights that look Red in weight paint mode, the only other thing that I can think of that would also make sense considering some vertices seem to be moved towards another bone would be that some of your vertices are part of 2 groups at once:
For example it looks like some of your arm vertices are part of the head bone or leg bone...
But, that looks just like the issue I had when not all vertices were weight painted. I'd recommend you to double check on that.
On the exporter, try unchecking all the Optimize options too.
-
Thanks. I will look into that. I got the mesh model from my friend and I did the bones myself so I used automatic weights to deform the mesh as I dont realy know how to use weight paint... :o. This is probably the reason why vertices are part 2 groups...
Her is how it looks like in weight paint mode, it looks odd to me...
(http://farm8.staticflickr.com/7172/6642453525_3d7189f529_b.jpg)
Im going watch few vids on how to use weight paint now. :-[
-
Yes, as you can see, the weights for that bone are not Red, but yellow. That's like a 0.5 weight. Blue is 0, vertices not affected by that bone will be blue. And Red is 1, the max weight, where they will be completely affected by the bone.
Also, there's nothing wrong with vertices being part of 2 groups... the problem is if they are part of groups that are too apart: The vertices of the knee can be part of both the thigh and leg. But, I'd recommend to keep them to a minimum... in the preview image it looked as though some vertices were part of both the hand and head for example.
And, I'd recommend NOT to use blender's automatic weights as they won't be 1.0 (Red) and may even be badly done. Doing them yourself gives you more control and makes them right. And with weight paint, it doesn't take too long.
And last, I don't like video tutorials P: but here's the one I had used to learn about weight paint:
http://wiki.blender.org/index.php/Doc:2.4/Tutorials/Animation/BSoD/Character_Animation
It's pretty complete. Go to the middle, to the Rigging section
-
Thanks for sharing the link Im reading it now.
By shear chance and random luck...I got it to work, I went into weight paint mode and paint the yellow bit to blue and the model shown up complete without missing bits or pieces in LoadBonesFormatSample.... :-\
-
Ok... i didn't understood the last one... first, you should have painted from Yellow to Red. Blue means removing them from the bone. Red = belongs to bone. So if all is Blue, I guess all your model is missing or at least not animating?
But, if you did got it to work, why the :-\ face?
Just to clear things: Do you still have a problem or not?
-
Well the model loads up fine, nothing missing but the animation has messed up. I tried that before I read your thread so that's why I said it was luck but it's not enough for my case!
The animation is fine in blender but when it's played in SampleBoneFormat, it looks like the mesh dont deform well with the bones.
A pictures worth a thousand words! Here:
(http://farm8.staticflickr.com/7156/6642953063_9ac3af0914_b.jpg)
-
Take one with just the skeleton (in that same animation)
All the weights already must be fine, it must be related to the bones and their position. Maybe your skeleton is not the same size of your object?
-
I think you're right. The skeleton seems to be upside down or something like that.
(http://farm8.staticflickr.com/7025/6643173051_00b103fe81_b.jpg)
and here is just the skeleton, why it looks so weird lol
(http://farm8.staticflickr.com/7154/6643231823_0411e3289c_b.jpg)
Im going redo the armatures. I ran the Ninja model and every bones shown up in place while mines are everywhere.
-
oops, that is really weird..
-
Maybe you hadn't applied the transformations? Ctrl+A on the armature too. If they are not applied, the animation sequence may be what finishes making that look so weird: Without them applied, the armature would be in a position different to the one the keyframes expect.
But yeah, redoing the armature may be the best since I have no further idea of what's going on there.
-
yup, redid the armature finally sort it! Thanks guys.