Changeset View
Changeset View
Standalone View
Standalone View
intern/cycles/blender/blender_object.cpp
| Show First 20 Lines • Show All 282 Lines • ▼ Show 20 Lines | Object *BlenderSync::sync_object(BL::Depsgraph::duplis_iterator& b_dupli_iter, | ||||
| if(is_instance) { | if(is_instance) { | ||||
| persistent_id_array = b_dupli_iter->persistent_id(); | persistent_id_array = b_dupli_iter->persistent_id(); | ||||
| persistent_id = persistent_id_array.data; | persistent_id = persistent_id_array.data; | ||||
| } | } | ||||
| /* light is handled separately */ | /* light is handled separately */ | ||||
| if(object_is_light(b_ob)) { | if(object_is_light(b_ob)) { | ||||
| /* don't use lamps for excluded layers used as mask layer */ | /* don't use lamps for excluded layers used as mask layer */ | ||||
| if(!motion && !((layer_flag & render_layer.holdout_layer) && | if(!motion && !((layer_flag & view_layer.holdout_layer) && | ||||
| (layer_flag & render_layer.exclude_layer))) | (layer_flag & view_layer.exclude_layer))) | ||||
| { | { | ||||
| sync_light(b_parent, | sync_light(b_parent, | ||||
| persistent_id, | persistent_id, | ||||
| b_ob, | b_ob, | ||||
| b_ob_instance, | b_ob_instance, | ||||
| is_instance ? b_dupli_iter->random_id() : 0, | is_instance ? b_dupli_iter->random_id() : 0, | ||||
| tfm, | tfm, | ||||
| use_portal); | use_portal); | ||||
| } | } | ||||
| return NULL; | return NULL; | ||||
| } | } | ||||
| /* only interested in object that we can create meshes from */ | /* only interested in object that we can create meshes from */ | ||||
| if(!object_is_mesh(b_ob)) { | if(!object_is_mesh(b_ob)) { | ||||
| return NULL; | return NULL; | ||||
| } | } | ||||
| /* Perform object culling. */ | /* Perform object culling. */ | ||||
| if(culling.test(scene, b_ob, tfm)) { | if(culling.test(scene, b_ob, tfm)) { | ||||
| return NULL; | return NULL; | ||||
| } | } | ||||
| /* Visibility flags for both parent and child. */ | /* Visibility flags for both parent and child. */ | ||||
| bool use_holdout = (layer_flag & render_layer.holdout_layer) != 0; | bool use_holdout = (layer_flag & view_layer.holdout_layer) != 0; | ||||
| uint visibility = object_ray_visibility(b_ob) & PATH_RAY_ALL_VISIBILITY; | uint visibility = object_ray_visibility(b_ob) & PATH_RAY_ALL_VISIBILITY; | ||||
| if(b_parent.ptr.data != b_ob.ptr.data) { | if(b_parent.ptr.data != b_ob.ptr.data) { | ||||
| visibility &= object_ray_visibility(b_parent); | visibility &= object_ray_visibility(b_parent); | ||||
| } | } | ||||
| /* Make holdout objects on excluded layer invisible for non-camera rays. */ | /* Make holdout objects on excluded layer invisible for non-camera rays. */ | ||||
| if(use_holdout && (layer_flag & render_layer.exclude_layer)) { | if(use_holdout && (layer_flag & view_layer.exclude_layer)) { | ||||
| visibility &= ~(PATH_RAY_ALL_VISIBILITY - PATH_RAY_CAMERA); | visibility &= ~(PATH_RAY_ALL_VISIBILITY - PATH_RAY_CAMERA); | ||||
| } | } | ||||
| /* Hide objects not on render layer from camera rays. */ | /* Hide objects not on render layer from camera rays. */ | ||||
| if(!(layer_flag & render_layer.layer)) { | if(!(layer_flag & view_layer.layer)) { | ||||
| visibility &= ~PATH_RAY_CAMERA; | visibility &= ~PATH_RAY_CAMERA; | ||||
| } | } | ||||
| /* Don't export completely invisible objects. */ | /* Don't export completely invisible objects. */ | ||||
| if(visibility == 0) { | if(visibility == 0) { | ||||
| return NULL; | return NULL; | ||||
| } | } | ||||
| ▲ Show 20 Lines • Show All 348 Lines • Show Last 20 Lines | |||||