|
|
|
@ -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) { |
|
|
|
|
} |
|
|
|
|