forked from blender/blender
Fix rendering of Final render for Storm delegate #61
@ -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()"""
|
||||
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
|
||||
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user