Changeset View
Changeset View
Standalone View
Standalone View
intern/cycles/blender/blender_light.cpp
| Show All 28 Lines | void BlenderSync::sync_light(BL::Object &b_parent, | ||||
| int persistent_id[OBJECT_PERSISTENT_ID_SIZE], | int persistent_id[OBJECT_PERSISTENT_ID_SIZE], | ||||
| BL::Object &b_ob, | BL::Object &b_ob, | ||||
| BL::Object &b_ob_instance, | BL::Object &b_ob_instance, | ||||
| int random_id, | int random_id, | ||||
| Transform &tfm, | Transform &tfm, | ||||
| bool *use_portal) | bool *use_portal) | ||||
| { | { | ||||
| /* test if we need to sync */ | /* test if we need to sync */ | ||||
| Light *light; | |||||
| ObjectKey key(b_parent, persistent_id, b_ob_instance, false); | ObjectKey key(b_parent, persistent_id, b_ob_instance, false); | ||||
| BL::Light b_light(b_ob.data()); | BL::Light b_light(b_ob.data()); | ||||
| Light *light = light_map.find(key); | |||||
| /* Check if the transform was modified, in case a linked collection is moved we do not get a | |||||
| * specific depsgraph update (T88515). This also mimics the behavior for Objects. */ | |||||
| const bool tfm_updated = (light && light->get_tfm() != tfm); | |||||
| /* Update if either object or light data changed. */ | /* Update if either object or light data changed. */ | ||||
| if (!light_map.add_or_update(&light, b_ob, b_parent, key)) { | if (!tfm_updated && !light_map.add_or_update(&light, b_ob, b_parent, key)) { | ||||
| Shader *shader; | Shader *shader; | ||||
| if (!shader_map.add_or_update(&shader, b_light)) { | if (!shader_map.add_or_update(&shader, b_light)) { | ||||
| if (light->get_is_portal()) | if (light->get_is_portal()) | ||||
| *use_portal = true; | *use_portal = true; | ||||
| return; | return; | ||||
| } | } | ||||
| } | } | ||||
| ▲ Show 20 Lines • Show All 163 Lines • Show Last 20 Lines | |||||