Add a print after blend file loading
This commit is contained in:
@@ -55,6 +55,7 @@ import java.util.regex.Pattern;
|
|||||||
@Data public class Job {
|
@Data public class Job {
|
||||||
public static final String UPDATE_METHOD_BY_REMAINING_TIME = "remainingtime";
|
public static final String UPDATE_METHOD_BY_REMAINING_TIME = "remainingtime";
|
||||||
public static final String UPDATE_METHOD_BY_TILE = "by_tile";
|
public static final String UPDATE_METHOD_BY_TILE = "by_tile";
|
||||||
|
public static final String POST_LOAD_NOTIFICATION = "POST_LOAD_SCRIPT_loaded";
|
||||||
|
|
||||||
public static final int SHOW_BASE_ICON = -1;
|
public static final int SHOW_BASE_ICON = -1;
|
||||||
|
|
||||||
@@ -234,7 +235,7 @@ import java.util.regex.Pattern;
|
|||||||
command.add("-P");
|
command.add("-P");
|
||||||
|
|
||||||
try {
|
try {
|
||||||
disableViewportScript = File.createTempFile("optimize_viewport_script_", ".py", configuration.getWorkingDirectory());
|
disableViewportScript = File.createTempFile("pre_load_script_", ".py", configuration.getWorkingDirectory());
|
||||||
File file = new File(disableViewportScript.getAbsolutePath());
|
File file = new File(disableViewportScript.getAbsolutePath());
|
||||||
FileWriter fwriter;
|
FileWriter fwriter;
|
||||||
fwriter = new FileWriter(file);
|
fwriter = new FileWriter(file);
|
||||||
@@ -242,17 +243,21 @@ import java.util.regex.Pattern;
|
|||||||
PrintWriter out = new PrintWriter(fwriter);
|
PrintWriter out = new PrintWriter(fwriter);
|
||||||
out.write("import bpy");
|
out.write("import bpy");
|
||||||
out.write("\n");
|
out.write("\n");
|
||||||
|
out.write("import sys");
|
||||||
|
out.write("\n");
|
||||||
out.write("from bpy.app.handlers import persistent");
|
out.write("from bpy.app.handlers import persistent");
|
||||||
out.write("\n");
|
out.write("\n");
|
||||||
out.write("@persistent");
|
out.write("@persistent");
|
||||||
out.write("\n");
|
out.write("\n");
|
||||||
out.write("def hide_stuff(dummy):");
|
out.write("def hide_stuff(hide_dummy):");
|
||||||
out.write("\n");
|
out.write("\n");
|
||||||
out.write("#Hide collections in the viewport");
|
out.write(" print('PRE_LOAD_SCRIPT_hide_viewport')");
|
||||||
|
out.write("\n");
|
||||||
|
out.write(" #Hide collections in the viewport");
|
||||||
out.write("\n");
|
out.write("\n");
|
||||||
out.write(" for col in bpy.data.collections:");
|
out.write(" for col in bpy.data.collections:");
|
||||||
out.write("\n");
|
out.write("\n");
|
||||||
out.write("\n col.hide_viewport = True");
|
out.write(" col.hide_viewport = True");
|
||||||
out.write("\n");
|
out.write("\n");
|
||||||
out.write(" for obj in bpy.data.objects:");
|
out.write(" for obj in bpy.data.objects:");
|
||||||
out.write("\n");
|
out.write("\n");
|
||||||
@@ -266,6 +271,8 @@ import java.util.regex.Pattern;
|
|||||||
out.write("\n");
|
out.write("\n");
|
||||||
out.write(" mod.show_viewport = False");
|
out.write(" mod.show_viewport = False");
|
||||||
out.write("\n");
|
out.write("\n");
|
||||||
|
out.write(" sys.stdout.flush()");
|
||||||
|
out.write("\n");
|
||||||
out.write("bpy.app.handlers.version_update.append(hide_stuff)");
|
out.write("bpy.app.handlers.version_update.append(hide_stuff)");
|
||||||
out.write("\n");
|
out.write("\n");
|
||||||
out.close();
|
out.close();
|
||||||
@@ -286,7 +293,7 @@ import java.util.regex.Pattern;
|
|||||||
command.add("-P");
|
command.add("-P");
|
||||||
|
|
||||||
try {
|
try {
|
||||||
script_file = File.createTempFile("script_", ".py", configuration.getWorkingDirectory());
|
script_file = File.createTempFile("post_load_script_", ".py", configuration.getWorkingDirectory());
|
||||||
File file = new File(script_file.getAbsolutePath());
|
File file = new File(script_file.getAbsolutePath());
|
||||||
FileWriter txt;
|
FileWriter txt;
|
||||||
txt = new FileWriter(file);
|
txt = new FileWriter(file);
|
||||||
@@ -294,6 +301,12 @@ import java.util.regex.Pattern;
|
|||||||
PrintWriter out = new PrintWriter(txt);
|
PrintWriter out = new PrintWriter(txt);
|
||||||
out.write(getScript());
|
out.write(getScript());
|
||||||
out.write("\n");
|
out.write("\n");
|
||||||
|
out.write("import sys");
|
||||||
|
out.write("\n");
|
||||||
|
out.write("print('" + POST_LOAD_NOTIFICATION + "')");
|
||||||
|
out.write("\n");
|
||||||
|
out.write("sys.stdout.flush()");
|
||||||
|
out.write("\n");
|
||||||
out.write(core_script); // GPU part
|
out.write(core_script); // GPU part
|
||||||
out.write("\n"); // GPU part
|
out.write("\n"); // GPU part
|
||||||
out.close();
|
out.close();
|
||||||
@@ -374,7 +387,7 @@ import java.util.regex.Pattern;
|
|||||||
int progress = -1;
|
int progress = -1;
|
||||||
|
|
||||||
Pattern progressPattern = Pattern.compile(" (Rendered|Path Tracing Tile|Rendering|Sample) (\\d+)\\s?\\/\\s?(\\d+)( Tiles| samples|,)*");
|
Pattern progressPattern = Pattern.compile(" (Rendered|Path Tracing Tile|Rendering|Sample) (\\d+)\\s?\\/\\s?(\\d+)( Tiles| samples|,)*");
|
||||||
Pattern beginScenePrepPattern = Pattern.compile("Read blend:");
|
Pattern beginScenePrepPattern = Pattern.compile(POST_LOAD_NOTIFICATION);
|
||||||
Pattern beginPostProcessingPattern = Pattern.compile("^Fra:\\d* \\w*(.)* \\| (Compositing|Denoising)");
|
Pattern beginPostProcessingPattern = Pattern.compile("^Fra:\\d* \\w*(.)* \\| (Compositing|Denoising)");
|
||||||
Instant timeStamp = null;
|
Instant timeStamp = null;
|
||||||
Duration phaseDuration; //We divide the job into 3 phases: preparation, rendering, compositing
|
Duration phaseDuration; //We divide the job into 3 phases: preparation, rendering, compositing
|
||||||
|
|||||||
Reference in New Issue
Block a user