From 6573b87bf0d31d40fa14e5ab514960c05837ab8a Mon Sep 17 00:00:00 2001 From: "Kae..pl" Date: Wed, 14 Nov 2012 10:30:10 +0000 Subject: [PATCH] Bugfix: Issue 547: Unsupported type exception importing model from Blender git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@9997 75d07b2b-3a1a-0410-a2c5-0572b91ccdca --- .../scene/plugins/blender/curves/CurvesHelper.java | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/engine/src/blender/com/jme3/scene/plugins/blender/curves/CurvesHelper.java b/engine/src/blender/com/jme3/scene/plugins/blender/curves/CurvesHelper.java index 63998fa62..b7a224ae3 100644 --- a/engine/src/blender/com/jme3/scene/plugins/blender/curves/CurvesHelper.java +++ b/engine/src/blender/com/jme3/scene/plugins/blender/curves/CurvesHelper.java @@ -53,6 +53,7 @@ import com.jme3.math.Vector3f; import com.jme3.math.Vector4f; import com.jme3.scene.Geometry; import com.jme3.scene.Mesh; +import com.jme3.scene.Spatial; import com.jme3.scene.VertexBuffer.Type; import com.jme3.scene.mesh.IndexBuffer; import com.jme3.scene.plugins.blender.AbstractBlenderHelper; @@ -239,10 +240,11 @@ public class CurvesHelper extends AbstractBlenderHelper { } //reading custom properties - Properties properties = this.loadProperties(curveStructure, blenderContext); - if(properties != null && properties.getValue() != null) { - for(Geometry geom : result) { - geom.setUserData("properties", properties); + if(blenderContext.getBlenderKey().isLoadObjectProperties()) { + Properties properties = this.loadProperties(curveStructure, blenderContext); + //the loaded property is a group property, so we need to get each value and set it to Spatial + if(result instanceof Spatial && properties != null && properties.getValue() != null) { + this.applyProperties((Spatial) result, properties); } }