Fix T37303, Fix T37163: cycles mask layers that are also excluded not rendering
correct with multiple render layers. This case is somewhat weak, we now do a few more checks on sync than I would like, but it's not too bad.
This commit is contained in:
@@ -267,13 +267,38 @@ Object *BlenderSync::sync_object(BL::Object b_parent, int persistent_id[OBJECT_P
|
||||
/* mesh sync */
|
||||
object->mesh = sync_mesh(b_ob, object_updated, hide_tris);
|
||||
|
||||
/* sspecial case not tracked by object update flags */
|
||||
/* special case not tracked by object update flags */
|
||||
|
||||
/* holdout */
|
||||
if(use_holdout != object->use_holdout) {
|
||||
object->use_holdout = use_holdout;
|
||||
scene->object_manager->tag_update(scene);
|
||||
object_updated = true;
|
||||
}
|
||||
|
||||
/* visibility flags for both parent and child */
|
||||
uint visibility = object_ray_visibility(b_ob) & PATH_RAY_ALL_VISIBILITY;
|
||||
if(b_parent.ptr.data != b_ob.ptr.data) {
|
||||
visibility &= object_ray_visibility(b_parent);
|
||||
object->random_id ^= hash_int(hash_string(b_parent.name().c_str()));
|
||||
}
|
||||
|
||||
/* make holdout objects on excluded layer invisible for non-camera rays */
|
||||
if(use_holdout && (layer_flag & render_layer.exclude_layer))
|
||||
visibility &= ~(PATH_RAY_ALL_VISIBILITY - PATH_RAY_CAMERA);
|
||||
|
||||
/* camera flag is not actually used, instead is tested
|
||||
* against render layer flags */
|
||||
if(visibility & PATH_RAY_CAMERA) {
|
||||
visibility |= layer_flag << PATH_RAY_LAYER_SHIFT;
|
||||
visibility &= ~PATH_RAY_CAMERA;
|
||||
}
|
||||
|
||||
if(visibility != object->visibility) {
|
||||
object->visibility = visibility;
|
||||
object_updated = true;
|
||||
}
|
||||
|
||||
/* object sync
|
||||
* transform comparison should not be needed, but duplis don't work perfect
|
||||
* in the depsgraph and may not signal changes, so this is a workaround */
|
||||
@@ -295,24 +320,10 @@ Object *BlenderSync::sync_object(BL::Object b_parent, int persistent_id[OBJECT_P
|
||||
else
|
||||
object->random_id = hash_int_2d(object->random_id, 0);
|
||||
|
||||
/* visibility flags for both parent */
|
||||
object->visibility = object_ray_visibility(b_ob) & PATH_RAY_ALL_VISIBILITY;
|
||||
if(b_parent.ptr.data != b_ob.ptr.data) {
|
||||
object->visibility &= object_ray_visibility(b_parent);
|
||||
if(b_parent.ptr.data != b_ob.ptr.data)
|
||||
object->random_id ^= hash_int(hash_string(b_parent.name().c_str()));
|
||||
}
|
||||
|
||||
/* make holdout objects on excluded layer invisible for non-camera rays */
|
||||
if(use_holdout && (layer_flag & render_layer.exclude_layer))
|
||||
object->visibility &= ~(PATH_RAY_ALL_VISIBILITY - PATH_RAY_CAMERA);
|
||||
|
||||
/* camera flag is not actually used, instead is tested
|
||||
* against render layer flags */
|
||||
if(object->visibility & PATH_RAY_CAMERA) {
|
||||
object->visibility |= layer_flag << PATH_RAY_LAYER_SHIFT;
|
||||
object->visibility &= ~PATH_RAY_CAMERA;
|
||||
}
|
||||
|
||||
/* dupli texture coordinates */
|
||||
if (b_dupli_ob) {
|
||||
object->dupli_generated = 0.5f*get_float3(b_dupli_ob.orco()) - make_float3(0.5f, 0.5f, 0.5f);
|
||||
object->dupli_uv = get_float2(b_dupli_ob.uv());
|
||||
|
||||
Submodule release/scripts/addons updated: 6501c6cadf...dbf7e49d9b
Submodule release/scripts/addons_contrib updated: 6695fc64a5...4fe6a9e046
Reference in New Issue
Block a user