Fix rendering of Final render for Storm delegate #61

Merged
Bogdan Nagirniak merged 11 commits from BLEN-437 into hydra-render 2023-07-12 23:18:03 +02:00
2 changed files with 11 additions and 5 deletions
Showing only changes of commit 987b4ab9fc - Show all commits

View File

@ -91,10 +91,8 @@ class HydraRenderEngine(bpy.types.RenderEngine):
return {}
# final render
def update(self, data, depsgraph):
# Note: if bl_use_gpu_context = True, leave this function empty and move engine creation
# and syncing to render() function
def _update(self, depsgraph):
"""This function is preferable to override in child classes instead of update()"""

is bl_use_gpu_context is true why not just automatically use render()

Then say something here like "if use gpu context is true, this function is ignored and render() is used"

is bl_use_gpu_context is true why not just automatically use render() Then say something here like "if use gpu context is true, this function is ignored and render() is used"
engine_type = 'PREVIEW' if self.is_preview else 'FINAL'
self.engine_ptr = _bpy_hydra.engine_create(self.as_pointer(), engine_type, self.delegate_id)
if not self.engine_ptr:
@ -105,7 +103,15 @@ class HydraRenderEngine(bpy.types.RenderEngine):
_bpy_hydra.engine_sync(self.engine_ptr, depsgraph.as_pointer(), bpy.context.as_pointer())
def update(self, data, depsgraph):
# If bl_use_gpu_context is true, this function is ignored and render() is used
if not self.bl_use_gpu_context:
self._update(depsgraph)
def render(self, depsgraph):
if self.bl_use_gpu_context:
self._update(depsgraph)
if not self.engine_ptr:
return

View File

@ -154,7 +154,7 @@ pxr::HdCullStyle MeshData::cull_style(pxr::SdfPath const &id) const
if (sm.mat_data) {
return sm.mat_data->cull_style();
}
return pxr::HdCullStyle::HdCullStyleDontCare;
return pxr::HdCullStyle::HdCullStyleNothing;
}
bool MeshData::double_sided(pxr::SdfPath const &id) const