BLEN-359: Implement updates for instances in viewport #20

Merged
Bogdan Nagirniak merged 20 commits from BLEN-359_1 into hydra-render 2023-04-05 11:47:37 +02:00
2 changed files with 7 additions and 4 deletions
Showing only changes of commit 5f57b0dbd3 - Show all commits

View File

@ -90,9 +90,7 @@ void BlenderSceneDelegate::update_collection(bool remove, bool visibility)
if (visibility) { if (visibility) {
/* Check and update visibility */ /* Check and update visibility */
for (auto &obj : objects) { for (auto &obj : objects) {
if (obj.second->update_visibility(view3d)) { obj.second->update_visibility(view3d);
obj.second->update();
};
} }
} }

View File

@ -75,7 +75,12 @@ bool InstancerData::update_visibility(View3D *view3d)
bool prev_visible = visible; bool prev_visible = visible;
visible = BKE_object_is_visible_in_viewport(view3d, parent_obj); visible = BKE_object_is_visible_in_viewport(view3d, parent_obj);
return visible != prev_visible; bool ret = visible != prev_visible;
if (ret) {
scene_delegate->GetRenderIndex().GetChangeTracker().MarkRprimDirty(
p_id, pxr::HdChangeTracker::DirtyVisibility);
}
return ret;
} }
VtValue InstancerData::get_data(TfToken const &key) const VtValue InstancerData::get_data(TfToken const &key) const