Instantly share code, notes, and snippets.

View get_renderpath.markdown

Getting the render path (or any variable) from a .blend file

Update: I posted a related question to the Blender StackExchange and got a very helpful response on how some of this information could be extracted from a .blend file without launching Blender. So while the technique I describe below works, it might be better to use the method described in the StackExchange answer.

When doing my work, sometimes I need to get information out of a .blend file. For example, I sometimes need to do batch image processing (renaming, file conversion, etc.) on my rendered output. There's not a nice way to just query the .blend file for that information. Sure, there's BAM and even the old blenderaid tools, but they're a bit heavy-handed if you don't have them installed. So here's the hacky solution I'm currently using.

The following line of bash assigns a RENDERPATH variable using a Frankencod

View blender-multi_gpu.markdown

Rendering in Blender on a machine with multiple GPUs

So here's the premise: For scenes that take around a minute or less to render, performance is actually worse if you render on all of the cards with a single instance of Blender. This is because (AFAIK) there's a bit of additional time necessary to collect the render results from each card and stitch them together. That time is a fixed short duration, so it's negligible on larger/longer render jobs. However, on shorter render jobs, the 'stitch time' has a much more significant impact.

I ran into this with a machine I render on that has 4 Quadro K6000s in it. To render animations, I ended up writing a few little scripts to facilitate launching 4 separate instances of Blender, each one tied to one GPU. Overall rendertime was much shorter with that setup than one instance of Blender using all 4 GPUs.

The setup works basically like this... I have a the following Python script (it can be anywhere on your hard drive, so long as you remember the path to it).

View lockview.py
# ***** BEGIN GPL LICENSE BLOCK *****
#
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
View blender-pullbuild.sh
#!/bin/bash
# This script should be run from within your build directory (assuming cmake), e.g. ~/src/blender/build
cd ../blender
git pull --rebase
git submodule foreach git pull --rebase origin master
cd ../build
make $MAKEFLAGS
# make install
View forkicate.sh
# THIS IS NOT MEANT TO BE A SCRIPT YOU ACTUALLY RUN.
####################################################
# Use these steps to work on a project fork on GitHub and create your own dev branch
# (this assumes that you've already created a fork through GitHub's interface)
cd ~/src # or where ever you keep your source code
git clone https://github.com/YourUser/project.git # Where "YourUser" is your username and "project" is your forked project
cd project
# Track the upstream project you forked from
View print-friendly.xml
<bpy>
<Theme>
<user_interface>
<ThemeUserInterface menu_shadow_fac="0.5"
menu_shadow_width="12"
icon_file=""
icon_alpha="1"
axis_x="#dc0000"
axis_y="#00dc00"
axis_z="#0000dc">