Beginner Tutorial Minor Problems

Hi all,



I've recently started working with the tutorials on the wiki of the JME website. It seems really great to be honest but I know really nothing about JME and am basically learning everything as I go. However, I'm very interested in pursuing it, at least for exploratory reasons.



The problem I run into is here



–> http://www.jmonkeyengine.com/wiki/doku.php/jme3:beginner:hello_asset



When I run this bit of code it claims I do not have the elephant.skeleton.xml file.



WARNING DesktopAssetManager 10:27:20 PM Cannot locate resource: Models/Elephant/Elephant.skeleton.xml



It's true, the version of JME i had did not include this but I found the remains of the elephant legacy within the models folder in some older google code bits. Even after doing so and making sure I have the exact files it's looking for it still spits out this error. I know it's probably something silly related to bookkeeping of the wiki, and I could just test the same tutorial in another way but I would like to really figure out what is happening. The directory is linked and I can interact with the folders as needed, i just seem to run into a problem in THIS tutorial involving importing assets.



If anyone has any solutions I would be very grateful…

Don't worry it is not a real issue :slight_smile: As long as the elephant loads its fine.

It's just that before we relied strongly on the extension skeletonxml (without the dot) for ogre3d skeleton files and now we are kind of trying to switch to skeleton.xml (with the dot). It just tries both variations in-case you're using the old or new naming scheme, the warning is a side-effect of that.

Thank you (:

I tried to load a model but it failed.

I dont know if I gave the wrong path, or because of the dot. (mesh.xml instead of meshxml)

or my ogre exporter is already out of date.



by the way, I copied and modified the code from tut, ,my mesh doesn't have material so i used the without material code.

and I get this error.



WARNING DesktopAssetManager 10:52:25 PM Cannot locate resource: model/Cylinder.001.material

WARNING MeshLoader 10:52:25 PM Material Material not found. Applying default material

SEVERE Application 10:52:25 PM Uncaught exception thrown in Thread[LWJGL Renderer Thread,5,main]

java.lang.IndexOutOfBoundsException: 6428

at java.nio.HeapFloatBuffer.put(HeapFloatBuffer.java:154)

at com.jme3.scene.plugins.ogre.MeshLoader.pushBoneAssign(MeshLoader.java:467)

at com.jme3.scene.plugins.ogre.MeshLoader.startElement(MeshLoader.java:486)

at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.startElement(AbstractSAXParser.java:501)

at com.sun.org.apache.xerces.internal.parsers.AbstractXMLDocumentParser.emptyElement(AbstractXMLDocumentParser.java:179)

at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.scanStartElement(XMLNSDocumentScannerImpl.java:377)

at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(XMLDocumentFragmentScannerImpl.java:2755)

at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:648)

at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.next(XMLNSDocumentScannerImpl.java:140)

at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:511)

at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:808)

at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:737)

at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:119)

at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1205)

at com.jme3.scene.plugins.ogre.MeshLoader.load(MeshLoader.java:723)

at com.jme3.asset.DesktopAssetManager.loadAsset(DesktopAssetManager.java:137)

at com.jme3.asset.DesktopAssetManager.loadModel(DesktopAssetManager.java:254)

at com.jme3.asset.DesktopAssetManager.loadModel(DesktopAssetManager.java:264)

at HelloAssets.simpleInitApp(HelloAssets.java:33)

at com.jme3.app.SimpleApplication.initialize(SimpleApplication.java:141)

at com.jme3.system.lwjgl.LwjglAbstractDisplay.initInThread(LwjglAbstractDisplay.java:102)

at com.jme3.system.lwjgl.LwjglAbstractDisplay.run(LwjglAbstractDisplay.java:147)

at java.lang.Thread.run(Thread.java:619)

AL lib: ALc.c:1352: exit(): closing 1 Device

AL lib: ALc.c:1329: alcCloseDevice(): destroying 1 Context

AL lib: alSource.c:2361: alcDestroyContext(): deleting 16 Source(s)









and GDE alpha doesn't work for me, I think it is because of OPEN AL like before (I'm in linux now)

it seems there isnt any new nightly of gde yet




xieu90 said:

and GDE alpha doesn't work for me, I think it is because of OPEN AL like before (I'm in linux now)
it seems there isnt any new nightly of gde yet

