Storm Hydra render addon #104597
@ -22,20 +22,6 @@ class StormHydraRenderEngine(bpy_hydra.HydraRenderEngine):
|
||||
|
||||
delegate_id = 'HdStormRendererPlugin'
|
||||
|
||||
def __init__(self):
|
||||
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:
|
||||
self._usd_stage = Usd.Stage.Open(dev.usd_file)
|
||||
if self._usd_stage:
|
||||
_bpy_hydra.engine_sync_usd(self.engine_ptr, self._usd_stage)
|
||||
|
||||
def get_render_settings(self, engine_type):
|
||||
settings = bpy.context.scene.hydra_storm.viewport if engine_type == 'VIEWPORT' else \
|
||||
bpy.context.scene.hydra_storm.final
|
||||
@ -47,16 +33,6 @@ class StormHydraRenderEngine(bpy_hydra.HydraRenderEngine):
|
||||
'maxLights': settings.max_lights,
|
||||
}
|
||||
|
||||
def _update(self, depsgraph):
|
||||
super()._update(depsgraph)
|
||||
self._sync_usd_stage()
|
||||
|
||||
def view_update(self, context, depsgraph):
|
||||
super().view_update(context, depsgraph)
|
||||
if self.engine_ptr:
|
||||
self._sync_usd_stage()
|
||||
|
||||
|
||||
register, unregister = bpy.utils.register_classes_factory((
|
||||
StormHydraRenderEngine,
|
||||
))
|
||||
|
@ -50,29 +50,14 @@ class RenderProperties(bpy.types.PropertyGroup):
|
||||
)
|
||||
brecht marked this conversation as resolved
|
||||
|
||||
|
||||
class DevProperties(bpy.types.PropertyGroup):
|
||||
render_usd: bpy.props.BoolProperty(
|
||||
name="Render USD",
|
||||
description="Render USD file with Blender scene",
|
||||
default=False,
|
||||
)
|
||||
usd_file: bpy.props.StringProperty(
|
||||
name="USD File",
|
||||
description="Select USD file to render",
|
||||
subtype='FILE_PATH',
|
||||
)
|
||||
|
||||
|
||||
class SceneProperties(Properties):
|
||||
type = bpy.types.Scene
|
||||
|
||||
final: bpy.props.PointerProperty(type=RenderProperties)
|
||||
viewport: bpy.props.PointerProperty(type=RenderProperties)
|
||||
dev: bpy.props.PointerProperty(type=DevProperties)
|
||||
|
||||
|
||||
register, unregister = bpy.utils.register_classes_factory((
|
||||
RenderProperties,
|
||||
DevProperties,
|
||||
SceneProperties,
|
||||
))
|
||||
|
@ -149,33 +149,11 @@ class STORM_HYDRA_LIGHT_PT_light(Panel):
|
||||
main_col.prop(light, 'size')
|
||||
|
||||
|
||||
class STORM_HYDRA_RENDER_PT_dev(Panel):
|
||||
"""Final render delegate and settings"""
|
||||
bl_label = "Dev"
|
||||
|
||||
@classmethod
|
||||
def poll(cls, context):
|
||||
return super().poll(context) and addon_preferences().dev_tools
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
layout.use_property_split = True
|
||||
layout.use_property_decorate = False
|
||||
|
||||
dev = context.scene.hydra_storm.dev
|
||||
col = layout.column()
|
||||
col.prop(dev, 'render_usd')
|
||||
row = col.row()
|
||||
row.enabled = dev.render_usd
|
||||
row.prop(dev, 'usd_file')
|
||||
|
||||
|
||||
register_classes, unregister_classes = bpy.utils.register_classes_factory((
|
||||
STORM_HYDRA_RENDER_PT_final,
|
||||
STORM_HYDRA_RENDER_PT_volume_final,
|
||||
STORM_HYDRA_RENDER_PT_viewport,
|
||||
STORM_HYDRA_RENDER_PT_volume_viewport,
|
||||
STORM_HYDRA_RENDER_PT_dev,
|
||||
|
||||
STORM_HYDRA_LIGHT_PT_light,
|
||||
))
|
||||
|
Loading…
Reference in New Issue
Block a user
What happens when the maximum is reach? Why is the default only 16? This needs a better explanation in the description.
It comes from source code https://github.com/PixarAnimationStudios/USD/blob/release/pxr/imaging/hdSt/renderDelegate.cpp#L70
Can you figure out what it does so it can be explained in the description for users?