2
$\begingroup$

When rendering a single frame with F12, the compositing node File Output will always save the render on disk. Is there any way of disabling that, e.g. only save the render to file when rendering with Ctrl+F12.

A few more informations :

  • I'm using the default Output Path or not, depending on the project (sometimes useful to have a pre-comped video as example).
  • The rendered frames are saved with a File Output node in the compositor. Single or multi-layer depending on project.
  • Rendered as image sequences (mostly .png, in that case multiple image sequences are saved)

My workflow being as follow :

  • Use F12 to preview a single frame (never with saving on disk, expect manually in the render window Image > Save As)
  • Use Ctrl+F12 when the animation is ready to be rendered

So it's a bit painful to try previewing a frame with low passes, only to realize that frame has being updated on disk, in the beautiful and slow final render.

Any guidance or better workflow ? Thanks for your time !

$\endgroup$
6
  • 1
    $\begingroup$ You can only mute the file output node. It's possible to replace F12 render with a custom render operator scripted in Python to do that automatically, but other than that there is no functionality for this. $\endgroup$ Commented May 17 at 1:25
  • $\begingroup$ @MartynasŽiemys Thank you ! I've tried a bit of Python, I think this would be too advanced for me. I don't understand why the standard output path and the File Output behave differently about F12 and Ctrl+F12 (surely there is some good reason behind it). I'm opening a bounty, in the hope someone has a real and non-python solution. $\endgroup$
    – Lutzi
    Commented May 20 at 15:07
  • $\begingroup$ There is no non-Python solution. I realise you need it to work the other way, but there are loads of people perfectly fine with it working the way it works. It does have logic to it. If I have an output node, I want it to work every time I render - why wouldn't it?.. $\endgroup$ Commented May 20 at 15:13
  • 1
    $\begingroup$ No, I don't think so - nothing wrong with the workflow, it's just that the functionality for what you want does not exist. You would usually just mute the output nodes if you don't want them to work. I'll see how it goes with Python, maybe it's not that hard. $\endgroup$ Commented May 20 at 15:19
  • 1
    $\begingroup$ In a way, selecting the viewport shading selection of Render Preview is somewhat like what you want, and there are separate settings for your render engine on viewport vs. final F12 render. $\endgroup$
    – james_t
    Commented May 20 at 15:48

1 Answer 1

4
+100
$\begingroup$

You can save this from Blender's text editor(it saves in correct encoding) as a .py file and install this as an add-on:

bl_info = {
    "name": "Render Without Output",
    "author": "Martynas Žiemys",
    "version": (1, 0),
    "blender": (4, 1, 0),
    "location": "Render menu, F12",
    "description": "Renders still without output from compositing",
    "category": "Render",
}

import bpy


class RENDER_OT_no_output(bpy.types.Operator):
    """Render without any output including compositing"""
    bl_idname = "render.render_no_out"
    bl_label = "Render Without Output" 

    def post(self, scene, context):
        tree = scene.node_tree
        for name in scene["node_states"].keys():
            tree.nodes[name].mute = scene["node_states"][name]
        del scene["node_states"] 
        bpy.app.handlers.render_post.clear()       

    def execute(self, context):
        if context.scene.use_nodes:
            tree = context.scene.node_tree
            states = {}
            for node in tree.nodes:
                if node.type == "OUTPUT_FILE":
                    states[node.name] = int(node.mute)
                    node.mute = True
            context.scene["node_states"]= states
            bpy.app.handlers.render_post.append(self.post)
        bpy.ops.render.render('INVOKE_DEFAULT')
        return {'FINISHED'}

def menu_func(self, context):
    self.layout.operator("render.render_no_out",icon = 'RENDER_STILL')
        
addon_keymaps = []

def register():
    bpy.utils.register_class(RENDER_OT_no_output)
    km =  bpy.context.window_manager.keyconfigs['Blender user'].keymaps['Screen']
    for kmi in km.keymap_items: 
        if (kmi.idname == "render.render") and (not kmi.ctrl) and (kmi.type == 'F12'):
            kmi.active = False
    kcfg = bpy.context.window_manager.keyconfigs.addon
    km = kcfg.keymaps.new(name="Window", space_type='EMPTY', region_type='WINDOW')
    kmi = km.keymap_items.new(
        "render.render_no_out", 
        'F12', 'PRESS', 
        any=False, alt=False, ctrl=False, shift=False
        )
    addon_keymaps.append((km, kmi.idname))
    bpy.types.TOPBAR_MT_render.prepend(menu_func)


def unregister():
    for km, kmi_idname in addon_keymaps:
        for kmi in km.keymap_items:
            if kmi.idname == kmi_idname:
                km.keymap_items.remove(kmi)
    addon_keymaps.clear()
    km =  bpy.context.window_manager.keyconfigs['Blender user'].keymaps['Screen']
    for kmi in km.keymap_items: 
            if (kmi.idname == "render.render") and (not kmi.ctrl) and (kmi.type == 'F12'):
                kmi.active = True
                km.keymap_items.update()
    bpy.utils.unregister_class(RENDER_OT_no_output)
    bpy.types.TOPBAR_MT_render.remove(menu_func)

This will add a new Render Without Output item in the Render menu and switch F12 hotkey to it:

enter image description here

It mutes all output nodes in compositing and restores them after render.

Might have bugs though. :D

$\endgroup$
6
  • $\begingroup$ Thank you, really appreciate your answer ! If I'm understanding correctly : it switches off any File Output node during a F12 render, and switches back them on after ? What happens if I have File Output already off for some reason ? What happens to other non-File Output nodes (just to be sure) ? $\endgroup$
    – Lutzi
    Commented May 24 at 11:50
  • $\begingroup$ It only affects File Output nodes. It saves the states(muted or not) of all of them, then mutes all File Output nodes, renders and after render restores the states of all File Output nodes so the ones that were muted before remain that way. $\endgroup$ Commented May 24 at 11:53
  • $\begingroup$ OK, so it's not very logical. :D Thinking about it now, I could have saved only the nodes that needed to be muted to restore them. Well, it works anyway. $\endgroup$ Commented May 24 at 12:02
  • $\begingroup$ Thanks for the precision. I'll try it soon. Thanks again :) $\endgroup$
    – Lutzi
    Commented May 24 at 13:53
  • $\begingroup$ @Lutzi Did you try it? Did it work for you? $\endgroup$ Commented Jun 1 at 22:59

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .