|
|
@ -356,11 +356,11 @@ public class BlenderTool { |
|
|
|
return true; |
|
|
|
return true; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
private static boolean runBlender(final String options, boolean async) { |
|
|
|
private static boolean runBlender(final String file, boolean async) { |
|
|
|
if (!checkBlenderFolders()) { |
|
|
|
if (!checkBlenderFolders()) { |
|
|
|
logger.log(Level.SEVERE, "Could not create blender settings folders!"); |
|
|
|
logger.log(Level.SEVERE, "Could not create blender settings folders!"); |
|
|
|
} |
|
|
|
} |
|
|
|
logger.log(Level.INFO, "Running blender with options {0}", options); |
|
|
|
logger.log(Level.INFO, "Running blender with options {0}", file); |
|
|
|
if (blenderOpened.getAndSet(true)) { |
|
|
|
if (blenderOpened.getAndSet(true)) { |
|
|
|
logger.log(Level.INFO, "Blender seems to be running"); |
|
|
|
logger.log(Level.INFO, "Blender seems to be running"); |
|
|
|
return false; |
|
|
|
return false; |
|
|
@ -379,7 +379,7 @@ public class BlenderTool { |
|
|
|
public void run() { |
|
|
|
public void run() { |
|
|
|
try { |
|
|
|
try { |
|
|
|
String command = exe.getAbsolutePath(); |
|
|
|
String command = exe.getAbsolutePath(); |
|
|
|
ProcessBuilder buildr = new ProcessBuilder(command, options); |
|
|
|
ProcessBuilder buildr = new ProcessBuilder(command, file); |
|
|
|
buildr.directory(getBlenderRootFolder()); |
|
|
|
buildr.directory(getBlenderRootFolder()); |
|
|
|
buildr.environment().put("BLENDER_USER_CONFIG", getConfigEnv()); |
|
|
|
buildr.environment().put("BLENDER_USER_CONFIG", getConfigEnv()); |
|
|
|
buildr.environment().put("BLENDER_SYSTEM_SCRIPTS", getScriptsEnv()); |
|
|
|
buildr.environment().put("BLENDER_SYSTEM_SCRIPTS", getScriptsEnv()); |
|
|
@ -404,6 +404,7 @@ public class BlenderTool { |
|
|
|
java.awt.EventQueue.invokeLater(new Runnable() { |
|
|
|
java.awt.EventQueue.invokeLater(new Runnable() { |
|
|
|
public void run() { |
|
|
|
public void run() { |
|
|
|
mainWin.setState(Frame.NORMAL); |
|
|
|
mainWin.setState(Frame.NORMAL); |
|
|
|
|
|
|
|
mainWin.requestFocus(); |
|
|
|
} |
|
|
|
} |
|
|
|
}); |
|
|
|
}); |
|
|
|
successful.set(false); |
|
|
|
successful.set(false); |
|
|
@ -419,7 +420,7 @@ public class BlenderTool { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public static boolean openInBlender(FileObject file) { |
|
|
|
public static boolean openInBlender(FileObject file) { |
|
|
|
String path = "'" + file.getPath().replace("/", File.separator) + "'"; |
|
|
|
String path = file.getPath().replace("/", File.separator); |
|
|
|
return runBlender(path, true); |
|
|
|
return runBlender(path, true); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|