5
$\begingroup$

I am using Blender for some scientific-related visualization. As such I guess my needs are much more modest than those of the average animator, and the decoupling of the visibility and renderability of objects (i.e., the fact I can set some object to rendered although it is not visible in preview) only causes problems for me, when I change what is visible but forget to also set it to be rendered, only to come back 15 minutes later and see that I had rendered the wrong scene. Is there some way to "couple" visibility and renderability, i.e. only whatever is set as visible is also set as renderable?

$\endgroup$
4
$\begingroup$

You could also do this with Python!

To do so you could run the following code, manually, before rendering:

import bpy

for obj in bpy.data.objects:
    obj.hide_render = obj.hide

A better solution would be to somehow run the code automagically before rendering, which can be done as follows:

import bpy

def unhide(self):
     for obj in bpy.data.objects:
          obj.hide_render = obj.hide

bpy.app.handlers.render_pre.append(unhide)

To make the script run every time you open up the blend file, name your text block with a .py extension and check Register.

Note that you must run the script once;

$\endgroup$
  • $\begingroup$ I tried so hard to do this... D: $\endgroup$ – GiantCowFilms Jan 13 '15 at 23:52
  • $\begingroup$ @GiantCowFilms I noticed in chat :) it really is simple, though $\endgroup$ – someonewithpc Jan 14 '15 at 7:30
  • 1
    $\begingroup$ I kept on trying to do it using the same steps as my answer :/. I don't really no how to code python, or anything about whats in bpy.... $\endgroup$ – GiantCowFilms Jan 14 '15 at 15:54
  • $\begingroup$ @GiantCowFilms Python is really simple; and as far as knowing the API, there's always the api docs and Google it self :D $\endgroup$ – someonewithpc Jan 14 '15 at 17:14
  • 1
    $\begingroup$ @someonewithpc - give the textblock a .py name and enable register - it will run on file open. $\endgroup$ – sambler Jan 15 '15 at 4:01
3
$\begingroup$

Here is a simple process to do before rendering:

  1. Deselect all your object A
  2. Hit Alt-H to unhide all the objects
  3. Without changing the selection, hit Ctrl-H, your objects will be hidden
  4. Hit H to hide them again.
$\endgroup$
2
$\begingroup$

For better scene organization I suggest you to use the new layer management addon. With this you can simply disable a layer if you don't want to render it.

enter image description here

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.