Using app templates to boost productivity

Making video tuto­ri­als? Juggling mul­ti­ple projects? Ever want­ed to switch between dif­fer­ent Blender setups with­out hav­ing to remem­ber what pref­er­ences to flip every time? Application tem­plates allow you to save Blender con­fig­u­ra­tions and eas­i­ly swap between them.


This includes dif­fer­ent start­up files, addons and even splash screens. App tem­plates can also run cus­tom Python code when switch­ing to the tem­plate and when chang­ing away from it.

We can pick an appli­ca­tion tem­plate when we start Blender, through the splash screen or the File > New submenu. Blender already comes with some app tem­plates of its own, but the real pow­er is always in suit­ing Blender to your own work­flow.

App tem­plates are very use­ful while work­ing on projects for dif­fer­ent clients, and a must-have when record­ing video tuto­ri­als. They are also a great way to test your addons in a pris­tine envi­ron­ment.

App templates menu in Blender

Making an app template

Ready to make your first app tem­plate? These guys live close to the addons fold­er, which will be dif­fer­ent depend­ing on your os.

Linux~/.config/blender/2.83/scripts/startup/bl_app_templates_user/
Mac/Users/{user}/Library/Application/Support/Blender/2.83/scripts/startup/bl_app_templates_user/
WindowsC:\Documents and Settings\%username%\Application Data\Blender Foundation\Blender\2.83\startup\bl_app_templates_user

If you have nev­er added an app tem­plate, you might have to make the bl_app_templates_user fold­er. Make a new fold­er for the app tem­plate, its name will be the name of the tem­plate. If you need to add a space between words use the _ to sep­a­rate words, like_this. These are the files that go inside:

startup.blendThe base blend file for this tem­plate
userpref.blendDefault pref­er­ences for the tem­plate.
splash.png, splash_2x.pngSplash screen. Must be 501×250 and 1002×500 (for HiDPI mon­i­tors)
__init__.pyA Python script with reg­is­ter and unreg­is­ter func­tions.

The last three items are option­al.

Folder structure for app templates

Copy startup.blend and userpref.blendfrom your config fold­er to the new app tem­plate fold­er. Open startup.blend, change it to your lik­ing and save. Close and re-open Blender, now if you switch to your app tem­plate (File > New > My_template) you should see the same blend you saved.

Gotchas

Note that the start­up and user­pref files are the default, or “fac­to­ry” set­tings. If you save pref­er­ences or a cus­tom start­up with the app tem­plate loaded they will be saved as user pref­er­ences in your con­fig fold­er.
The con­fig­u­ra­tion fold­er for each app tem­plate is in:

Linux~/.config/blender/2.83/config/[app_template_name]
Mac/Users/{user}/Library/Application/Support/Blender/2.83/config/[app_template_name]
WindowsC:\Documents and Settings\%username%\Application Data\Blender Foundation\Blender\2.83\config[app_template_name]

This also means the when you save pref­er­ences, those changes won’t be saved to the userpref.blend in the app tem­plate fold­er but to app tem­plate con­fig instead. If you want to change the Factory Defaults for the app tem­plate you can replace the userpref.blend in the app tem­plate fold­er with the one from con­fig. The ben­e­fit of set­ting fac­to­ry defaults is that you can keep cer­tain set­tings even if you need to reset the pref­er­ences.

App tem­plates have one lim­i­ta­tion when it comes to pref­er­ences. Most set­tings are shared between app tem­plates. The pref­er­ences that can be saved in an app tem­plate are: Themes, Add-ons, Keymaps and Viewport light­ing. If you want to change a dif­fer­ent set­ting for a spe­cif­ic tem­plate you will have to do it the Python way. This involves dis­abling the pref­er­ences autosav­ing and then chang­ing the option. It’s very impor­tant to dis­able auto sav­ing, oth­er­wise load­ing a tem­plate would change that set­ting for oth­ers.

As an exam­ple, here’s the script I use for my video tuto­ri­als tem­plate. I change the UI scale so it’s more vis­i­ble in screen­casts.

import bpy

def register():
    prefs = bpy.context.preferences
    prefs.use_preferences_save = False

    prefs.view.ui_scale = 1.13


def unregister():
    pass

Don’t for­get that app tem­plates can saved, zipped and re-installed from a zip. So you can car­ry them around with you, keep back­ups or even share them! You can find more exam­ples in the man­u­al.

If you want to see my video app tem­plate in action, check out this quick tip video.

Tutorials(Blender, Productivity, Python)Last updated 23.07.2020
All the posts you can read

No comments yet

Leave a Reply

Your email address will not be published.