Add possibility to render USD file for testing purposes #14

Merged
Bogdan Nagirniak merged 6 commits from BLEN-428 into storm-hydra-addon 2023-06-02 15:55:44 +02:00
Showing only changes of commit d6179c7cee - Show all commits

View File

@ -26,7 +26,7 @@ class Panel(bpy.types.Panel):
class STORM_HYDRA_RENDER_PT_final(Panel): class STORM_HYDRA_RENDER_PT_final(Panel):
"""Final render delegate and settings""" """Final render delegate and settings"""
bl_idname = 'STORM_HYDRA_RENDER_PT_final' bl_idname = 'STORM_HYDRA_RENDER_PT_final'
bl_label = "Storm Final Settings" bl_label = "Final Render Settings"
def draw(self, context): def draw(self, context):
layout = self.layout layout = self.layout
@ -38,25 +38,19 @@ class STORM_HYDRA_RENDER_PT_final(Panel):
layout.prop(settings, 'max_lights') layout.prop(settings, 'max_lights')
class FinalPanel(bpy.types.Panel): class STORM_HYDRA_RENDER_PT_volume_final(bpy.types.Panel):
bl_parent_id = STORM_HYDRA_RENDER_PT_final.bl_idname bl_parent_id = STORM_HYDRA_RENDER_PT_final.bl_idname
bl_label = "Volume Raymarching"
bl_space_type = 'PROPERTIES' bl_space_type = 'PROPERTIES'
bl_region_type = 'WINDOW' bl_region_type = 'WINDOW'
bl_options = {'DEFAULT_CLOSED'} bl_options = {'DEFAULT_CLOSED'}
def settings(self, context):
return context.scene.hydra_storm.final
class STORM_HYDRA_RENDER_PT_volume_final(FinalPanel):
bl_label = "Volume Raymarching"
def draw(self, context): def draw(self, context):
layout = self.layout layout = self.layout
layout.use_property_split = True layout.use_property_split = True
layout.use_property_decorate = False layout.use_property_decorate = False
settings = self.settings(context) settings = context.scene.hydra_storm.final
col = layout.column(align=True) col = layout.column(align=True)
col.prop(settings, "volume_raymarching_step_size", text="Step Size") col.prop(settings, "volume_raymarching_step_size", text="Step Size")
@ -70,7 +64,7 @@ class STORM_HYDRA_RENDER_PT_volume_final(FinalPanel):
class STORM_HYDRA_RENDER_PT_viewport(Panel): class STORM_HYDRA_RENDER_PT_viewport(Panel):
"""Viewport render delegate and settings""" """Viewport render delegate and settings"""
bl_idname = 'STORM_HYDRA_RENDER_PT_viewport' bl_idname = 'STORM_HYDRA_RENDER_PT_viewport'
bl_label = "Storm Viewport Settings" bl_label = "Viewport Render Settings"
def draw(self, context): def draw(self, context):
layout = self.layout layout = self.layout
@ -82,25 +76,19 @@ class STORM_HYDRA_RENDER_PT_viewport(Panel):
layout.prop(settings, 'max_lights') layout.prop(settings, 'max_lights')
class ViewportPanel(bpy.types.Panel): class STORM_HYDRA_RENDER_PT_volume_viewport(bpy.types.Panel):
bl_parent_id = STORM_HYDRA_RENDER_PT_viewport.bl_idname bl_parent_id = STORM_HYDRA_RENDER_PT_viewport.bl_idname
bl_label = "Volume Raymarching"
bl_space_type = 'PROPERTIES' bl_space_type = 'PROPERTIES'
bl_region_type = 'WINDOW' bl_region_type = 'WINDOW'
bl_options = {'DEFAULT_CLOSED'} bl_options = {'DEFAULT_CLOSED'}
def settings(self, context):
return context.scene.hydra_storm.viewport
class STORM_HYDRA_RENDER_PT_volume_viewport(ViewportPanel):
bl_label = "Volume Raymarching"
def draw(self, context): def draw(self, context):
layout = self.layout layout = self.layout
layout.use_property_split = True layout.use_property_split = True
layout.use_property_decorate = False layout.use_property_decorate = False
settings = self.settings(context) settings = context.scene.hydra_storm.viewport
col = layout.column(align=True) col = layout.column(align=True)
col.prop(settings, "volume_raymarching_step_size", text="Step Size") col.prop(settings, "volume_raymarching_step_size", text="Step Size")
@ -109,9 +97,7 @@ class STORM_HYDRA_RENDER_PT_volume_viewport(ViewportPanel):
class STORM_HYDRA_LIGHT_PT_light(Panel): class STORM_HYDRA_LIGHT_PT_light(Panel):
""" """Physical light sources"""
Physical light sources
"""
bl_label = "Light" bl_label = "Light"
bl_context = 'data' bl_context = 'data'
@ -169,8 +155,7 @@ class STORM_HYDRA_RENDER_PT_dev(Panel):
@classmethod @classmethod
def poll(cls, context): def poll(cls, context):
preferences = addon_preferences() return addon_preferences().dev_tools
return preferences.dev_tools if preferences else True
def draw(self, context): def draw(self, context):
layout = self.layout layout = self.layout