Browse Source

- check for animations being present before importing them in ExternalChangeScanner

Normen Hansen 10 years ago
parent
commit
24364e13ce
1 changed files with 8 additions and 6 deletions
  1. 8 6
      jme3-core/src/com/jme3/gde/core/assets/ExternalChangeScanner.java

+ 8 - 6
jme3-core/src/com/jme3/gde/core/assets/ExternalChangeScanner.java

@@ -130,12 +130,14 @@ public class ExternalChangeScanner implements AssetDataPropertyChangeListener, F
             Spatial original = loadOriginalSpatial();
             Spatial spat = (Spatial) assetDataObject.loadAsset();
             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.",
-                    "Animations Available",
-                    NotifyDescriptor.YES_NO_OPTION, NotifyDescriptor.QUESTION_MESSAGE);
-            DialogDisplayer.getDefault().notify(mesg);
-            if (mesg.getValue() == NotifyDescriptor.Confirmation.YES_OPTION) {
-                SpatialUtil.updateAnimControlDataFromOriginal(spat, original);
+            if (SpatialUtil.hasAnimations(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.",
+                        "Animations Available",
+                        NotifyDescriptor.YES_NO_OPTION, NotifyDescriptor.QUESTION_MESSAGE);
+                DialogDisplayer.getDefault().notify(mesg);
+                if (mesg.getValue() == NotifyDescriptor.Confirmation.YES_OPTION) {
+                    SpatialUtil.updateAnimControlDataFromOriginal(spat, original);
+                }
             }
             closeOriginalSpatial();
             assetDataObject.saveAsset();