From b72930994959927e8d2c6c94bbc550b11e6b033c Mon Sep 17 00:00:00 2001 From: "sha..rd" Date: Sat, 23 Apr 2011 20:51:23 +0000 Subject: [PATCH] * Fix syntax error in TestOgreAnim * Ogre3D MaterialLoader now properly loads materials exported from blender2ogre (Blender 2.57) git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@7297 75d07b2b-3a1a-0410-a2c5-0572b91ccdca --- .../src/ogre/com/jme3/scene/plugins/ogre/MaterialLoader.java | 3 +++ engine/src/test/jme3test/model/anim/TestOgreAnim.java | 5 ++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/engine/src/ogre/com/jme3/scene/plugins/ogre/MaterialLoader.java b/engine/src/ogre/com/jme3/scene/plugins/ogre/MaterialLoader.java index 11e7c98b2..aec8e31ad 100644 --- a/engine/src/ogre/com/jme3/scene/plugins/ogre/MaterialLoader.java +++ b/engine/src/ogre/com/jme3/scene/plugins/ogre/MaterialLoader.java @@ -246,6 +246,9 @@ public class MaterialLoader implements AssetLoader { String mode = scan.next(); if (mode.equals("alpha_blend")){ blend = true; + }else{ + // skip the rest + readString("\n"); } }else if (keyword.equals("cull_hardware")){ String mode = scan.next(); diff --git a/engine/src/test/jme3test/model/anim/TestOgreAnim.java b/engine/src/test/jme3test/model/anim/TestOgreAnim.java index 9fb2c6e1a..9d53b08e4 100644 --- a/engine/src/test/jme3test/model/anim/TestOgreAnim.java +++ b/engine/src/test/jme3test/model/anim/TestOgreAnim.java @@ -36,6 +36,7 @@ import com.jme3.animation.AnimChannel; import com.jme3.animation.AnimControl; import com.jme3.animation.AnimEventListener; import com.jme3.animation.LoopMode; +import com.jme3.animation.SkeletonControl; import com.jme3.app.SimpleApplication; import com.jme3.input.KeyInput; import com.jme3.input.controls.ActionListener; @@ -83,11 +84,13 @@ public class TestOgreAnim extends SimpleApplication channel.setAnim("stand"); + SkeletonControl skeletonControl = model.getControl(SkeletonControl.class); + Box b = new Box(.25f,3f,.25f); Geometry item = new Geometry("Item", b); item.move(0, 1.5f, 0); item.setMaterial(assetManager.loadMaterial("Common/Materials/RedColor.j3m")); - Node n = control.getAttachmentsNode("hand.right"); + Node n = skeletonControl.getAttachmentsNode("hand.right"); n.attachChild(item); rootNode.attachChild(model);