- fix empty asset list in ModelImportTool when reloading model with key settings

git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@8436 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
3.0
nor..67 13 years ago
parent 38c9b14350
commit 4bbadc5ecf
  1. 10
      sdk/jme3-model-importer/src/com/jme3/gde/modelimporter/ModelImporterVisualPanel1.java

@ -76,10 +76,12 @@ public final class ModelImporterVisualPanel1 extends JPanel implements AssetEven
}
public synchronized void loadModel(File path, AssetKey modelKey) {
try {
ProjectAssetManager manager = new ProjectAssetManager(FileUtil.toFileObject(path).getParent());
manager.setAssetEventListener(this);
try {
if (modelKey != mainKey) {
requestedAssets.clear();
}
if (currentModel != null) {
offPanel.detach(currentModel);
currentModel = null;
@ -109,8 +111,6 @@ public final class ModelImporterVisualPanel1 extends JPanel implements AssetEven
NotifyDescriptor.ERROR_MESSAGE);
DialogDisplayer.getDefault().notifyLater(msg);
}
manager.setAssetEventListener(null);
manager.clearCache();
} catch (Exception e) {
Message msg = new NotifyDescriptor.Message(
"Error importing file!\n"
@ -119,6 +119,8 @@ public final class ModelImporterVisualPanel1 extends JPanel implements AssetEven
DialogDisplayer.getDefault().notifyLater(msg);
Exceptions.printStackTrace(e);
}
manager.setAssetEventListener(null);
manager.clearCache();
}
private void updateProperties(final AssetKey key) {
@ -140,9 +142,11 @@ public final class ModelImporterVisualPanel1 extends JPanel implements AssetEven
&& !"glsllib".equalsIgnoreCase(ak.getExtension())
&& !"frag".equalsIgnoreCase(ak.getExtension())
&& !"vert".equalsIgnoreCase(ak.getExtension())) {
if (!requestedAssets.contains(ak)) {
requestedAssets.add(ak);
}
}
}
public void assetLoaded(AssetKey ak) {
}

Loading…
Cancel
Save