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 */ /* Remove unused objects */
objects_.remove_if([&](auto item) { objects_.remove_if([&](auto item) {
bool ret = !available_objects.contains(item.key.GetName()); bool ret = !available_objects.contains(item.key.GetName());
if (!shading_settings.use_scene_lights && if (!shading_settings.use_scene_lights && ((Object *)item.value->id)->type == OB_LAMP) {
BogdanNagirniak marked this conversation as resolved Outdated

move this check to L573

move this check to L573
((Object *)item.value->id)->type == OB_LAMP)
{
ret = true; ret = true;
} }
if (ret) { if (ret) {

View File

@ -44,7 +44,8 @@ class BlenderSceneDelegate : public pxr::HdSceneDelegate {
float studiolight_rotation; float studiolight_rotation;
float studiolight_intensity; float studiolight_intensity;
BogdanNagirniak marked this conversation as resolved Outdated
    bool use_scene_lights = true;
    bool use_scene_world = true;
    std::string studiolight_name;
    float studiolight_rotation;
    floatstudiolight_intensity;
``` bool use_scene_lights = true; bool use_scene_world = true; std::string studiolight_name; float studiolight_rotation; floatstudiolight_intensity; ```
bool operator==(const ShadingSettings& other) { bool operator==(const ShadingSettings &other)
BogdanNagirniak marked this conversation as resolved Outdated

move implementation to blender_scene_delegate.cc

move implementation to blender_scene_delegate.cc
{
return use_scene_lights == other.use_scene_lights && return use_scene_lights == other.use_scene_lights &&
use_scene_world == other.use_scene_world && use_scene_world == other.use_scene_world &&
studiolight_name == other.studiolight_name && studiolight_name == other.studiolight_name &&

View File

@ -358,9 +358,7 @@ 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 (!scene_delegate_->shading_settings.use_scene_lights && if (!scene_delegate_->shading_settings.use_scene_lights && ob->type == OB_LAMP) {
ob->type == OB_LAMP)
{
continue; continue;
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)) { if (!is_supported(ob) || !is_instance_visible(ob)) {