Implement Viewport render with material preview #56

Merged
Bogdan Nagirniak merged 22 commits from BLEN-421 into hydra-render 2023-06-30 09:03:28 +02:00
Showing only changes of commit 037bc85feb - Show all commits

View File

@ -272,6 +272,11 @@ void InstancerData::check_remove(Set<std::string> &available_objects)
light_instances_.remove_if([&](auto item) {
bool res = !available_objects.contains(item.key.GetName());
if (!V3D_USES_SCENE_LIGHTS(scene_delegate_->view3d) &&
BogdanNagirniak marked this conversation as resolved Outdated

use scene_delegate_->shading_settings.use_scene_lights

use `scene_delegate_->shading_settings.use_scene_lights`

lights shouldn't be in available_objects, this can be reverted

lights shouldn't be in available_objects, this can be reverted
((Object *)item.value.data->id)->type == OB_LAMP)
{
res = true;
}
if (res) {
item.value.transforms.clear();
update_light_instance(item.value);
@ -353,6 +358,9 @@ void InstancerData::write_instances()
scene_delegate_->depsgraph, scene_delegate_->scene, (Object *)id);
LISTBASE_FOREACH (DupliObject *, dupli, lb) {
Object *ob = dupli->ob;
if (!V3D_USES_SCENE_LIGHTS(scene_delegate_->view3d) && ob->type == OB_LAMP) {
return;
BogdanNagirniak marked this conversation as resolved Outdated

if (ob->type == OB_LAMP && !scene_delegate_->shading_settings.use_scene_lights)

`if (ob->type == OB_LAMP && !scene_delegate_->shading_settings.use_scene_lights)`
}
if (!is_supported(ob) || !is_instance_visible(ob)) {
continue;
}