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?
3 Answers
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;
-
-
$\begingroup$ @GiantCowFilms I noticed in chat :) it really is simple, though $\endgroup$ Jan 14, 2015 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$ Jan 14, 2015 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$ Jan 14, 2015 at 17:14
-
1$\begingroup$ @someonewithpc - give the textblock a
.py
name and enable register - it will run on file open. $\endgroup$– samblerJan 15, 2015 at 4:01
Here is a simple process to do before rendering:
- Deselect all your object A
- Hit Alt-H to unhide all the objects
- Without changing the selection, hit Ctrl-H, your objects will be hidden
- Hit H to hide them again.
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.