- cleanup offscene panel in model importer when import fails

git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@10239 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
3.0
nor..67 12 years ago
parent c6c50eea31
commit 2ac567a5e5
  1. 14
      sdk/jme3-core/src/com/jme3/gde/core/scene/OffScenePanel.java
  2. 6
      sdk/jme3-model-importer/src/com/jme3/gde/modelimporter/ModelImporterVisualPanel3.java

@ -307,6 +307,20 @@ public class OffScenePanel extends javax.swing.JPanel implements SceneProcessor
});
}
/**
* threadsafe detach from root node
* @param spat
*/
public void detachAll() {
SceneApplication.getApplication().enqueue(new Callable<Object>() {
public Object call() throws Exception {
rootNode.detachAllChildren();
return null;
}
});
}
public void setCamFocus(final Vector3f focus) {
SceneApplication.getApplication().enqueue(new Callable<Object>() {

@ -59,6 +59,7 @@ public final class ModelImporterVisualPanel3 extends JPanel {
mainKey = (AssetKey) wiz.getProperty("mainkey");
data = (AssetData) wiz.getProperty("assetdata");
loadModel();
offPanel.detachAll();
if (currentModel != null) {
logger.log(Level.INFO, "Attaching model {0}", currentModel);
offPanel.attach(currentModel);
@ -73,10 +74,7 @@ public final class ModelImporterVisualPanel3 extends JPanel {
wiz.putProperty("assetlist", assetKeys);
wiz.putProperty("failedlist", failedKeys);
wiz.putProperty("model", currentModel);
if (currentModel != null) {
logger.log(Level.INFO, "Detaching model {0}", currentModel);
offPanel.detach(currentModel);
}
offPanel.detachAll();
logger.log(Level.INFO, "Stop offview panel");
offPanel.stopPreview();
}

Loading…
Cancel
Save