- make BlenderTool bail sooner when folder check failed

git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@10296 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
3.0
nor..67 12 years ago
parent 5a7ed536ad
commit d5d9cdded1
  1. 5
      sdk/jme3-blender/src/com/jme3/gde/blender/BlenderTool.java
  2. 2
      sdk/jme3-blender/src/com/jme3/gde/blender/OpenInBlender.java

@ -270,6 +270,7 @@ public class BlenderTool {
public static boolean runConversionScript(String type, FileObject input) {
if (!checkBlenderFolders()) {
logger.log(Level.SEVERE, "Could not create blender settings folders!");
return false;
}
final File exe = getBlenderExecutable();
if (exe == null) {
@ -316,6 +317,7 @@ public class BlenderTool {
public static boolean runToolScript(String toolName, FileObject input) {
if (!checkBlenderFolders()) {
logger.log(Level.SEVERE, "Could not create blender settings folders!");
return false;
}
final File exe = getBlenderExecutable();
if (exe == null) {
@ -359,10 +361,11 @@ public class BlenderTool {
private static boolean runBlender(final String file, boolean async) {
if (!checkBlenderFolders()) {
logger.log(Level.SEVERE, "Could not create blender settings folders!");
return false;
}
logger.log(Level.INFO, "Running blender with options {0}", file);
if (blenderOpened.getAndSet(true)) {
logger.log(Level.INFO, "Blender seems to be running");
logger.log(Level.WARNING, "Blender seems to be running already.");
return false;
}
final AtomicBoolean successful = new AtomicBoolean(true);

@ -37,7 +37,7 @@ public final class OpenInBlender implements ActionListener {
@Override
public void actionPerformed(ActionEvent ev) {
if (!BlenderTool.openInBlender(context.getPrimaryFile())) {
logger.log(LogLevel.WARNING, "Could not open file in blender, already running?");
logger.log(LogLevel.INFO, "Could not open file in blender.");
}
}
}

Loading…
Cancel
Save