forked from blender/blender-addons
Remove USD file development options, will be handled in Blender instead #18
@ -22,17 +22,6 @@ class StormHydraRenderEngine(bpy_hydra.HydraRenderEngine):
|
||||
|
||||
brecht marked this conversation as resolved
|
||||
delegate_id = 'HdStormRendererPlugin'
|
||||
|
||||
def __init__(self):
|
||||
self._usd_stage = None
|
||||
|
||||
def _sync_usd_stage(self):
|
||||
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
|
||||
@ -44,16 +33,6 @@ class StormHydraRenderEngine(bpy_hydra.HydraRenderEngine):
|
||||
'maxLights': settings.max_lights,
|
||||
}
|
||||
|
||||
def update(self, data, depsgraph):
|
||||
super().update(data, depsgraph)
|
||||
if self.engine_ptr:
|
||||
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):
|
||||
)
|
||||
|
||||
|
||||
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
Seems like this should be
bl_idname = 'HYDRA_STORM'
.