forked from blender/blender
Fix rendering of Final render for Storm delegate #61
@ -91,10 +91,8 @@ class HydraRenderEngine(bpy.types.RenderEngine):
|
|||||||
return {}
|
return {}
|
||||||
|
|
||||||
# final render
|
# final render
|
||||||
def update(self, data, depsgraph):
|
def _update(self, depsgraph):
|
||||||
# Note: if bl_use_gpu_context = True, leave this function empty and move engine creation
|
"""This function is preferable to override in child classes instead of update()"""
|
||||||
|
|||||||
# and syncing to render() function
|
|
||||||
|
|
||||||
engine_type = 'PREVIEW' if self.is_preview else 'FINAL'
|
engine_type = 'PREVIEW' if self.is_preview else 'FINAL'
|
||||||
self.engine_ptr = _bpy_hydra.engine_create(self.as_pointer(), engine_type, self.delegate_id)
|
self.engine_ptr = _bpy_hydra.engine_create(self.as_pointer(), engine_type, self.delegate_id)
|
||||||
if not self.engine_ptr:
|
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())
|
_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):
|
def render(self, depsgraph):
|
||||||
|
if self.bl_use_gpu_context:
|
||||||
|
self._update(depsgraph)
|
||||||
|
|
||||||
if not self.engine_ptr:
|
if not self.engine_ptr:
|
||||||
return
|
return
|
||||||
|
|
||||||
|
@ -154,7 +154,7 @@ pxr::HdCullStyle MeshData::cull_style(pxr::SdfPath const &id) const
|
|||||||
if (sm.mat_data) {
|
if (sm.mat_data) {
|
||||||
return sm.mat_data->cull_style();
|
return sm.mat_data->cull_style();
|
||||||
}
|
}
|
||||||
return pxr::HdCullStyle::HdCullStyleDontCare;
|
return pxr::HdCullStyle::HdCullStyleNothing;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool MeshData::double_sided(pxr::SdfPath const &id) const
|
bool MeshData::double_sided(pxr::SdfPath const &id) const
|
||||||
|
Loading…
Reference in New Issue
Block a user
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"