Code improvements and fixes #26

Merged
Bogdan Nagirniak merged 8 commits from code_improvements_fixes into hydra-render 2023-04-21 07:48:50 +02:00
2 changed files with 14 additions and 25 deletions
Showing only changes of commit 0bcbc3b942 - Show all commits

View File

@ -326,34 +326,10 @@ void BlenderSceneDelegate::update_world()
void BlenderSceneDelegate::check_updates() void BlenderSceneDelegate::check_updates()
{ {
/* Working with updates */
bool do_update_collection = false; bool do_update_collection = false;
bool do_update_visibility = false; bool do_update_visibility = false;
bool do_update_world = false; bool do_update_world = false;
unsigned int scene_recalc = scene->id.recalc;
if (scene_recalc) {
/* Checking scene updates */
CLOG_INFO(LOG_BSD,
2,
"Update: %s [%s]",
((ID *)scene)->name,
std::bitset<32>(scene_recalc).to_string().c_str());
if (scene_recalc & ID_RECALC_BASE_FLAGS) {
do_update_visibility = true;
}
if (scene_recalc & (ID_RECALC_TRANSFORM | ID_RECALC_GEOMETRY)) {
do_update_collection = true;
}
if (scene_recalc & ID_RECALC_AUDIO_VOLUME) {
if ((scene->world && !world_data_) || (!scene->world && world_data_)) {
do_update_world = true;
}
}
}
/* Checking other objects updates */
DEGIDIterData data = {0}; DEGIDIterData data = {0};
data.graph = depsgraph; data.graph = depsgraph;
data.only_updated = true; data.only_updated = true;
@ -383,6 +359,20 @@ void BlenderSceneDelegate::check_updates()
} }
} break; } break;
case ID_SCE: {
if (id->recalc & ID_RECALC_BASE_FLAGS) {
do_update_visibility = true;
}
if (id->recalc & (ID_RECALC_TRANSFORM | ID_RECALC_GEOMETRY)) {
do_update_collection = true;
}
if (id->recalc & ID_RECALC_AUDIO_VOLUME) {
if ((scene->world && !world_data_) || (!scene->world && world_data_)) {
do_update_world = true;
}
}
} break;
default: default:
break; break;
} }

View File

@ -3,7 +3,6 @@
#include "BKE_lib_id.h" #include "BKE_lib_id.h"
//#include "blender_scene_delegate.h"
#include "id.h" #include "id.h"
namespace blender::render::hydra { namespace blender::render::hydra {