Export animated model from blender?

Hi, sorry didn't know where else to post this really!

I'm in the middle of making a skateboard game in jme and am stuck trying to animate the skateboard.



I loaded the model into blender and did a little kickflip keyframe animation which works fine, however i can't seem to get it to export properly. I downloaded the blender2md5.py script from this guide:

http://www.jmonkeyengine.com/wiki/doku.php?id=exporting_animated_.md5_models_from_blender

and placed it in .blender/scripts/blender/



The script seems to be working as "doom 3 md5" comes up in the export menu. When i type in the locations ("/home/emud/kickflip.md5mesh" and "/home/emud/kickflip.md5anim") and press export it seems to work, however when i look in my home directory the .md5anim file is not there and the .md5mesh file has this in it:


MD5Version 10
commandline ""

numJoints 0
numMeshes 1

joints {
}

mesh {
   shader ""

   numverts 0

   numtris 0

   numweights 0
}



that doesnt look like enough to be an animated model??

Sorry to be a total noob, i just need your help!!!
thanks.

I believe you will need an armature to actually drive the animations, rather than just animating (with keyframes) the mesh itself…

Yes, look into 'rigging' your skateboard in Blender and use the armature to animate it.

Aha, that fixed it! Great and surprisingly quite simple :smiley:

thanks!

One more question, don't really want to start a new topic as its on the same subject!

Does anyone have an example or test class for md5importer? I've tried using md5reader but that is refusing to work for some reason…

Argh i'm hopeless at this, after trying to get the svn repository view for about a million years, the md5 importer wont work either.

every method in almost every class says "The method xxx of type xxx must override a superclass method" and it wont let me run anything. commenting out @override gets rid of the error but i cant be bothered to do that for every method, knowing me that'll probably break everything anyway  :stuck_out_tongue:



i just want to do a kickflip  :?

this is what i get when i try to run TestAnim.java:


Exception in thread "main" java.lang.Error: Unresolved compilation problems:
   The import com.jme.image.Texture.MagnificationFilter cannot be resolved
   The import com.jme.image.Texture.MinificationFilter cannot be resolved
   Texture.MinificationFilter cannot be resolved to a type
   Texture.MagnificationFilter cannot be resolved to a type
   MinificationFilter cannot be resolved to a type
   The method getMiniFilter() is undefined for the type MeshImporter
   MagnificationFilter cannot be resolved to a type
   The method getMagFilter() is undefined for the type MeshImporter

   at com.model.md5.importer.MD5Importer.<init>(MD5Importer.java:7)
   at test.model.md5.Test.<init>(Test.java:17)
   at test.model.md5.TestAnim.<init>(TestAnim.java:14)
   at test.model.md5.TestAnim.main(TestAnim.java:17)



This magnificationFilter class doesn't seem to exist in my jme project???
hmmm....

Make sure all the jME stuff is available in the project that you are using the MD5Importer for…



What IDE?

I'm using eclipse 3.2

What do you mean by available in the project?

Its added the the build path if thats what you mean (under projects)

Here are pictures of how my md5importer project is set up, as far as i know it’s right, but then i’m never right, thought these might help you diagnose the problem!



the project:





projects tab in build path





libraries tab in build path





the jme project is straight from cvs and works fine, i don’t think thats the problem…

umm, if you got jME from the CVS server then you are using jME 1.0.  Make sure you are using MD5Importer that is for the correct version of jME…



