Python/ViewLayers: add object.hide_get/set(), and optional view layer parameters.

These new functions control the per view layer object hiding state, similar to
the selection state. All these object state checking functions now also optionally
take a view layer to use instead of the active view layer.

Fixes T62062.
This commit is contained in:
2019-03-12 18:44:56 +01:00
parent 4572354fe5
commit cae89a6889
2 changed files with 94 additions and 25 deletions

View File

@@ -349,7 +349,7 @@ Object *BlenderSync::sync_object(BL::Depsgraph& b_depsgraph,
/* Visibility flags for both parent and child. */
PointerRNA cobject = RNA_pointer_get(&b_ob.ptr, "cycles");
bool use_holdout = get_boolean(cobject, "is_holdout") ||
b_parent.holdout_get(b_view_layer);
b_parent.holdout_get(PointerRNA_NULL, b_view_layer);
uint visibility = object_ray_visibility(b_ob) & PATH_RAY_ALL_VISIBILITY;
if(b_parent.ptr.data != b_ob.ptr.data) {
@@ -364,7 +364,7 @@ Object *BlenderSync::sync_object(BL::Depsgraph& b_depsgraph,
#endif
/* Clear camera visibility for indirect only objects. */
bool use_indirect_only = b_parent.indirect_only_get(b_view_layer);
bool use_indirect_only = b_parent.indirect_only_get(PointerRNA_NULL, b_view_layer);
if(use_indirect_only) {
visibility &= ~PATH_RAY_CAMERA;
}