forked from blender/blender
BLEN-365: Improve creation algorithm of PreviewEngine #21
@ -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)
|
||||
|
||||
def render(self, depsgraph):
|
||||
if hasattr(self, 'engine_ptr'):
|
||||
if self.engine_ptr:
|
||||
_bpy_hydra.engine_render(self.engine_ptr, depsgraph.as_pointer())
|
||||
|
||||
# viewport render
|
||||
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)
|
||||
|
||||
delegate_settings = self.get_delegate_settings('VIEWPORT')
|
||||
|
@ -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
|
||||
|
@ -27,7 +27,6 @@ class RenderTaskDelegate : public pxr::HdSceneDelegate {
|
||||
|
||||
pxr::HdTaskSharedPtr get_task();
|
||||
void set_camera_and_viewport(pxr::SdfPath const &cameraId, pxr::GfVec4d const &viewport);
|
||||
void clear_renderer_aovs();
|
||||
|
||||
private:
|
||||
pxr::HdxRenderTaskParams task_params;
|
||||
|
Loading…
Reference in New Issue
Block a user