(jME 2.0 is hosted on SVN: http://jmonkeyengine.googlecode.com/svn/trunk/ )

OOOOOOOOHHHHHH, i assumed the cvs was the most up to date, that makes a difference!

Ok so i got the md5importer for jme 1.0, the test classes run although it still gives me the same compilation errors for the rest of the project (The method xxx of type xxx must override a superclass method)



edit: Updating to jme2, seems the more sensible thing to do than mess around with old stuff…

This is probably not the correct answer, but update eclipse (I think it's up to 3.4 now).

It's ok now, well, its compiled without errors, but now when i try to run the TestAnim class it brings up some weird new error…


13-Mar-2009 01:22:19 com.jme.app.BaseGame start
INFO: Application started.
13-Mar-2009 01:22:19 com.jme.system.PropertiesGameSettings <init>
INFO: PropertiesGameSettings created
13-Mar-2009 01:22:19 com.jme.system.PropertiesGameSettings load
INFO: Read properties
13-Mar-2009 01:22:19 com.jme.app.BaseSimpleGame initSystem
INFO: jME version 2.0 Stable (r4093)
13-Mar-2009 01:22:19 com.jme.input.joystick.DummyJoystickInput <init>
INFO: Joystick support is disabled
13-Mar-2009 01:22:19 com.jme.system.lwjgl.LWJGLDisplaySystem <init>
INFO: LWJGL Display System created.
13-Mar-2009 01:22:19 com.jme.system.lwjgl.LWJGLDisplaySystem getValidDisplayMode
INFO: Selected DisplayMode: 640 x 480 x 24 @60Hz
13-Mar-2009 01:22:20 com.jme.renderer.lwjgl.LWJGLRenderer <init>
INFO: LWJGLRenderer created. W:  640H: 480   Version: 2.0.1
13-Mar-2009 01:22:21 com.jme.app.BaseSimpleGame initSystem
INFO: Running on: null
Driver version: null
ATI Technologies Inc. - ATI Radeon HD 4670 - 2.1.8087 Release
13-Mar-2009 01:22:21 com.jme.renderer.AbstractCamera <init>
INFO: Camera created.
13-Mar-2009 01:22:21 com.jme.util.lwjgl.LWJGLTimer <init>
INFO: Timer resolution: 1000 ticks per second
13-Mar-2009 01:22:21 com.jme.scene.Node <init>
INFO: Node created.
13-Mar-2009 01:22:21 com.jme.scene.Node <init>
INFO: Node created.
13-Mar-2009 01:22:21 com.jme.scene.Node <init>
INFO: Node created.
13-Mar-2009 01:22:21 com.jme.scene.Node attachChild
INFO: Child (Graph node) attached to this node (Stats node)
13-Mar-2009 01:22:21 com.jme.renderer.lwjgl.LWJGLTextureRenderer <init>
INFO: FBO support detected.
13-Mar-2009 01:22:21 com.jme.renderer.lwjgl.LWJGLTextureRenderer initCamera
INFO: Init RTT camera
13-Mar-2009 01:22:21 com.jme.renderer.AbstractCamera <init>
INFO: Camera created.
13-Mar-2009 01:22:21 com.jme.scene.Node <init>
INFO: Node created.
13-Mar-2009 01:22:21 com.jme.scene.Line <init>
INFO: Line created.
13-Mar-2009 01:22:21 com.jme.renderer.lwjgl.LWJGLTextureRenderer setupTexture
INFO: setup fbo tex with id 2: 640,360
13-Mar-2009 01:22:21 com.jme.scene.Node attachChild
INFO: Child (lineGraph) attached to this node (Graph node)
13-Mar-2009 01:22:21 com.jme.scene.Node attachChild
INFO: Child (f4) attached to this node (Graph node)
13-Mar-2009 01:22:21 com.jme.renderer.lwjgl.LWJGLTextureRenderer <init>
INFO: FBO support detected.
13-Mar-2009 01:22:21 com.jme.renderer.lwjgl.LWJGLTextureRenderer initCamera
INFO: Init RTT camera
13-Mar-2009 01:22:21 com.jme.renderer.AbstractCamera <init>
INFO: Camera created.
13-Mar-2009 01:22:21 com.jme.scene.Node <init>
INFO: Node created.
13-Mar-2009 01:22:21 com.jme.renderer.lwjgl.LWJGLTextureRenderer setupTexture
INFO: setup fbo tex with id 3: 640,120
13-Mar-2009 01:22:21 com.jme.scene.Node attachChild
INFO: Child (labelGraph) attached to this node (Graph node)
13-Mar-2009 01:22:21 com.jme.scene.Node <init>
INFO: Node created.
13-Mar-2009 01:22:21 com.jme.scene.Node attachChild
INFO: Child (ModelNodeMesh) attached to this node (ModelNode)
13-Mar-2009 01:22:21 com.jme.scene.Node <init>
INFO: Node created.
13-Mar-2009 01:22:21 com.jme.scene.Node attachChild
INFO: Child (HeadMesh) attached to this node (Head)
13-Mar-2009 01:22:22 com.jme.util.resource.ResourceLocatorTool locateResource
WARNING: Unable to locate: models/characters/common/teethsarge
13-Mar-2009 01:22:22 com.jme.util.TextureManager loadTexture
WARNING: Could not load image...  URL was null. defaultTexture used.
13-Mar-2009 01:22:22 com.jme.scene.Node attachChild
INFO: Child (HeadMesh) attached to this node (Head)
13-Mar-2009 01:22:22 com.jme.util.resource.ResourceLocatorTool locateResource
WARNING: Unable to locate: models/characters/common/leftsarge
13-Mar-2009 01:22:22 com.jme.util.TextureManager loadTexture
WARNING: Could not load image...  URL was null. defaultTexture used.
13-Mar-2009 01:22:22 com.jme.scene.Node attachChild
INFO: Child (HeadMesh) attached to this node (Head)
13-Mar-2009 01:22:22 com.jme.util.resource.ResourceLocatorTool locateResource
WARNING: Unable to locate: models/characters/common/rightsarge
13-Mar-2009 01:22:22 com.jme.util.TextureManager loadTexture
WARNING: Could not load image...  URL was null. defaultTexture used.
13-Mar-2009 01:22:22 com.jme.scene.Node attachChild
INFO: Child (HeadMesh) attached to this node (Head)
13-Mar-2009 01:22:22 com.jme.scene.Node attachChild
INFO: Child (HeadMesh) attached to this node (Head)
13-Mar-2009 01:22:22 com.jme.scene.Node attachChild
INFO: Child (Head) attached to this node (ModelNode)
13-Mar-2009 01:22:22 com.jme.scene.Node detachChildAt
INFO: Child removed.
13-Mar-2009 01:22:22 com.jme.scene.Node detachChildAt
INFO: Child removed.
13-Mar-2009 01:22:22 com.jme.scene.Node detachChildAt
INFO: Child removed.
13-Mar-2009 01:22:22 com.jme.scene.Node detachChildAt
INFO: Child removed.
13-Mar-2009 01:22:22 com.jme.scene.Node detachChildAt
INFO: Child removed.
13-Mar-2009 01:22:22 com.jme.scene.Node attachChild
INFO: Child (HeadMesh) attached to this node (Head)
13-Mar-2009 01:22:22 com.jme.util.resource.ResourceLocatorTool locateResource
WARNING: Unable to locate: models/characters/common/teethsarge
13-Mar-2009 01:22:22 com.jme.util.TextureManager loadTexture
WARNING: Could not load image...  URL was null. defaultTexture used.
13-Mar-2009 01:22:22 com.jme.scene.Node attachChild
INFO: Child (HeadMesh) attached to this node (Head)
13-Mar-2009 01:22:22 com.jme.util.resource.ResourceLocatorTool locateResource
WARNING: Unable to locate: models/characters/common/leftsarge
13-Mar-2009 01:22:22 com.jme.util.TextureManager loadTexture
WARNING: Could not load image...  URL was null. defaultTexture used.
13-Mar-2009 01:22:22 com.jme.scene.Node attachChild
INFO: Child (HeadMesh) attached to this node (Head)
13-Mar-2009 01:22:23 com.jme.util.resource.ResourceLocatorTool locateResource
WARNING: Unable to locate: models/characters/common/rightsarge
13-Mar-2009 01:22:23 com.jme.util.TextureManager loadTexture
WARNING: Could not load image...  URL was null. defaultTexture used.
13-Mar-2009 01:22:23 com.jme.scene.Node attachChild
INFO: Child (HeadMesh) attached to this node (Head)
13-Mar-2009 01:22:23 com.jme.scene.Node attachChild
INFO: Child (HeadMesh) attached to this node (Head)
13-Mar-2009 01:22:23 com.jme.scene.Node attachChild
INFO: Child (ModelNode) attached to this node (rootNode)
13-Mar-2009 01:22:23 class test.model.md5.TestFading start()
SEVERE: Exception in game loop
java.lang.NullPointerException
   at com.jme.math.Quaternion.slerp(Quaternion.java:608)
   at com.model.md5.controller.MD5Controller.updateFading(MD5Controller.java:196)
   at com.model.md5.controller.MD5Controller.update(MD5Controller.java:137)
   at com.jme.scene.Spatial.updateWorldData(Spatial.java:541)
   at com.jme.scene.Node.updateWorldData(Node.java:383)
   at com.jme.scene.Spatial.updateGeometricState(Spatial.java:517)
   at com.model.md5.MD5Node.updateGeometricState(MD5Node.java:109)
   at com.jme.scene.Node.updateWorldData(Node.java:395)
   at com.jme.scene.Spatial.updateGeometricState(Spatial.java:517)
   at com.jme.app.BaseSimpleGame.initGame(BaseSimpleGame.java:552)
   at com.jme.app.BaseGame.start(BaseGame.java:74)
   at test.model.md5.TestFading.main(TestFading.java:17)
13-Mar-2009 01:22:23 com.jme.app.BaseSimpleGame cleanup
INFO: Cleaning up resources.
13-Mar-2009 01:22:23 com.jme.app.BaseGame start
INFO: Application ending.



fun fun fun  :?

EDIT: Never mind, got it working! Re-downloaded md5importer :D

Ok i promise this question will be quick!



When importing a blender model with md5importer the model rotates in the wrong axis, i seem to remember a fix for md5reader which dealt with this but am yet to find a solution for md5importer, anybody know how to fix this?

Read this: http://www.jmonkeyengine.com/jmeforum/index.php?topic=7323.105

(page 7-8 and page 10)

Hmmm i'm not sure i understand this fully, my model has one armature in it (is this a bone?) which controls the whole skateboard (all weight painted red). To animate i rotate the armature. It says to fix the problem rotate the root bone 90 in x and y. So what is my root bone, do i need to create a new bone which is not animated and rotate that?

I would say yes, the rootBone should not have any animations on it anyway…





(you could also just try rotating the armature and mesh in object mode…)

Hmmm i've tried various different roatations but can't seem to get it right, at the moment the animation is playing properly (it looks like a kickflip) but its pointing sideways. Can i just rotate it in jme now?

Hmm everything seems to be working now :smiley:

Is there any way to start and stop the animations at will? I seem to be limited to just the controller repeat types…at the moment i have it on RT_CLAMP so it only does it once, but is there a method to start it again (eg. when the person does another kickflip)



great thanks for all the help you've given so far :smiley:



Ah ok i see a reset method in MD5animation class, is there any javadoc anywhere i can download?