forked from blender/blender
Implement Viewport render with material preview #56
@ -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
|
|||||||
((Object *)item.value->id)->type == OB_LAMP)
|
|
||||||
{
|
|
||||||
ret = true;
|
ret = true;
|
||||||
}
|
}
|
||||||
if (ret) {
|
if (ret) {
|
||||||
|
@ -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
Bogdan Nagirniak
commented
```
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
Bogdan Nagirniak
commented
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 &&
|
||||||
|
@ -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
Bogdan Nagirniak
commented
`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)) {
|
||||||
|
Loading…
Reference in New Issue
Block a user
move this check to L573