6
$\begingroup$

I've heard this trick at the conference, but I can't remember it nor find the video.

I have 300 instances of the same linked group in a scene and I want to use a low poly version for the camera work. Then I want to switch to highpoly for the rendering.

I could do it with layers, but I want to switch between the groups. This is possible by changing one name somewhere. Does anybody else remember?

$\endgroup$
3
  • 3
    $\begingroup$ related blender.stackexchange.com/questions/27308/… $\endgroup$
    – Chebhou
    May 1, 2015 at 23:15
  • $\begingroup$ Definitely helpful, just not the answer I'm searching. Mainly because I don't have a system yet to migrate alle the tweak to new versions, so I prefer solutions that work without extras. $\endgroup$ May 4, 2015 at 21:03
  • $\begingroup$ In the group itself have one version visible in viewport and not in render and another version visible for render and not viewport. Easy $\endgroup$ Jul 14, 2016 at 12:08

2 Answers 2

1
$\begingroup$

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 :)

$\endgroup$
0
$\begingroup$

enter image description here

its in the duplication section in the object tab of a group instance

$\endgroup$
1
  • 1
    $\begingroup$ Hello Silva, welcome to BSE, please read the rules of how to use the site, your answer is very brief, it doesn't answer the question, keep in mind that many others benefit from questions and answers. $\endgroup$
    – Georges D
    Jun 8, 2016 at 23:50

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .