In Blender 2.80, you have options now to set a file template with it's own set of workspaces. Is there a way to rename, or better yet create a new file template?
3 Answers
You can add your own App Template by using the Operator Search F3 to find Install Template from File.... The underlying operator PREFERENCES_OT_app_template_install
allows you to install a zipped App Template.
If you don't have a zip file you can copy and modify one of the existing templates. You can find the location of the template files by switching to the scripting workspace and typing the following code into the python console:
for x in bpy.utils.app_template_paths():
print(x)
This will print the path(s) where the build in application templates are stored.
Each template consists of a folder containing a startup.blend
and a init.py
. The former is the default project that is loaded. The latter is a Python script that contains a callback function / handler that is executed once the startup.blend
is loaded. This allows to perform additional configurations. The folder name is the name of the template. Below you see the basic structure of such an init.py
.
import bpy
from bpy.app.handlers import persistent
@persistent
def load_handler(dummy):
pass
def register():
bpy.app.handlers.load_factory_startup_post.append(load_handler)
def unregister():
bpy.app.handlers.load_factory_startup_post.remove(load_handler)
The load_handler()
is the function that will be registered once you select the app template in Blender and then executed once the project is loaded. When you create your template you can add whatever additional Python code you like here. If you copy an existing template to create your own, you may want to edit this function or replace it's content with pass
to make it do nothing.
Now in order to create your own template you need to do three things:
- Either copy an existing template or create your own directory with a
startup.blend
andinit.py
- Open the
startup.blend
and adjust the UI to your liking - Open the
init.py
and modify theload_handler
. (If you're unfamiliar with software development simply copy and past the example given above, which does nothing.)
Your new template should be available right away when you restart Blender, if you've created the files in the directory where the other templates are stored. Otherwise you will either have to copy it there or create a zip file of the directory and install it by using Install Template from File... as described at the beginning.
They are located in Blender's installation folder:
C:\Program Files\Blender Foundation\Blender\2.80\scripts\startup\bl_app_templates_system\
on Windows
You can see a few folders:
You can delete them or copy one of them, give it another name and save an empty startup.blend file with whatever UI you like.
-
$\begingroup$ Thank you! For others wondering, on a mac right click on blender, show package contents, 2.80, scripts, startup, bl_app_templates_system. $\endgroup$ Sep 13, 2019 at 20:48
Here is another way for OSX:
- Go to Blender.app > Contents > Resources > 2.80 > scripts > startups > bl_app_templates_system (here you can find all startup files)
- Duplicate the one that closely resembled the look you needed, and duplicate that folder
- Go inside that folder, open up the blend file inside and changed it to whatever you need
- Compresses that folder to a
.zip
file - Back in Blender, hit F3 and type Install Template from File...
- Select the
.zip
file created and re-start Blender