There wont be any new nightlies of jMP, instead you can just start it and ignore the errors, go to Tools->Plugins and update to the newest version via the nightly update center.

Thank you Normen, GDE works now ^^

I also tried to import Model with/without Skeleton

so if I import it without skeleton then it is ok

but if I export with skeleton then I got the above error, the Exception 6428.

I dont know what that exception means.



in Blender there was a Warning: Vertex with more than 4 bone assignments!

and in GDE: cannot convert mash.xml file to jme binary



so how can I fix it ?

"Vertex with more than 4 bone assignments" is the best hint. Just make it only four assignments per vertex…

There is a blender-script that do this for you. Have a look here:



http://www.jmonkeyengine.com/forum/index.php?topic=14026.0


  • Download the file
  • rename it so it only have the .py extension.
  • Place it where you placed the ogre-export-script in the blender-script-dir.
  • Restart blender
  • select mesh
  • change to weight-paint
  • in the 3d-view menu -> paint -> Normalise Vertex Group Weights for Ogre



    That will take the 4 most influcing bones for each vertex and normalizes its weights and set the other influences to zero.



    That will remove at least the "Vertex with more thant 4 bones…" warning.
ttrocha said:

There is a blender-script that do this for you. Have a look here:

http://www.jmonkeyengine.com/forum/index.php?topic=14026.0

- Download the file
- rename it so it only have the .py extension.
- Place it where you placed the ogre-export-script in the blender-script-dir.
- Restart blender
- select mesh
- change to weight-paint
- in the 3d-view menu -> paint -> Normalise Vertex Group Weights for Ogre

That will take the 4 most influcing bones for each vertex and normalizes its weights and set the other influences to zero.

That will remove at least the "Vertex with more thant 4 bones.." warning.


Hi I downloaded and did like you said but I dont see your script anywhere in blender.
I also extra updated menu in script window but still dont see it.
I posted 2 pic, one is where I pasted your script to (I'm in linux) , there is also an extra in ogre exporters folder
and other pic is the 3d-view menu -> paint (is it the paint you said ?)


I also tried this: I deleted all bone, then I add just 2 bone and then export it.
blender gave me a lot of warning about vertex with no bone assigned
but jme loaded it(without lower arms )^^ havent tried animation yet.

I hope I can somehow try your script soon.

I don't think you placed it in the right folder! Ah sry,…it wasn't plugin-dir but "scripts"-dir!

There are also many other .py-files (like 3ds_export.py ,etc)

ttrocha said:

I don't think you placed it in the right folder! Ah sry,...it wasn't plugin-dir but "scripts"-dir!
There are also many other .py-files (like 3ds_export.py ,etc)


hi, is it this folder ? I found the 3ds_export.py like you said. copied it there, restarted blender but in paint menu there is still nothing about ogre. do I have to update or do something else to make it appear on the menu ?

Hmm,…that seems to be the right directory! Strange, for me it works!

ttrocha said:

Hmm,...that seems to be the right directory! Strange, for me it works!

I dont know either. may be because I use linux ?
I will try on other machine later and I might try running script in blender, somewhere I read if I press Alt+P it will run the script
(I havent read it correctly yet ^^)
yeah, for which blender did you write the script ? 2.49 or 2.5 ?
I am still using 2.49.

I had it with linux running as well (when I used ubuntu).  Well…maybe we are still at the wrong place (although it looked good to me) Anyone else have an idea?

ttrocha said:

I had it with linux running as well (when I used ubuntu).  Well...maybe we are still at the wrong place (although it looked good to me) Anyone else have an idea?

I use Linux Mint, it is also Ubuntu with a bit of modification
I tried to run the code from text window(like in the pic, dont know if I did the right)
when I press Alt P then I got that error.
here is the error from the console:
oem@oem-desktop ~ $ blender
Compiled with Python version 2.6.4rc2.
Checking for installed Python... got it!
  File "Text", line 200
   
    ^
SyntaxError: invalid syntax

so I deleted line 200 and it works (the line was empty)
normalise weights for OGRE called
Removed 108 weights and normalised weights for 1202 verts.

I exported the mesh and didnt get the error ^^
now I will send those file to laptop and try to import it into jme and later i will try animation(still dont know how in jme3)

I also modified the file in script folder, but in the paint menu it is still isnt there. so I dont know what to do now.
strange!