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) { light_instances_.remove_if([&](auto item) {
bool res = !available_objects.contains(item.key.GetName()); bool res = !available_objects.contains(item.key.GetName());
if (!V3D_USES_SCENE_LIGHTS(scene_delegate_->view3d) &&
((Object *)item.value.data->id)->type == OB_LAMP)
{
res = true;
}
if (res) { if (res) {
item.value.transforms.clear(); item.value.transforms.clear();
update_light_instance(item.value); update_light_instance(item.value);
@ -353,6 +358,9 @@ void InstancerData::write_instances()
scene_delegate_->depsgraph, scene_delegate_->scene, (Object *)id); scene_delegate_->depsgraph, scene_delegate_->scene, (Object *)id);
LISTBASE_FOREACH (DupliObject *, dupli, lb) { LISTBASE_FOREACH (DupliObject *, dupli, lb) {
Object *ob = dupli->ob; Object *ob = dupli->ob;
if (!V3D_USES_SCENE_LIGHTS(scene_delegate_->view3d) && ob->type == OB_LAMP) {
return;
}
if (!is_supported(ob) || !is_instance_visible(ob)) { if (!is_supported(ob) || !is_instance_visible(ob)) {
continue; continue;
} }