Change log severity for better maintability #50

Merged
Bogdan Nagirniak merged 6 commits from Vasyl-Pidhirskyi/blender_bn:BLEN-422 into hydra-render 2023-06-05 19:46:21 +02:00
7 changed files with 17 additions and 15 deletions
Showing only changes of commit 55786b3d55 - Show all commits

View File

@ -125,7 +125,7 @@ static PyObject *engine_create_func(PyObject * /*self*/, PyObject *args)
}
}
CLOG_INFO(LOG_RENDER_HYDRA, 0, "Engine %016llx %s", engine, engine_type);
CLOG_INFO(LOG_RENDER_HYDRA, 1, "Engine %016llx %s", engine, engine_type);
return PyLong_FromVoidPtr(engine);
}
@ -139,7 +139,7 @@ static PyObject *engine_free_func(PyObject * /*self*/, PyObject *args)
Engine *engine = (Engine *)PyLong_AsVoidPtr(pyengine);
delete engine;
CLOG_INFO(LOG_RENDER_HYDRA, 2, "Engine %016llx", engine);
CLOG_INFO(LOG_RENDER_HYDRA, 1, "Engine %016llx", engine);
Py_RETURN_NONE;
}
@ -194,7 +194,7 @@ static PyObject *engine_render_func(PyObject * /*self*/, PyObject *args)
engine->render(depsgraph);
Py_END_ALLOW_THREADS;
CLOG_INFO(LOG_RENDER_HYDRA, 0, "Engine %016llx", engine);
CLOG_INFO(LOG_RENDER_HYDRA, 3, "Engine %016llx", engine);
Py_RETURN_NONE;
}
@ -214,7 +214,7 @@ static PyObject *engine_view_draw_func(PyObject * /*self*/, PyObject *args)
engine->render(depsgraph, context);
Py_END_ALLOW_THREADS;
CLOG_INFO(LOG_RENDER_HYDRA, 0, "Engine %016llx", engine);
CLOG_INFO(LOG_RENDER_HYDRA, 3, "Engine %016llx", engine);
Py_RETURN_NONE;
}

View File

@ -510,7 +510,7 @@ void BlenderSceneDelegate::add_new_objects()
object)
{
CLOG_INFO(LOG_RENDER_HYDRA_SCENE,
0,
2,
"Visibility: %s [%s]",
object->id.name,
std::bitset<3>(BKE_object_visibility(object, deg_mode)).to_string().c_str());

View File

@ -88,7 +88,7 @@ bool CurvesData::update_visibility()
if (ret) {
scene_delegate_->GetRenderIndex().GetChangeTracker().MarkRprimDirty(
prim_id, pxr::HdChangeTracker::DirtyVisibility);
ID_LOG(2, "");
ID_LOG(1, "");
}
return ret;
}

View File

@ -44,10 +44,12 @@ static std::string cache_image_file(Image *image,
if (!BKE_image_save(&reports, main, image, iuser, &opts)) {
file_path = "";
};
else{
CLOG_INFO(LOG_RENDER_HYDRA_SCENE, 1, "%s -> %s", image->id.name, file_path.c_str());
};
}
BKE_image_save_options_free(&opts);
CLOG_INFO(LOG_RENDER_HYDRA_SCENE, 3, "%s -> %s", image->id.name, file_path.c_str());
return file_path;
}
@ -71,7 +73,7 @@ std::string cache_or_get_image_file(Image *image,
}
}
CLOG_INFO(LOG_RENDER_HYDRA_SCENE, 3, "%s -> %s", image->id.name, file_path.c_str());
CLOG_INFO(LOG_RENDER_HYDRA_SCENE, 1, "%s -> %s", image->id.name, file_path.c_str());
return file_path;
}

View File

@ -61,19 +61,19 @@ bool InstancerData::is_visible(BlenderSceneDelegate *scene_delegate, Object *obj
void InstancerData::init()
{
ID_LOG(2, "");
ID_LOG(1, "");
write_instances();
}
void InstancerData::insert()
{
ID_LOG(2, "");
ID_LOG(1, "");
scene_delegate_->GetRenderIndex().InsertInstancer(scene_delegate_, prim_id);
}
void InstancerData::remove()
{
CLOG_INFO(LOG_RENDER_HYDRA_SCENE, 2, "%s", prim_id.GetText());
CLOG_INFO(LOG_RENDER_HYDRA_SCENE, 1, "%s", prim_id.GetText());
for (auto &m_inst : mesh_instances_.values()) {
m_inst.data->remove();
}
@ -87,7 +87,7 @@ void InstancerData::remove()
void InstancerData::update()
{
ID_LOG(2, "");
ID_LOG(1, "");
Object *object = (Object *)id;
if (id->recalc & ID_RECALC_GEOMETRY ||
(object->data && ((ID *)object->data)->recalc & ID_RECALC_GEOMETRY) ||
@ -116,7 +116,7 @@ bool InstancerData::update_visibility()
bool ret = visible != prev_visible;
if (ret) {
ID_LOG(2, "");
ID_LOG(1, "");
auto &change_tracker = scene_delegate_->GetRenderIndex().GetChangeTracker();
change_tracker.MarkInstancerDirty(prim_id, pxr::HdChangeTracker::DirtyVisibility);
for (auto &m_inst : mesh_instances_.values()) {

View File

@ -164,7 +164,7 @@ bool LightData::update_visibility()
if (ret) {
scene_delegate_->GetRenderIndex().GetChangeTracker().MarkSprimDirty(prim_id,
pxr::HdLight::DirtyParams);
ID_LOG(2, "");
ID_LOG(1, "");
}
return ret;
}

View File

@ -106,7 +106,7 @@ bool MeshData::update_visibility()
for (int i = 0; i < submeshes_.size(); ++i) {
scene_delegate_->GetRenderIndex().GetChangeTracker().MarkRprimDirty(
submesh_prim_id(i), pxr::HdChangeTracker::DirtyVisibility);
ID_LOG(2, "%d", i);
ID_LOG(1, "%d", i);
}
}
return ret;