User:Aligorith/Scripts/my settings

Script to be run in Blender to apply all the default settings I'm used to working with in my default configuration.

This was created after having to reapply all my settings every other day during Blender 2.8 development, due to frequent breaking changes occurring with themes and UI layouts. I really should have created this sooner!

Usage
Example Usage:

Substitute the path to  to where you've saved it on disk.

Script

 * 1) Apply all my standard customisations to a new Blender install
 * 2) Author: Aligorith
 * 3) Date: July 2018
 * 4) Versions: 2.7x/2.8
 * 1) Versions: 2.7x/2.8

import bpy import os

C = bpy.context
 * 1) Context

version = bpy.app.version version_string = "%s.%s" % (version[0], version[1])
 * 1) Version - 2.8 or 2.7?

is_b28 = (version[0] == 2) and (version[1] >= 80)

if os.name == 'nt': # Windows USER_SETTINGS_PATH = "~\\AppData\\Roaming\\Blender Foundation\\Blender\\%s\\" % (version_string) else: # Linux (or maybe Mac too), but assume it's Linux USER_SETTINGS_PATH = "~/.config/blender/%s/" % (version_string)
 * 1) Determine user-settings directory
 * 2) NOTE: Macs are not supported, and will not be supported.

USER_SETTINGS_DIR = os.path.expanduser(USER_SETTINGS_PATH)

U = C.user_preferences
 * 1) User Preferences ===============================

U.view.use_quit_dialog = False
 * 1) Show Quit Dialog - Off   --> This is really annoying when testing

U.view.show_tooltips_python = True
 * 1) Show Python tooltips - On  --> As a dev, it's important to show them

U.view.ui_scale = 1.1
 * 1) UI Scale - 1.1 to make it easier to see things

if hasattr(U.view, "mini_axis_type"): U.view.mini_axis_type = 'MINIMAL' elif hasattr(U.view, "show_manipulator_navigate"): U.view.show_manipulator_navigate = False else: print("Bulky navigate manipulator skipped")
 * 1) Navigate Manipulator (2.8 only) --> Gets in the way



U.edit.fcurve_unselected_alpha = 0.82
 * 1) FCurve Visibility --> Bump up the visibility to make them easier to work with

U.edit.use_insertkey_xyz_to_rgb = False
 * 1) XYZ to RGB --> Off, since the (old/2.5) theme colors for axes are bad

U.edit.use_negative_frames = True
 * 1) Use Negative Frames --> On - It's so much more convenient to be able to do it!

if not is_b28: U.edit.grease_pencil_default_color = (0.497, 0.735, 0.167, 0.9)
 * 1) GP Default Color --> Green


 * 1) Sculpt Paint Overlay Color -> XXX: Black is not good
 * 2) U.edit.sculpt_paint_overlay_color = (...)



U.inputs.view_rotate_method = 'TURNTABLE'
 * 1) Turntable Orbit - Set this in case someone changes it in future!

U.inputs.invert_zoom_wheel = True
 * 1) Invert mousewheel direction -> it feels more natural to push/pull the view
 * 2) towards/away from yourself, instead of adjusting the "zoom level"



U.system.use_scripts_auto_execute = True
 * 1) Auto-Run Python Scripts ->  Blender rigs are useless without this!

U.filepaths.temporary_directory = "/tmp/"
 * 1) Reset "temp" dir to be reusable

U.filepaths.save_version = 1
 * 1) Only save a single old version of the file
 * 2) XXX: This is the default... don't need more for now

U.filepaths.use_auto_save_temporary_files = False
 * 1) Don't autosave files -> Wastes too much diskspace, when you have a habit of saving anyway

U.filepaths.recent_files = 25
 * 1) Bump up the number of recent files -> Makes it easy to keep all your testfiles handy



U.system.multi_sample = '4'
 * 1) Enable multisampling -> for nicer looking lines


 * 1) Theme Tweaks ===================================

theme = U.themes[0]
 * 1) Default Theme

if is_b28: theme.user_interface.icon_saturation = 1.0
 * 1) Icon Saturation --> Full... Desaturated is UGLY!


 * 1) Keymaps ========================================

wm = C.window_manager kc = wm.keyconfigs.user

if is_b28: km = kc.keymaps['Window'] idx = km.keymap_items.find("wm.doc_view_manual_ui_context") if idx != -1: kmi = km.keymap_items[idx] km.keymap_items.remove(kmi) kmi = km.keymap_items.new('wm.open_mainfile', 'F1', 'PRESS')
 * 1) Open File - F1
 * 2) NOTE: Replaces the useless "open manual" command


 * 1) Save File - Ctrl-W   (Note: Less essential... can stick with Ctrl-S)
 * 2) km = kc.keymaps['Window']


 * 1) Search - ???


 * 1) (Play - Spacebar)


 * 1) Default Settings ===============================

scene = C.scene
 * 1) Active Scene

scene.render.filepath = "//render/"
 * 1) Don't save to /tmp/, especailly not on windows!

scene.render.resolution_percentage = 75
 * 1) Reduced resolution

scene.render.image_settings.compression = 90
 * 1) Set higher compression


 * 1) Viewport/Editor Settings ========================


 * 1) 3D View
 * 2)   - Disable Motion Tracking stuff
 * 3)   - Disable manipulators

for screen in bpy.data.screens: for area in screen.areas: for ed in area.spaces: if ed.type == 'VIEW_3D': # Disable motion tracking ed.show_reconstruction = False # Disable transform manipulators? #ed.show_manipulator = False


 * 1) Bookmarks =======================================

BOOKMARKS_PATH = os.path.join(USER_SETTINGS_DIR, "bookmarks.txt") if not os.path.exists(BOOKMARKS_PATH): with open(BOOKMARKS_PATH, 'w') as f:		f.write("[Bookmarks]\n") f.write("%s\n" % os.path.join(os.path.expanduser("~"), "Downloads")) # TODO: Testfiles - Location depends on machine used though