I don't know how it was done in the Conference video, but this can be achieved using Blenders handler functions. Handler functions are Python functions which you can hook up to events happening in Blender. You can find a list of them when calling Auto Complete from the Blender Python console using this:
bpy.app.handlers.
and then press Ctrl+Spacebar. In this case I will use render_pre
and render_post
. A simple script showing what you want in action would be this (paste the Code into a text Editor and run it):
import bpy
def switchGroups(_LowDetailName, _highDetailName):
for _o in bpy.data.objects:
if _o.type == 'EMPTY':
if _o.dupli_group.name == _LowDetailName:
_o.dupli_group = bpy.data.groups[_highDetailName]
bpy.app.handlers.render_pre.clear()
bpy.app.handlers.render_post.clear()
bpy.app.handlers.render_pre.append(lambda x: switchGroups('Cube', 'Dragon'))
bpy.app.handlers.render_post.append(lambda x: switchGroups('Dragon', 'Cube'))
In this example I replace a group which is visible in the ViewPort named 'Cube' with a group called 'Dragon' at the time Blender initializes a final rendering using F12. To adapt it to your situation, replace the names of the last two lines with whatever group you want to replace. To make this work more efficiently, coding an Addon with replacement lists would definitely be a solution, but it is out of scope for this answer :)