- 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
This commit is contained in:
parent
38c9b14350
commit
4bbadc5ecf
@ -76,10 +76,12 @@ public final class ModelImporterVisualPanel1 extends JPanel implements AssetEven
|
|||||||
}
|
}
|
||||||
|
|
||||||
public synchronized void loadModel(File path, AssetKey modelKey) {
|
public synchronized void loadModel(File path, AssetKey modelKey) {
|
||||||
try {
|
|
||||||
ProjectAssetManager manager = new ProjectAssetManager(FileUtil.toFileObject(path).getParent());
|
ProjectAssetManager manager = new ProjectAssetManager(FileUtil.toFileObject(path).getParent());
|
||||||
manager.setAssetEventListener(this);
|
manager.setAssetEventListener(this);
|
||||||
|
try {
|
||||||
|
if (modelKey != mainKey) {
|
||||||
requestedAssets.clear();
|
requestedAssets.clear();
|
||||||
|
}
|
||||||
if (currentModel != null) {
|
if (currentModel != null) {
|
||||||
offPanel.detach(currentModel);
|
offPanel.detach(currentModel);
|
||||||
currentModel = null;
|
currentModel = null;
|
||||||
@ -109,8 +111,6 @@ public final class ModelImporterVisualPanel1 extends JPanel implements AssetEven
|
|||||||
NotifyDescriptor.ERROR_MESSAGE);
|
NotifyDescriptor.ERROR_MESSAGE);
|
||||||
DialogDisplayer.getDefault().notifyLater(msg);
|
DialogDisplayer.getDefault().notifyLater(msg);
|
||||||
}
|
}
|
||||||
manager.setAssetEventListener(null);
|
|
||||||
manager.clearCache();
|
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
Message msg = new NotifyDescriptor.Message(
|
Message msg = new NotifyDescriptor.Message(
|
||||||
"Error importing file!\n"
|
"Error importing file!\n"
|
||||||
@ -119,6 +119,8 @@ public final class ModelImporterVisualPanel1 extends JPanel implements AssetEven
|
|||||||
DialogDisplayer.getDefault().notifyLater(msg);
|
DialogDisplayer.getDefault().notifyLater(msg);
|
||||||
Exceptions.printStackTrace(e);
|
Exceptions.printStackTrace(e);
|
||||||
}
|
}
|
||||||
|
manager.setAssetEventListener(null);
|
||||||
|
manager.clearCache();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void updateProperties(final AssetKey key) {
|
private void updateProperties(final AssetKey key) {
|
||||||
@ -140,9 +142,11 @@ public final class ModelImporterVisualPanel1 extends JPanel implements AssetEven
|
|||||||
&& !"glsllib".equalsIgnoreCase(ak.getExtension())
|
&& !"glsllib".equalsIgnoreCase(ak.getExtension())
|
||||||
&& !"frag".equalsIgnoreCase(ak.getExtension())
|
&& !"frag".equalsIgnoreCase(ak.getExtension())
|
||||||
&& !"vert".equalsIgnoreCase(ak.getExtension())) {
|
&& !"vert".equalsIgnoreCase(ak.getExtension())) {
|
||||||
|
if (!requestedAssets.contains(ak)) {
|
||||||
requestedAssets.add(ak);
|
requestedAssets.add(ak);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public void assetLoaded(AssetKey ak) {
|
public void assetLoaded(AssetKey ak) {
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user