From c8f1375eccad7629d731ee0d76eb3776153f8fb9 Mon Sep 17 00:00:00 2001 From: "nor..67" Date: Mon, 28 Jan 2013 00:31:39 +0000 Subject: [PATCH] SDK: - Model Import Tool: add workaround for strange issue where manually located assets do not get reported by the AssetManager locate asset callback.. git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@10213 75d07b2b-3a1a-0410-a2c5-0572b91ccdca --- .../gde/modelimporter/ModelImporterVisualPanel3.java | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/sdk/jme3-model-importer/src/com/jme3/gde/modelimporter/ModelImporterVisualPanel3.java b/sdk/jme3-model-importer/src/com/jme3/gde/modelimporter/ModelImporterVisualPanel3.java index fdcf3b02f..a70c13786 100644 --- a/sdk/jme3-model-importer/src/com/jme3/gde/modelimporter/ModelImporterVisualPanel3.java +++ b/sdk/jme3-model-importer/src/com/jme3/gde/modelimporter/ModelImporterVisualPanel3.java @@ -10,6 +10,7 @@ import com.jme3.gde.core.assets.ProjectAssetManager; import com.jme3.gde.core.scene.OffScenePanel; import com.jme3.math.Vector3f; import com.jme3.scene.Spatial; +import java.util.Iterator; import java.util.List; import java.util.logging.Logger; import java.util.logging.Level; @@ -95,6 +96,16 @@ public final class ModelImporterVisualPanel3 extends JPanel { assetKeys = data.getAssetKeyList(); failedKeys = data.getFailedList(); assets = data.getAssetList(); + //TODO:workaround for manually found assets not being added for some reason... + //Should be reported in located assets callback of assetmanager.. + for (Iterator it = UberAssetLocator.getLocatedList().iterator(); it.hasNext();) { + logger.log(Level.WARNING, "Applying workaround, adding manually located assets to asset success list!"); + UberAssetLocator.UberAssetInfo uberAssetInfo = it.next(); + if(!assetKeys.contains(uberAssetInfo.getKey())){ + assetKeys.add(uberAssetInfo.getKey()); + assets.add(uberAssetInfo.getFileObject()); + } + } jList1.setListData(assetKeys.toArray()); jList2.setListData(failedKeys.toArray()); if (failedKeys.size() > 0) {