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
3 changed files with 4 additions and 7 deletions
Showing only changes of commit 8291f2acc1 - Show all commits

View File

@ -591,9 +591,7 @@ void BlenderSceneDelegate::remove_unused_objects()
/* Remove unused objects */
objects_.remove_if([&](auto item) {
bool ret = !available_objects.contains(item.key.GetName());
if (!shading_settings.use_scene_lights &&
((Object *)item.value->id)->type == OB_LAMP)
{
if (!shading_settings.use_scene_lights && ((Object *)item.value->id)->type == OB_LAMP) {
ret = true;
}
if (ret) {

View File

@ -44,7 +44,8 @@ class BlenderSceneDelegate : public pxr::HdSceneDelegate {
float studiolight_rotation;
float studiolight_intensity;
bool operator==(const ShadingSettings& other) {
bool operator==(const ShadingSettings &other)
{
return use_scene_lights == other.use_scene_lights &&
use_scene_world == other.use_scene_world &&
studiolight_name == other.studiolight_name &&

View File

@ -358,9 +358,7 @@ void InstancerData::write_instances()
scene_delegate_->depsgraph, scene_delegate_->scene, (Object *)id);
LISTBASE_FOREACH (DupliObject *, dupli, lb) {
Object *ob = dupli->ob;
if (!scene_delegate_->shading_settings.use_scene_lights &&
ob->type == OB_LAMP)
{
if (!scene_delegate_->shading_settings.use_scene_lights && ob->type == OB_LAMP) {
continue;
}
if (!is_supported(ob) || !is_instance_visible(ob)) {