forked from blender/blender
Implement Viewport render with material preview #56
@ -205,8 +205,9 @@ void BlenderSceneDelegate::populate(Depsgraph *deps, bContext *cont)
|
||||
check_updates();
|
||||
}
|
||||
else {
|
||||
use_scene_lights = V3D_USES_SCENE_LIGHTS(view3d);
|
||||
use_scene_lights_ = V3D_USES_SCENE_LIGHTS(view3d);
|
||||
shading_flag_ = view3d->shading.flag;
|
||||
lookdev_light_ = view3d->shading.lookdev_light;
|
||||
add_new_objects();
|
||||
update_world();
|
||||
}
|
||||
@ -426,19 +427,20 @@ void BlenderSceneDelegate::check_updates()
|
||||
bool do_update_visibility = false;
|
||||
bool do_update_world = false;
|
||||
|
||||
if (shading_flag_ != view3d->shading.flag) {
|
||||
if (shading_flag_ != view3d->shading.flag || lookdev_light_ != view3d->shading.lookdev_light) {
|
||||
shading_flag_ = view3d->shading.flag;
|
||||
lookdev_light_ = view3d->shading.lookdev_light;
|
||||
do_update_world = true;
|
||||
}
|
||||
|
||||
bool use_scene_lights_changed = false;
|
||||
|
||||
if (use_scene_lights != V3D_USES_SCENE_LIGHTS(view3d)) {
|
||||
use_scene_lights = V3D_USES_SCENE_LIGHTS(view3d);
|
||||
if (use_scene_lights_ != V3D_USES_SCENE_LIGHTS(view3d)) {
|
||||
use_scene_lights_ = V3D_USES_SCENE_LIGHTS(view3d);
|
||||
use_scene_lights_changed = true;
|
||||
}
|
||||
if (use_scene_lights_changed) {
|
||||
if (use_scene_lights) {
|
||||
if (use_scene_lights_) {
|
||||
add_new_objects(true);
|
||||
}
|
||||
else {
|
||||
|
@ -100,7 +100,8 @@ class BlenderSceneDelegate : public pxr::HdSceneDelegate {
|
||||
std::unique_ptr<WorldData> world_data_;
|
||||
|
||||
short shading_flag_;
|
||||
BogdanNagirniak marked this conversation as resolved
Outdated
|
||||
bool use_scene_lights = false;
|
||||
std::string lookdev_light_;
|
||||
bool use_scene_lights_ = false;
|
||||
};
|
||||
|
||||
BogdanNagirniak marked this conversation as resolved
Outdated
Bogdan Nagirniak
commented
remove parameter remove parameter `view3d`
|
||||
#define LOOK_DEV_STUDIO_LIGHT_ENABLED(v3d) \
|
||||
|
Loading…
Reference in New Issue
Block a user
Move this new settings to internal
struct ShadingSettings