Page MenuHome

API object.hide_render flag and its relation to collection visibility inconsistent
Closed, ArchivedPublic

Description

System Information
Operating system: Arch Linux
Graphics card: GTX 970

Blender Version
Broken: blender-2.80-26d5a3625ed-linux-glibc224-x86_64

Short description of error

According to https://wiki.blender.org/wiki/Reference/Release_Notes/2.80/Python_API/Scene_and_Object_API#View_Layer_.26_Collection

collection hide status also matters in 2.8x. An object only linked in hidden collections will always be hidden, regardless of its own flag setting. This is similar to hiding a layer in 2.7x.

This seems to suggest that (when having a single collection and some object in it) setting the collection to hidden for rendering should hide the object for rendering as well. But when I disable the collection for rendering I still get the object's value for obj.hide_render and not True.

Or am I misinterpreting the release notes?

Exact steps for others to reproduce the error

See attached scene. Cube is visible for render, but its parent collection is not. Checking the hide_render flag of Cube gives False, while I would expect True.

Details

Type
Bug

Event Timeline

Brecht Van Lommel (brecht) claimed this task.

object.hide_render does not tell you if the object is hidden, it only returns the value of the property as set by the user. This is the same as in 2.7x.

To find out which objects are visible in the render, you can loop over depsgraph.object_instances.