BLEN-365: Improve creation algorithm of PreviewEngine #21

Merged
Bogdan Nagirniak merged 11 commits from BLEN-365 into hydra-render 2023-04-10 12:44:48 +02:00
3 changed files with 2 additions and 12 deletions
Showing only changes of commit a1bf008904 - Show all commits

View File

@ -81,12 +81,12 @@ class HydraRenderEngine(bpy.types.RenderEngine):
_bpy_hydra.engine_sync(self.engine_ptr, depsgraph.as_pointer(), bpy.context.as_pointer(), delegate_settings) _bpy_hydra.engine_sync(self.engine_ptr, depsgraph.as_pointer(), bpy.context.as_pointer(), delegate_settings)
def render(self, depsgraph): def render(self, depsgraph):
if hasattr(self, 'engine_ptr'): if self.engine_ptr:
_bpy_hydra.engine_render(self.engine_ptr, depsgraph.as_pointer()) _bpy_hydra.engine_render(self.engine_ptr, depsgraph.as_pointer())
# viewport render # viewport render
def view_update(self, context, depsgraph): def view_update(self, context, depsgraph):
if not hasattr(self, 'engine_ptr'): if not self.engine_ptr:
self.engine_ptr = _bpy_hydra.engine_create(self.as_pointer(), 'VIEWPORT', self.delegate_id) self.engine_ptr = _bpy_hydra.engine_create(self.as_pointer(), 'VIEWPORT', self.delegate_id)
delegate_settings = self.get_delegate_settings('VIEWPORT') delegate_settings = self.get_delegate_settings('VIEWPORT')

View File

@ -132,13 +132,4 @@ void RenderTaskDelegate::set_camera_and_viewport(pxr::SdfPath const &camera_id,
} }
} }
void RenderTaskDelegate::clear_renderer_aovs()
{
for (pxr::HdRenderPassAovBinding &binding : task_params.aovBindings) {
std::cout << "clear_renderer_aovs: " << binding.renderBufferId.GetText() << "\n";
GetRenderIndex().RemoveBprim(pxr::HdPrimTypeTokens->renderBuffer, binding.renderBufferId);
buffer_descriptors.erase(binding.renderBufferId);
}
}
} // namespace blender::render::hydra } // namespace blender::render::hydra

View File

@ -27,7 +27,6 @@ class RenderTaskDelegate : public pxr::HdSceneDelegate {
pxr::HdTaskSharedPtr get_task(); pxr::HdTaskSharedPtr get_task();
void set_camera_and_viewport(pxr::SdfPath const &cameraId, pxr::GfVec4d const &viewport); void set_camera_and_viewport(pxr::SdfPath const &cameraId, pxr::GfVec4d const &viewport);
void clear_renderer_aovs();
private: private:
pxr::HdxRenderTaskParams task_params; pxr::HdxRenderTaskParams task_params;