diff --git a/README.md b/README.md index 2bd1402..790e958 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,5 @@ -# VF-BlenderAutoSaveRender +# VF Auto Save Render + Automatically saves a numbered or dated image after every render. This Blender Add-on is designed to make test renders easier to review, saving what would otherwise be lost when quitting the app. It's also good for creating a progression timelapse after a project is complete, or naming rendered files with the currently selected object or other custom settings. ![screenshot of Blender's Render Output user interface with the add-on installed](images/screenshot.jpg) @@ -34,7 +35,7 @@ Project settings are found at the bottom of the Render Output panel and are uniq - This uses the name of the blender file and the local date and time (formatted YYYY-MM-DD HH-MM-SS using 24 hour time) - `Project Name + Render Engine + Render Time` - This uses the name of the blender file, the name of the render engine, and the time it took to render - - If a sequence is rendered, only the final frame will be saved and this value will be the total sequence render time, not the per-frame render time + - When a sequence is rendered, only the final frame will be saved and this value will be the total sequence render time, not the per-frame render time - `Custom String` - This uses pattern replacement to allow for entirely unique file naming patterns - Supported variables: @@ -61,9 +62,11 @@ _Warning_: using a custom string may result in overwriting files or failing to s ### Total Time Spent Rendering -- This simply displays the total number of hours, minutes, and seconds spent rendering the current project, and must be enabled in the Add-on Preferences (see above) +- This tracks the total number of hours, minutes, and seconds spent rendering the current project, and the output panel display can be turned on in the Add-on Preferences (see above) ## Notes -- Auto Save Render depends on the Blender file having been saved at least once, otherwise there is no project name or directory for the Add-on to work with -- Auto Save Render will only save the final frame when rendering sequences, preventing mass dupliation, but still allowing for total render time to be saved \ No newline at end of file +- Auto Save Render depends on the Blender file having been saved at least once in order to save images, otherwise there is no project name or directory for the Add-on to work with +- Only the final frame will be atuo saved when rendering sequences, preventing mass dupliation but still allowing for total render time to be saved in the file name (depending on settings) +- Total render time will continue to increment even when auto file saving is toggled off in the output panel +- Total render time will _not_ increment when rendering files from the command line, since it depends on being saved within the project file (and rendering from the command line typically doesn't save the project file after rendering finishes) \ No newline at end of file diff --git a/VF_auto_save_render.py b/VF_autoSaveRender.py similarity index 97% rename from VF_auto_save_render.py rename to VF_autoSaveRender.py index 58c181f..c047c62 100644 --- a/VF_auto_save_render.py +++ b/VF_autoSaveRender.py @@ -1,7 +1,7 @@ bl_info = { "name": "VF Auto Save Render", "author": "John Einselen - Vectorform LLC, based on work by tstscr(florianfelix)", - "version": (1, 4), + "version": (1, 4, 1), "blender": (2, 80, 0), "location": "Rendertab > Output Panel > Subpanel", "description": "Automatically saves rendered images with custom naming convention", @@ -59,15 +59,15 @@ @persistent def auto_save_render(scene): - if not bpy.context.scene.auto_save_render_settings.enable_auto_save_render or not bpy.data.filepath: - return - # Calculate elapsed render time render_time = round(time.time() - float(bpy.context.scene.auto_save_render_settings.start_date), 2) # Update total render time bpy.context.scene.auto_save_render_settings.total_render_time = bpy.context.scene.auto_save_render_settings.total_render_time + render_time + if not bpy.context.scene.auto_save_render_settings.enable_auto_save_render or not bpy.data.filepath: + return {'CANCELLED'} + # Save original file format settings original_format = scene.render.image_settings.file_format original_colormode = scene.render.image_settings.color_mode @@ -171,6 +171,8 @@ def save_number_from_files(files): scene.render.image_settings.color_mode = original_colormode scene.render.image_settings.color_depth = original_colordepth + return {'FINISHED'} + ########################################################################### # Start time function @@ -226,7 +228,7 @@ def draw(self, context): # layout.label(text="Addon Default Preferences") grid = layout.grid_flow(row_major=True) grid.prop(self, "show_total_render_time") - if bpy.context.preferences.addons['VF_auto_save_render'].preferences.show_total_render_time: + if bpy.context.preferences.addons['VF_autoSaveRender'].preferences.show_total_render_time: grid.prop(context.scene.auto_save_render_settings, 'total_render_time') # layout.prop(self, 'default_file_name_custom') @@ -310,14 +312,14 @@ def draw(self, context): if bpy.context.scene.auto_save_render_settings.file_name_type == 'CUSTOM': # this is intended as a semi-hacky way to override the initial custom string with a global preset instead of relying on get/set # if '{unset}' in bpy.context.scene.auto_save_render_settings.file_name_custom: - # bpy.context.scene.auto_save_render_settings.file_name_custom = bpy.context.preferences.addons['VF_auto_save_render'].preferences.default_file_name_custom + # bpy.context.scene.auto_save_render_settings.file_name_custom = bpy.context.preferences.addons['VF_autoSaveRender'].preferences.default_file_name_custom layout.use_property_split = True layout.prop(context.scene.auto_save_render_settings, 'file_name_custom') if '{serial}' in bpy.context.scene.auto_save_render_settings.file_name_custom: layout.use_property_split = True layout.prop(context.scene.auto_save_render_settings, 'file_name_serial') layout.prop(context.scene.auto_save_render_settings, 'file_format', icon='FILE_IMAGE') - if bpy.context.preferences.addons['VF_auto_save_render'].preferences.show_total_render_time: + if bpy.context.preferences.addons['VF_autoSaveRender'].preferences.show_total_render_time: box = layout.box() box.label(text="Total time spent rendering: "+secondsToReadable(bpy.context.scene.auto_save_render_settings.total_render_time))