Merge branch 'add_env' into 'master'

Add more ENV variables and cleanup order

See merge request sheepitrenderfarm/client!278
This commit is contained in:
Sheepit Renderfarm
2023-12-08 09:58:02 +00:00

View File

@@ -219,19 +219,24 @@ import java.util.regex.Pattern;
Map<String, String> new_env = new HashMap<>();
new_env.put("TEMP", configuration.getWorkingDirectory().getAbsolutePath().replace("\\", "\\\\"));
new_env.put("TMP", configuration.getWorkingDirectory().getAbsolutePath().replace("\\", "\\\\"));
new_env.put("CORES", Integer.toString(configuration.getNbCores()));
new_env.put("PRIORITY", Integer.toString(configuration.getPriority()));
//make sure the system doesn´t interfere with the blender runtime, and that blender doesn´t attempt to load external libraries/scripts.
new_env.put("BLENDER_USER_RESOURCES", "");
new_env.put("BLENDER_USER_CONFIG", "");
new_env.put("BLENDER_USER_SCRIPTS", "");
new_env.put("BLENDER_SYSTEM_SCRIPTS", "");
new_env.put("BLENDER_USER_DATAFILES", "");
new_env.put("BLENDER_SYSTEM_RESOURCES", "");
new_env.put("BLENDER_SYSTEM_SCRIPTS", "");
new_env.put("BLENDER_SYSTEM_DATAFILES", "");
new_env.put("BLENDER_SYSTEM_PYTHON", "");
new_env.put("OCIO", ""); //prevent blender from loading a non-standard color configuration
new_env.put("TEMP", configuration.getWorkingDirectory().getAbsolutePath().replace("\\", "\\\\"));
new_env.put("TMP", configuration.getWorkingDirectory().getAbsolutePath().replace("\\", "\\\\"));
new_env.put("CORES", Integer.toString(configuration.getNbCores()));
new_env.put("PRIORITY", Integer.toString(configuration.getPriority()));
// Add own lib folder first, because Steam or other environments may set an LD_LIBRARY_PATH that has priority over the runpath in the Blender excutable,
// but contains incompatible libraries.
String currentLDLibraryPath = Optional.ofNullable(System.getenv("LD_LIBRARY_PATH")).orElse("");