- check for animations being present before importing them in ExternalChangeScanner

experimental
Normen Hansen 10 years ago
parent b61656ffaa
commit 5ac1d63bb9
  1. 14
      sdk/jme3-core/src/com/jme3/gde/core/assets/ExternalChangeScanner.java

@ -130,12 +130,14 @@ public class ExternalChangeScanner implements AssetDataPropertyChangeListener, F
Spatial original = loadOriginalSpatial(); Spatial original = loadOriginalSpatial();
Spatial spat = (Spatial) assetDataObject.loadAsset(); Spatial spat = (Spatial) assetDataObject.loadAsset();
SpatialUtil.updateMeshDataFromOriginal(spat, original); SpatialUtil.updateMeshDataFromOriginal(spat, original);
NotifyDescriptor.Confirmation mesg = new NotifyDescriptor.Confirmation("Model appears to have animations, try to import as well?\nCurrently this will unlink attachment Nodes and clear\nadded effects tracks.", if (SpatialUtil.hasAnimations(original)) {
"Animations Available", NotifyDescriptor.Confirmation mesg = new NotifyDescriptor.Confirmation("Model appears to have animations, try to import as well?\nCurrently this will unlink attachment Nodes and clear\nadded effects tracks.",
NotifyDescriptor.YES_NO_OPTION, NotifyDescriptor.QUESTION_MESSAGE); "Animations Available",
DialogDisplayer.getDefault().notify(mesg); NotifyDescriptor.YES_NO_OPTION, NotifyDescriptor.QUESTION_MESSAGE);
if (mesg.getValue() == NotifyDescriptor.Confirmation.YES_OPTION) { DialogDisplayer.getDefault().notify(mesg);
SpatialUtil.updateAnimControlDataFromOriginal(spat, original); if (mesg.getValue() == NotifyDescriptor.Confirmation.YES_OPTION) {
SpatialUtil.updateAnimControlDataFromOriginal(spat, original);
}
} }
closeOriginalSpatial(); closeOriginalSpatial();
assetDataObject.saveAsset(); assetDataObject.saveAsset();

Loading…
Cancel
Save