# Is the screenshot dialog part of a python script?

Someone just asked whether it would be possible to change the default for an export script. I rightclicked the button>>Edit Source and got this instructive message:

"Active Button is not from a script, cannot edit source."

And I thought to myself... hm... yeah... bull...

So I found the script because I already knew where to look and answered the question, hopefully satisfactorily.

It so happens that I post the occasional screenshot in here and it's almost always just a region, not the whole window.

Could above message be wrong again?

Is it possible that the screenshot dialog has some python code hidden deep wthin the installation bowels where I can turn True into False, so "full Screen" doesn't bother me anymore?

If yes, where would it be? My motivation to compile from source is somewhat limited.

• I don't think it is. Similarly, the bevel and crease sliders in the properties panel also have no raw python code. They are hardcoded in C. The screenshot dialog is also probably hardcoded. But it is possible recreate it ( I have no idea how) since the bevel and crease panel was recreated. – Retrax Feb 20 '18 at 7:10
• This one? I already knew where to look and answered the question, hopefully satisfactorily Possibly the easiest way to make screenshot_full = False the default is to edit the ctrl-F3 hotkey, and uncheck it there. – batFINGER Feb 20 '18 at 8:13
• I "recreate it" by external means, placing a shortcut to a screenshot app on my toolbar. – Doyousketch2 Feb 20 '18 at 11:01
• @batFINGER why waste an amazingly cool answer on a mere comment? I had no idea all these settings were hidden in the shortcuts. – Haunt_House Feb 20 '18 at 11:13
• This question (particularly the title) feels a bit like an 'asking about y instead of x' case. I suggest editing this question slightly to focus on the actual problem (how to customise the screenshot tool) instead of asking about what you think is the solution to your problem (finding out whether the dialog is part of a python script). At the minute, people will be unlikely to find the answer below via searching based on the current title (and body). – Ray Mairlot Feb 20 '18 at 14:59

Set default settings in the shortcut.

As a workaround to editing scripts, set the properties in the shortcut. As long as the operator is invoked using the shortcut, the new settings will be used.

For screenshot the default shortcut is CtrlF3

Edit settings from User Preferences > Input > Screen > Save Screenshot Uncheck "Full Screen" setting on the keymap editor.

A "helper" operator

Alternatively, can write a simple helper operator with the settings you want already set. For example having to type in the filename each time. Sample script below saves screenshot into a folder of your choosing and simply timestamps the filename. Change screen.screenshot to screen.area_screeny in keyset above and not have to bother with invoking the file select dialog. The script is based on scripting > templates > python > operator simple

import bpy

def main(context):
from os import path
from datetime import datetime
directory = "/home/batfinger/Pictures/"
filename = "Blender%s.png" % str(datetime.now())
filepath = path.join(directory, filename)
bpy.ops.screen.screenshot(filepath=filepath, full=False)

class SimpleOperator(bpy.types.Operator):
"""Tooltip"""
bl_idname = "screen.area_screeny"
bl_label = "Area Screeny"

@classmethod
def poll(cls, context):
return True

def execute(self, context):
main(context)
return {'FINISHED'}

def register():
bpy.utils.register_class(SimpleOperator)

def unregister():
bpy.utils.unregister_class(SimpleOperator)

if __name__ == "__main__":
register()

# test call
bpy.ops.screen.area_screeny()


Note: edit the directory above to suit.

• Dear Blender, having all the settings greyed out is a peculiar way of telling me that I can click them, – Haunt_House Feb 20 '18 at 11:57