2
$\begingroup$

I'm always working with big images (> 4K) and very often I use the % Resolution to make quick renders with the original proportion to progressively see the results/issues of the render. Unfortunately, there's no option to add this slider to the Quick Preferences (Q), and I have to adjust this value manually.

enter image description here

Are there other ways to quickly change this value without going to the Output Properties every time?

$\endgroup$

1 Answer 1

4
$\begingroup$

There is a way to assign this action to a shortcut. Head to the Scripting tab (or open a Text Editor view) and paste this script:

bl_info = {
    "name": "Quick Render",
    "category": "Rendering",
}

import bpy

class QuickRender(bpy.types.Operator):
    bl_idname = "quick.render"
    bl_label  = "Quick render"
    bl_options = {'REGISTER'}

    def execute(self, context):
        # setup quick render settings and kick off render
        old_percentage = context.scene.render.resolution_percentage
        context.scene.render.resolution_percentage = 50
        bpy.ops.render.render('INVOKE_DEFAULT')
        # restore old render settings
        context.scene.render.resolution_percentage = old_percentage
        return {'FINISHED'}

addon_keymaps = []

def register():
    bpy.utils.register_class(QuickRender)
    wm = bpy.context.window_manager
    # setup where to run the shortcut
    km = wm.keyconfigs.addon.keymaps.new(name='Object Mode', space_type='EMPTY')
    # setup the shortcut key
    kmi = km.keymap_items.new(QuickRender.bl_idname, 'R', 'PRESS', alt=True)
    addon_keymaps.append(km)

def unregister():
    bpy.utils.unregister_class(QuickRender)
    wm = bpy.context.window_manager
    for km in addon_keymaps:
        wm.keyconfigs.addon.keymaps.remove(km)
    del addon_keymaps[:]

if __name__ == '__main__':
    register()

Running the script will enable Alt+R in the 3D view which starts a render with 50% resolution. Look at the comments in the code if you want to change the shortcut details. You can also register the script, so you don't need to run it everytime you open up your project:

enter image description here

I have adopted the code from the Blender addon tutorial. How to setup the shortcut is here and the render call here.

$\endgroup$
3
  • $\begingroup$ I accepted the answer, because it does facilitate the change of the resolution percentage. The only thing is that the resolution is now changed to the new value defined, and I have to go back to the Output Properties if I want to change the value to another one. I believe that now it is just a new thing that I have to append to your script. Thanks for helping! $\endgroup$ Oct 10, 2023 at 15:21
  • $\begingroup$ The script just changes the percentage for rendering, but restores the old setting. I don't know if it's possible to have a "shortcut slider". You could extend the script with multiple shortcuts for different percentages (like Alt+1, Alt+2 etc.). If the shortcut slider is not possible yet, you could make a feature request to the Blender team blender.stackexchange.com/questions/1190/… $\endgroup$
    – taiyo
    Oct 10, 2023 at 15:29
  • $\begingroup$ You're right about restoring the old settings! I may have done something wrong or edited it somewhere not needed. $\endgroup$ Oct 10, 2023 at 15:34

You must log in to answer this question.

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