From 3e118b52c14c4fa403923d42a2e6a761d598b369 Mon Sep 17 00:00:00 2001 From: Bogdan Nagirniak Date: Wed, 5 Jul 2023 18:32:41 +0300 Subject: [PATCH 1/2] Fix rendering of Final render for Storm delegate. Moved engine creation and syncing to render() function, made update() empty. --- hydra_storm/engine.py | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/hydra_storm/engine.py b/hydra_storm/engine.py index da59db07b..574d1160c 100644 --- a/hydra_storm/engine.py +++ b/hydra_storm/engine.py @@ -26,6 +26,9 @@ class StormHydraRenderEngine(bpy_hydra.HydraRenderEngine): self._usd_stage = None def _sync_usd_stage(self): + if not self.engine_ptr: + return + preferences = addon_preferences() dev = bpy.context.scene.hydra_storm.dev if preferences.dev_tools and not self._usd_stage and dev.render_usd and dev.usd_file: @@ -45,9 +48,15 @@ class StormHydraRenderEngine(bpy_hydra.HydraRenderEngine): } def update(self, data, depsgraph): - super().update(data, depsgraph) - if self.engine_ptr: - self._sync_usd_stage() + # This is empty function because: bl_use_gpu_context = True. + # Engine creation and syncing moved to render() function. + pass + + def render(self, depsgraph): + super().update(None, depsgraph) + self._sync_usd_stage() + + super().render(depsgraph) def view_update(self, context, depsgraph): super().view_update(context, depsgraph) -- 2.30.2 From b6ffb55c164a97683d5cf6355ff2cd32396a1125 Mon Sep 17 00:00:00 2001 From: Bogdan Nagirniak Date: Wed, 12 Jul 2023 18:46:48 +0300 Subject: [PATCH 2/2] Code adjustment: overrided _update() instead of update() --- hydra_storm/engine.py | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/hydra_storm/engine.py b/hydra_storm/engine.py index 574d1160c..3a7cce9c1 100644 --- a/hydra_storm/engine.py +++ b/hydra_storm/engine.py @@ -47,17 +47,10 @@ class StormHydraRenderEngine(bpy_hydra.HydraRenderEngine): 'maxLights': settings.max_lights, } - def update(self, data, depsgraph): - # This is empty function because: bl_use_gpu_context = True. - # Engine creation and syncing moved to render() function. - pass - - def render(self, depsgraph): - super().update(None, depsgraph) + def _update(self, depsgraph): + super()._update(depsgraph) self._sync_usd_stage() - super().render(depsgraph) - def view_update(self, context, depsgraph): super().view_update(context, depsgraph) if self.engine_ptr: -- 2.30.2