SDK:
- cleanup offscene panel in model importer when import fails git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@10239 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
This commit is contained in:
parent
c6c50eea31
commit
2ac567a5e5
@ -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) {
|
public void setCamFocus(final Vector3f focus) {
|
||||||
SceneApplication.getApplication().enqueue(new Callable<Object>() {
|
SceneApplication.getApplication().enqueue(new Callable<Object>() {
|
||||||
|
|
||||||
|
@ -59,6 +59,7 @@ public final class ModelImporterVisualPanel3 extends JPanel {
|
|||||||
mainKey = (AssetKey) wiz.getProperty("mainkey");
|
mainKey = (AssetKey) wiz.getProperty("mainkey");
|
||||||
data = (AssetData) wiz.getProperty("assetdata");
|
data = (AssetData) wiz.getProperty("assetdata");
|
||||||
loadModel();
|
loadModel();
|
||||||
|
offPanel.detachAll();
|
||||||
if (currentModel != null) {
|
if (currentModel != null) {
|
||||||
logger.log(Level.INFO, "Attaching model {0}", currentModel);
|
logger.log(Level.INFO, "Attaching model {0}", currentModel);
|
||||||
offPanel.attach(currentModel);
|
offPanel.attach(currentModel);
|
||||||
@ -73,10 +74,7 @@ public final class ModelImporterVisualPanel3 extends JPanel {
|
|||||||
wiz.putProperty("assetlist", assetKeys);
|
wiz.putProperty("assetlist", assetKeys);
|
||||||
wiz.putProperty("failedlist", failedKeys);
|
wiz.putProperty("failedlist", failedKeys);
|
||||||
wiz.putProperty("model", currentModel);
|
wiz.putProperty("model", currentModel);
|
||||||
if (currentModel != null) {
|
offPanel.detachAll();
|
||||||
logger.log(Level.INFO, "Detaching model {0}", currentModel);
|
|
||||||
offPanel.detach(currentModel);
|
|
||||||
}
|
|
||||||
logger.log(Level.INFO, "Stop offview panel");
|
logger.log(Level.INFO, "Stop offview panel");
|
||||||
offPanel.stopPreview();
|
offPanel.stopPreview();
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user