From 86c873bbb80f75968fb98e3d473e88f4d643ce28 Mon Sep 17 00:00:00 2001 From: "nor..67" Date: Sun, 3 Feb 2013 03:22:46 +0000 Subject: [PATCH] SDK: - fix possible double-attach in external data update git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@10327 75d07b2b-3a1a-0410-a2c5-0572b91ccdca --- .../src/com/jme3/gde/core/util/SpatialUtil.java | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/sdk/jme3-core/src/com/jme3/gde/core/util/SpatialUtil.java b/sdk/jme3-core/src/com/jme3/gde/core/util/SpatialUtil.java index 53830855f..9c503752a 100644 --- a/sdk/jme3-core/src/com/jme3/gde/core/util/SpatialUtil.java +++ b/sdk/jme3-core/src/com/jme3/gde/core/util/SpatialUtil.java @@ -31,6 +31,7 @@ */ package com.jme3.gde.core.util; +import com.jme3.animation.AnimControl; import com.jme3.gde.core.scene.ApplicationLogHandler.LogLevel; import com.jme3.scene.Geometry; import com.jme3.scene.Node; @@ -190,10 +191,12 @@ public class SpatialUtil { * Updates the mesh data of existing objects from an original file, adds new * nonexisting geometry objects to the root, including their parents if they * don't exist. + * * @param root - * @param original + * @param original */ public static void updateMeshDataFromOriginal(final Spatial root, final Spatial original) { + //loop through original to also find new geometry original.depthFirstTraversal(new SceneGraphVisitorAdapter() { @Override public void visit(Geometry geom) { @@ -207,7 +210,6 @@ public class SpatialUtil { } } }); - return; } /** @@ -235,6 +237,7 @@ public class SpatialUtil { leaf.setUserData(ORIGINAL_NAME, leaf.getName()); leaf.setUserData(ORIGINAL_PATH, getSpatialPath(leaf)); logger.log(LogLevel.USERINFO, "Attached Node {0} with leaf {0}", new Object[]{other, leaf}); + return; } else { logger.log(Level.WARNING, "Cannot attach leaf {0} to found spatial {1} in root {2}, not a node.", new Object[]{leaf, other, root}); } @@ -242,7 +245,7 @@ public class SpatialUtil { } public static void clearRemovedOriginals(final Spatial root, final Spatial original) { - //TODO + //TODO: Clear old stuff at all? return; }