O]
130 | 'translucent' : C[DSG]+[O]
131 | 'transmission' : C[DSG]+[O]""",
132 | default=""
133 | )
134 |
135 | material_aov : StringProperty(
136 | name="Material Aov",
137 | description="""If 'result' is 'material aov', this attribute specifies a material aov expression to output. The expression format is:
138 | [('')+\.][('')+\.][('')+\.][(SS|R|T|D|G|M)+\.][fresnel\.]. Where:
139 | is a label associated with the geometry
140 | is a label associated with the material
141 | is a lobe label
142 | R means reflection side lobe
143 | T means transmission side lobe
144 | D means diffuse lobe category
145 | G means glossy lobe category
146 | M means mirror lobe category
147 | SS means sub-surface component of the material
148 | fresnel means to select the lobe's or sub-surface's fresnel
149 | can be one of:
150 | 'albedo' (bsdf lobe | subsurface) (RGB),
151 | 'color' (bsdf lobe | subsurface | fresnel) (RGB),
152 | 'depth' (state variable) (FLOAT),
153 | 'dPds' (state variable) (VEC3F),
154 | 'dPdt' (state variable) (VEC3F),
155 | 'dSdx' (state variable) (FLOAT),
156 | 'dSdy' (state variable) (FLOAT),
157 | 'dTdx' (state variable) (FLOAT),
158 | 'dTdy' (state variable) (FLOAT),
159 | 'emission' (bsdf) (RGB),
160 | 'factor' (fresnel) (FLOAT),
161 | 'float:' (primitive attribute) (FLOAT),
162 | 'matte' (bsdf lobe | subsurface) (FLOAT),
163 | 'motionvec' (state variable) (VEC2F),
164 | 'N' (state variable) (VEC3F),
165 | 'Ng' (state variable) (VEC3F),
166 | 'normal' (bsdf lobe | subsurface) (VEC3F),
167 | 'P' (state variable) (VEC3F),
168 | 'pbr_validity' (bsdf lobe | subsurface) (RGB),
169 | 'radius' (subsurface) (RGB),
170 | 'rgb:' (primitive attribute) (RGB),
171 | 'roughness' (bsdf lobe) (fresnel) (VEC2F),
172 | 'St' (state variable) (VEC2F),
173 | 'vec2:' (primitive attribute) (VEC2F),
174 | 'vec3:' (primitive attribute) (VEC3F),
175 | 'Wp' (state variable) (VEC3F)
176 | Examples:
177 | albedo : Albedo of all rendered materials
178 | R.albedo : Total reflection albedo
179 | 'spec'.MG.roughness : Roughness of all mirror and glossy lobes that have the 'spec' label""",
180 | default=""
181 | )
182 |
183 | math_filter : EnumProperty(
184 | name="Math Filter",
185 | description="the math filter over the pixel",
186 | items=[
187 | ("0", "Average", ""),
188 | ("1", "Sum", ""),
189 | ("2", "Min", ""),
190 | ("3", "Max", ""),
191 | ("4", "Force_Consistent_Sampling", "Average of the first 'min_adaptive_samples'"),
192 | ("5", "Closest", "Use sample with minimum z-depth")
193 | ],
194 | default="5"
195 | )
196 |
197 | output_type : StringProperty(
198 | name="Output Type",
199 | description="Specifies the type of output. Defaults to 'flat', meaning a flat exr file. 'deep' will output a deep exr file",
200 | default="flat"
201 | )
202 |
203 | primitive_attribute : StringProperty(
204 | name="Primtive Attribute",
205 | description="If 'result' is 'primitive attribute', this attribute specifies the particular primitive attribute to output. Default channel name is based on primitive attribute name and type",
206 | default=""
207 | )
208 |
209 | primitive_attribute_type : EnumProperty(
210 | name="Primitive Attribute Type",
211 | description="This attribute specifies the type of the attribute named with the 'primitive attribute' setting. This is required to uniquely specify the primitive attribute",
212 | items=[
213 | ("0", "Float", ""),
214 | ("1", "Vec2f", ""),
215 | ("2", "Vec3f", ""),
216 | ("3", "RGB", "")
217 | ],
218 | default="0"
219 | )
220 |
221 | result : EnumProperty(
222 | name="Result",
223 | description="The result to output",
224 | items=[
225 | ("0", "Beauty", "Full render (R, G, B)"),
226 | ("1", "Alpha", "Full render alpha channel (A)"),
227 | ("2", "Depth", "Z distance from camera (Z)"),
228 | ("3", "State Variable", "Built-in state variable"),
229 | ("4", "Primitive Attribute", "Procedural provided attributes"),
230 | ("5", "Time Per Pixel", "Time per pixel heat map metric"),
231 | ("6", "Wireframe", "Render as wireframe"),
232 | ("7", "Material Aov", "Aovs provided via material expressions"),
233 | ("8", "Light Aov", "Aovs provided via light path expressions"),
234 | ("9", "Visiblity Aov", "Fraction of light samples that hit light source"),
235 | ("11", "Weight", "weight"),
236 | ("12", "Beauty Aux", "RenderBuffer auxiliary sample data for adaptive sampling"),
237 | ("13", "Cryptomatte", "Cryptomatte"),
238 | ("14", "Alpha Aux", "Alpha auxiliary sample data for adaptive sampling"),
239 | ("15", "Display Filter", "Output results from a display filter")
240 | ],
241 | default="0"
242 | )
243 |
244 | resume_file_name: StringProperty(
245 | name="Resume File Name",
246 | description="Name of input file for resume render start condition",
247 | default=""
248 | )
249 |
250 | state_variable : EnumProperty(
251 | name="State Variable",
252 | description="If 'result' is 'state variable', this attribute specifies the particular state variable result",
253 | items=[
254 | ("0", "P", "Position (P.X, P.Y, P.Z)"),
255 | ("1", "Ng", "Geometric normal (Ng.X, Ng.Y, Ng.Z)"),
256 | ("2", "N", "Normal (N.X, N.Y, N.Z)"),
257 | ("3", "St", "Texture coordinates (St.X, St.Y)"),
258 | ("4", "dPds", "Derivative of P w.r.t S (dPds.X, dPds.Y, dPds.Z)"),
259 | ("5", "dPdt", "Derivative of P w.r.t T (dPdt.X, dPdt.Y, dPdt.Z)"),
260 | ("6", "dSdx", "S derivative w.r.t. x (dSdx)"),
261 | ("7", "dSdy", "S derivative w.r.t. y (dSdy)"),
262 | ("8", "dTdx", "T derivative w.r.t. x (dTdx)"),
263 | ("9", "dTdy", "T derivative w.r.t. y (dTdy)"),
264 | ("10", "Wp", "World position (Wp.X, Wp.Y, Wp.Z)"),
265 | ("11", "Depth", "Z distance from camera (Z)"),
266 | ("12", "MotionVec", "2D motion vector")
267 | ],
268 | default="2"
269 | )
270 |
271 | visibility_aov : StringProperty(
272 | name="Visibility Aov",
273 | description="If 'result' is 'visibility aov', this attribute specifies a light path expression that defines the set of all paths used to compute the visibility ratio.",
274 | default="C[]*[][LO]"
275 | )
276 |
277 |
278 | classes = [
279 | MoonRayAttributes_RenderOutput
280 | ]
281 |
282 | def register():
283 | for cls in classes:
284 | bpy.utils.register_class(cls)
285 |
286 | def unregister():
287 | for cls in reversed(classes):
288 | bpy.utils.unregister_class(cls)
--------------------------------------------------------------------------------
/props/sets.py:
--------------------------------------------------------------------------------
1 | import bpy
2 | from bpy.props import *
3 |
4 |
5 | # Light Sets
6 |
7 | class MoonRayLightSetItem(bpy.types.PropertyGroup):
8 | name: StringProperty(name="Name")
9 |
10 | class MoonRayLightSets(bpy.types.PropertyGroup):
11 | items: CollectionProperty(type=MoonRayLightSetItem)
12 | index: IntProperty(name="Index", default=0)
13 |
14 | # Light Filter Sets
15 |
16 | class MoonRayLightFilterSetItem(bpy.types.PropertyGroup):
17 | name: StringProperty(name="Name")
18 |
19 | class MoonRayLightFilterSets(bpy.types.PropertyGroup):
20 | items: CollectionProperty(type=MoonRayLightSetItem)
21 | index: IntProperty(name="Index", default=0)
22 |
23 | # Shadow Sets
24 |
25 | class MoonRayShadowSetItem(bpy.types.PropertyGroup):
26 | name: StringProperty(name="Name")
27 |
28 | class MoonRayShadowSets(bpy.types.PropertyGroup):
29 | items: CollectionProperty(type=MoonRayShadowSetItem)
30 | index: IntProperty(name="Index", default=0)
31 |
32 | # Shadow Receiver Sets
33 |
34 | class MoonRayShadowReceiverSetItem(bpy.types.PropertyGroup):
35 | name: StringProperty(name="Name")
36 |
37 | class MoonRayShadowReceiverSets(bpy.types.PropertyGroup):
38 | items: CollectionProperty(type=MoonRayShadowReceiverSetItem)
39 | index: IntProperty(name="Index", default=0)
40 |
41 | # Trace Sets
42 |
43 | class MoonRayTraceSetItem(bpy.types.PropertyGroup):
44 | name: StringProperty(name="Name")
45 |
46 | class MoonRayTraceSets(bpy.types.PropertyGroup):
47 | items: CollectionProperty(type=MoonRayShadowReceiverSetItem)
48 | index: IntProperty(name="Index", default=0)
49 |
50 | classes = [MoonRayLightSetItem, MoonRayLightSets, MoonRayLightFilterSetItem, MoonRayLightFilterSets, MoonRayShadowSetItem, MoonRayShadowSets, MoonRayShadowReceiverSetItem, MoonRayShadowReceiverSets, MoonRayTraceSetItem, MoonRayTraceSets]
51 |
52 | def register():
53 | for cls in classes:
54 | bpy.utils.register_class(cls)
55 |
56 | def unregister():
57 | for cls in reversed(classes):
58 | bpy.utils.unregister_class(cls)
--------------------------------------------------------------------------------
/props/userdata.py:
--------------------------------------------------------------------------------
1 | import bpy
2 | from bpy.props import *
3 | from bpy.types import *
4 |
5 | class MoonRayUserData(bpy.types.PropertyGroup):
6 | name: StringProperty()
7 | type: EnumProperty(
8 | items=[
9 | ("BOOL", "Boolean", ""),
10 | ("COLOR", "Color", ""),
11 | ("FLOAT", "Float", ""),
12 | ("INTEGER", "Integer", ""),
13 | ("MAT4F", "Mat4f", ""),
14 | ("STRING", "String", ""),
15 | ("VEC2F", "Vec2f", ""),
16 | ("VEC3F", "Vec3f", ""),
17 | ],
18 | default="FLOAT"
19 | )
20 | value_bool: BoolProperty(default=False)
21 | value_color: FloatVectorProperty(subtype='COLOR', default=(1.0, 1.0, 1.0))
22 | value_float: FloatProperty(default=0.0)
23 | value_int: IntProperty(default=0)
24 | value_mat4f: FloatVectorProperty(size=16, default=[0.0]*16)
25 | value_string: StringProperty(default="")
26 | value_vec2f: FloatVectorProperty(size=2, default=(0.0, 0.0))
27 | value_vec3f: FloatVectorProperty(size=3, default=(0.0, 0.0, 0.0))
28 |
29 | classes = [MoonRayUserData]
30 |
31 | def register():
32 | for cls in classes:
33 | bpy.utils.register_class(cls)
34 |
35 | def unregister():
36 | for cls in reversed(classes):
37 | bpy.utils.unregister_class(cls)
--------------------------------------------------------------------------------
/ui/__init__.py:
--------------------------------------------------------------------------------
1 | import bpy
2 |
3 | from . import mfb_node_menus
4 | from ..engine import MoonRayRenderEngine
5 |
6 | from . import mfb_light
7 | from . import mfb_object
8 | from . import mfb_view_layer
9 | from . import mfb_render
10 | from . import mfb_output
11 | from . import mfb_menus
12 |
13 | def get_panels():
14 | # Follow the Cycles model of excluding panels we don't want.
15 | exclude_panels = {
16 | 'DATA_PT_light',
17 | 'DATA_PT_spot',
18 | 'NODE_DATA_PT_light',
19 | 'DATA_PT_falloff_curve',
20 | 'SCENE_PT_audio',
21 |
22 |
23 | 'RENDER_PT_stamp',
24 | 'RENDER_PT_post_processing',
25 | 'RENDER_PT_simplify',
26 | 'RENDER_PT_freestyle',
27 | 'RENDER_PT_output',
28 | 'RENDER_PT_stereoscopy',
29 | 'RENDER_PT_time_stretching'
30 | }
31 | include_eevee_panels = {
32 | 'MATERIAL_PT_preview',
33 | 'EEVEE_MATERIAL_PT_context_material',
34 | 'EEVEE_MATERIAL_PT_surface',
35 | 'EEVEE_MATERIAL_PT_volume',
36 | 'EEVEE_MATERIAL_PT_settings',
37 | 'EEVEE_WORLD_PT_surface',
38 | }
39 |
40 | for panel_cls in bpy.types.Panel.__subclasses__():
41 | if hasattr(panel_cls, 'COMPAT_ENGINES') and (
42 | ('BLENDER_RENDER' in panel_cls.COMPAT_ENGINES and panel_cls.__name__ not in exclude_panels) or
43 | ('BLENDER_EEVEE' in panel_cls.COMPAT_ENGINES and panel_cls.__name__ in include_eevee_panels)
44 | ):
45 | yield panel_cls
46 |
47 | def register():
48 | mfb_output.register()
49 | mfb_menus.register()
50 | mfb_node_menus.register()
51 | mfb_light.register()
52 | mfb_object.register()
53 | mfb_view_layer.register()
54 | mfb_render.register()
55 |
56 | for panel_cls in get_panels():
57 | panel_cls.COMPAT_ENGINES.add(MoonRayRenderEngine.bl_idname)
58 |
59 | def unregister():
60 | mfb_output.unregister()
61 | mfb_menus.unregister()
62 | mfb_node_menus.unregister()
63 | mfb_light.unregister()
64 | mfb_object.unregister()
65 | mfb_view_layer.unregister()
66 | mfb_render.unregister()
67 |
68 | for panel_cls in get_panels():
69 | if MoonRayRenderEngine.bl_idname in panel_cls.COMPAT_ENGINES:
70 | panel_cls.COMPAT_ENGINES.remove(MoonRayRenderEngine.bl_idname)
--------------------------------------------------------------------------------
/ui/mfb_light.py:
--------------------------------------------------------------------------------
1 | import bpy
2 |
3 | from .mfb_panel import MOONRAY_PT_Panel
4 |
5 | class MOONRAY_LIGHT_PT_light(MOONRAY_PT_Panel):
6 | """Physical light sources"""
7 | bl_label = "Light"
8 | bl_context = 'data'
9 |
10 | @classmethod
11 | def poll(cls, context):
12 | return super().poll(context) and context.light
13 |
14 | def draw(self, context):
15 | layout = self.layout
16 | scene = context.scene
17 |
18 | moonray = scene.moonray
19 |
20 | light = context.light
21 |
22 | layout.prop(light.moonray, "type", expand=True)
23 |
24 | layout.use_property_split = True
25 | layout.use_property_decorate = False
26 |
27 | main_col = layout.column()
28 |
29 | main_col.prop(light, "color")
30 | main_col.prop(light.moonray, "texture")
31 | main_col.prop(light, "energy")
32 | main_col.separator()
33 |
34 | main_col.prop(light.moonray, "visible")
35 | main_col.prop(light.moonray, "motion_blur")
36 |
37 | layout.prop_search(light.moonray, "lightfilter_set", moonray.lightfilter_sets, "items", text="Light Filter Set", results_are_suggestions=True)
38 | layout.prop(light.moonray, "light_set_input", text="Light Sets")
39 | layout.prop(light.moonray, "shadow_set_input", text="Shadow Sets")
40 |
41 |
42 | classes = [MOONRAY_LIGHT_PT_light]
43 |
44 | def register():
45 | for cls in classes:
46 | bpy.utils.register_class(cls)
47 |
48 | def unregister():
49 | for cls in reversed(classes):
50 | bpy.utils.unregister_class(cls)
--------------------------------------------------------------------------------
/ui/mfb_menus.py:
--------------------------------------------------------------------------------
1 | import bpy
2 | from ..operators.io import MOONRAY_OT_ExportRDL
3 |
4 | # Function to append the export operator to the file menu
5 | def menu_func_export(self, context):
6 | self.layout.operator(MOONRAY_OT_ExportRDL.bl_idname)
7 |
8 | def register():
9 | bpy.types.TOPBAR_MT_file_export.append(menu_func_export)
10 |
11 | def unregister():
12 | bpy.types.TOPBAR_MT_file_export.remove(menu_func_export)
--------------------------------------------------------------------------------
/ui/mfb_node_menus.py:
--------------------------------------------------------------------------------
1 | import bpy
2 |
3 | from ..engine import MoonRayRenderEngine
4 |
5 | class MoonRayShaderNodeMenu(bpy.types.Menu):
6 | bl_idname = "NODE_MT_shader_node_add_moonray"
7 | bl_label = "Add MoonRay Node"
8 |
9 | def draw(self, context):
10 | layout = self.layout
11 | layout.menu("NODE_MT_shader_node_add_moonray_shader", text="Shader")
12 | layout.menu("NODE_MT_shader_node_add_moonray_map", text="Map")
13 | layout.menu("NODE_MT_shader_node_add_moonray_output", text="Output")
14 | layout.menu("NODE_MT_shader_node_add_moonray_normal", text="Normal")
15 | layout.menu("NODE_MT_shader_node_add_moonray_disp", text="Displacement")
16 |
17 | class MoonRayShaderNodeMenu_Shader(bpy.types.Menu):
18 | bl_idname = "NODE_MT_shader_node_add_moonray_shader"
19 | bl_label = "Add MoonRay Node"
20 |
21 | def draw(self, context):
22 | layout = self.layout
23 | layout.operator("node.add_moonray_node", text="Axf").type = 'MoonRayShaderNode_Axf'
24 | layout.operator("node.add_moonray_node", text="Measured").type = 'MoonRayShaderNode_Measured'
25 | layout.operator("node.add_moonray_node", text="Ray Switch").type = 'MoonRayShaderNode_RaySwitch'
26 | layout.operator("node.add_moonray_node", text="Switch").type = 'MoonRayShaderNode_Switch'
27 | layout.operator("node.add_moonray_node", text="UsdPreviewSurface").type = 'MoonRayShaderNode_UsdPreviewSurface'
28 | layout.operator("node.add_moonray_node", text="DwaColorCorrect").type = 'MoonRayShaderNode_DwaColorCorrect'
29 | layout.operator("node.add_moonray_node", text="DwaLayer").type = 'MoonRayShaderNode_DwaLayer'
30 | layout.operator("node.add_moonray_node", text="DwaRefractive").type = 'MoonRayShaderNode_DwaRefractive'
31 | layout.operator("node.add_moonray_node", text="DwaSwitch").type = 'MoonRayShaderNode_DwaSwitch'
32 | layout.operator("node.add_moonray_node", text="GlitterFlake").type = 'MoonRayShaderNode_GlitterFlake'
33 | layout.operator("node.add_moonray_node", text="HairDiffuse").type = 'MoonRayShaderNode_HairDiffuse'
34 | layout.operator("node.add_moonray_node", text="Toon").type = 'MoonRayShaderNode_Toon'
35 | layout.operator("node.add_moonray_node", text="HairToon").type = 'MoonRayShaderNode_HairToon'
36 | layout.operator("node.add_moonray_node", text="DwaAdjust").type = 'MoonRayShaderNode_DwaAdjust'
37 | layout.operator("node.add_moonray_node", text="DwaEmissive").type = 'MoonRayShaderNode_DwaEmissive'
38 | layout.operator("node.add_moonray_node", text="DwaMetal").type = 'MoonRayShaderNode_DwaMetal'
39 | layout.operator("node.add_moonray_node", text="DwaSkin").type = 'MoonRayShaderNode_DwaSkin'
40 | layout.operator("node.add_moonray_node", text="DwaTwoSided").type = 'MoonRayShaderNode_DwaTwoSided'
41 | layout.operator("node.add_moonray_node", text="Hair").type = 'MoonRayShaderNode_Hair'
42 | layout.operator("node.add_moonray_node", text="HairLayer").type = 'MoonRayShaderNode_HairLayer'
43 | layout.operator("node.add_moonray_node", text="DwaBase").type = 'MoonRayShaderNode_DwaBase'
44 | layout.operator("node.add_moonray_node", text="DwaFabric").type = 'MoonRayShaderNode_DwaFabric'
45 | layout.operator("node.add_moonray_node", text="DwaMix").type = 'MoonRayShaderNode_DwaMix'
46 | layout.operator("node.add_moonray_node", text="DwaSolidDielectric").type = 'MoonRayShaderNode_DwaSolidDielectric'
47 | layout.operator("node.add_moonray_node", text="DwaVelvet").type = 'MoonRayShaderNode_DwaVelvet'
48 | layout.operator("node.add_moonray_node", text="HairColorCorrect").type = 'MoonRayShaderNode_HairColorCorrect'
49 | layout.operator("node.add_moonray_node", text="MacroFlake").type = 'MoonRayShaderNode_MacroFlake'
50 |
51 | class MoonRayShaderNodeMenu_Map(bpy.types.Menu):
52 | bl_idname = "NODE_MT_shader_node_add_moonray_map"
53 | bl_label = "Add MoonRay Node"
54 |
55 | def draw(self, context):
56 | layout = self.layout
57 | layout.menu("NODE_MT_shader_node_add_moonray_map_usd", text="Usd")
58 | layout.menu("NODE_MT_shader_node_add_moonray_map_color", text="Color")
59 | layout.operator("node.add_moonray_node", text="Attribute").type = 'MoonRayShaderNode_Map_Attribute'
60 | layout.operator("node.add_moonray_node", text="Debug").type = 'MoonRayShaderNode_Map_Debug'
61 | layout.operator("node.add_moonray_node", text="List").type = 'MoonRayShaderNode_Map_List'
62 | layout.operator("node.add_moonray_node", text="Checkerboard").type = 'MoonRayShaderNode_Map_Checkerboard'
63 | layout.operator("node.add_moonray_node", text="ExtraAov").type = 'MoonRayShaderNode_Map_ExtraAov'
64 | layout.operator("node.add_moonray_node", text="OpenVdb").type = 'MoonRayShaderNode_Map_OpenVdb'
65 | layout.operator("node.add_moonray_node", text="Image").type = 'MoonRayShaderNode_Map_Image'
66 | layout.operator("node.add_moonray_node", text="UsdTransform2d").type = 'MoonRayShaderNode_Map_UsdTransform2d'
67 | layout.operator("node.add_moonray_node", text="AxisAngle").type = 'MoonRayShaderNode_Map_AxisAngle'
68 | layout.operator("node.add_moonray_node", text="ColorCorrectLegacy").type = 'MoonRayShaderNode_Map_ColorCorrectLegacy'
69 | layout.operator("node.add_moonray_node", text="Directional").type = 'MoonRayShaderNode_Map_Directional'
70 | layout.operator("node.add_moonray_node", text="LOD").type = 'MoonRayShaderNode_Map_LOD'
71 | layout.operator("node.add_moonray_node", text="ProjectSpherical").type = 'MoonRayShaderNode_Map_ProjectSpherical'
72 | layout.operator("node.add_moonray_node", text="SwitchColor").type = 'MoonRayShaderNode_Map_SwitchColor'
73 | layout.operator("node.add_moonray_node", text="Blend").type = 'MoonRayShaderNode_Map_Blend'
74 | layout.operator("node.add_moonray_node", text="ColorCorrect").type = 'MoonRayShaderNode_Map_ColorCorrect'
75 | layout.operator("node.add_moonray_node", text="FloatToRgb").type = 'MoonRayShaderNode_Map_FloatToRgb'
76 | layout.operator("node.add_moonray_node", text="Noise").type = 'MoonRayShaderNode_Map_Noise'
77 | layout.operator("node.add_moonray_node", text="ProjectTriplanar").type = 'MoonRayShaderNode_Map_ProjectTriplanar'
78 | layout.operator("node.add_moonray_node", text="SwitchFloat").type = 'MoonRayShaderNode_Map_SwitchFloat'
79 | layout.operator("node.add_moonray_node", text="Clamp").type = 'MoonRayShaderNode_Map_Clamp'
80 | layout.operator("node.add_moonray_node", text="ColorCorrectNuke").type = 'MoonRayShaderNode_Map_ColorCorrectNuke'
81 | layout.operator("node.add_moonray_node", text="Gradient").type = 'MoonRayShaderNode_Map_Gradient'
82 | layout.operator("node.add_moonray_node", text="NoiseWorley").type = 'MoonRayShaderNode_Map_NoiseWorley'
83 | layout.operator("node.add_moonray_node", text="ProjectTriplanarUdim").type = 'MoonRayShaderNode_Map_ProjectTriplanarUdim'
84 | layout.operator("node.add_moonray_node", text="Template").type = 'MoonRayShaderNode_Map_Template'
85 | layout.operator("node.add_moonray_node", text="ColorCorrectSaturation").type = 'MoonRayShaderNode_Map_ColorCorrectSaturation'
86 | layout.operator("node.add_moonray_node", text="HairColorPresets").type = 'MoonRayShaderNode_Map_HairColorPresets'
87 | layout.operator("node.add_moonray_node", text="NormalToRgb").type = 'MoonRayShaderNode_Map_NormalToRgb'
88 | layout.operator("node.add_moonray_node", text="Ramp").type = 'MoonRayShaderNode_Map_Ramp'
89 | layout.operator("node.add_moonray_node", text="Toon").type = 'MoonRayShaderNode_Map_Toon'
90 | layout.operator("node.add_moonray_node", text="ColorCorrectContrast").type = 'MoonRayShaderNode_Map_ColorCorrectContrast'
91 | layout.operator("node.add_moonray_node", text="ColorCorrectTMI").type = 'MoonRayShaderNode_Map_ColorCorrectTMI'
92 | layout.operator("node.add_moonray_node", text="HairColumn").type = 'MoonRayShaderNode_Map_HairColumn'
93 | layout.operator("node.add_moonray_node", text="Op").type = 'MoonRayShaderNode_Map_Op'
94 | layout.operator("node.add_moonray_node", text="Random").type = 'MoonRayShaderNode_Map_Random'
95 | layout.operator("node.add_moonray_node", text="TransformNormal").type = 'MoonRayShaderNode_Map_TransformNormal'
96 | layout.operator("node.add_moonray_node", text="ColorCorrectGainOffset").type = 'MoonRayShaderNode_Map_ColorCorrectGainOffset'
97 | layout.operator("node.add_moonray_node", text="ConstantColor").type = 'MoonRayShaderNode_Map_ConstantColor'
98 | layout.operator("node.add_moonray_node", text="Hair").type = 'MoonRayShaderNode_Map_Hair'
99 | layout.operator("node.add_moonray_node", text="OpSqrt").type = 'MoonRayShaderNode_Map_OpSqrt'
100 | layout.operator("node.add_moonray_node", text="Remap").type = 'MoonRayShaderNode_Map_Remap'
101 | layout.operator("node.add_moonray_node", text="TransformSpace").type = 'MoonRayShaderNode_Map_TransformSpace'
102 | layout.operator("node.add_moonray_node", text="ColorCorrectGamma").type = 'MoonRayShaderNode_Map_ColorCorrectGamma'
103 | layout.operator("node.add_moonray_node", text="ConstantScalar").type = 'MoonRayShaderNode_Map_ConstantScalar'
104 | layout.operator("node.add_moonray_node", text="HsvToRgb").type = 'MoonRayShaderNode_Map_HsvToRgb'
105 | layout.operator("node.add_moonray_node", text="ProjectCamera").type = 'MoonRayShaderNode_Map_ProjectCamera'
106 | layout.operator("node.add_moonray_node", text="RgbToFloat").type = 'MoonRayShaderNode_Map_RgbToFloat'
107 | layout.operator("node.add_moonray_node", text="UVTransform").type = 'MoonRayShaderNode_Map_UVTransform'
108 | layout.operator("node.add_moonray_node", text="ColorCorrectHsv").type = 'MoonRayShaderNode_Map_ColorCorrectHsv'
109 | layout.operator("node.add_moonray_node", text="Curvature").type = 'MoonRayShaderNode_Map_Curvature'
110 | layout.operator("node.add_moonray_node", text="Layer").type = 'MoonRayShaderNode_Map_Layer'
111 | layout.operator("node.add_moonray_node", text="ProjectCylindrical").type = 'MoonRayShaderNode_Map_ProjectCylindrical'
112 | layout.operator("node.add_moonray_node", text="RgbToHsv").type = 'MoonRayShaderNode_Map_RgbToHsv'
113 | layout.operator("node.add_moonray_node", text="Wireframe").type = 'MoonRayShaderNode_Map_Wireframe'
114 | layout.operator("node.add_moonray_node", text="ColorCorrectHueShift").type = 'MoonRayShaderNode_Map_ColorCorrectHueShift'
115 | layout.operator("node.add_moonray_node", text="Deformation").type = 'MoonRayShaderNode_Map_Deformation'
116 | layout.operator("node.add_moonray_node", text="LcToRgb").type = 'MoonRayShaderNode_Map_LcToRgb'
117 | layout.operator("node.add_moonray_node", text="ProjectPlanar").type = 'MoonRayShaderNode_Map_ProjectPlanar'
118 | layout.operator("node.add_moonray_node", text="RgbToLab").type = 'MoonRayShaderNode_Map_RgbToLab'
119 |
120 | class MoonRayShaderNodeMenu_Map_USD(bpy.types.Menu):
121 | bl_idname = "NODE_MT_shader_node_add_moonray_map_usd"
122 | bl_label = "Add MoonRay Node"
123 |
124 | def draw(self, context):
125 | layout = self.layout
126 | layout.operator("node.add_moonray_node", text="UsdPrimvarReader_float2").type = 'MoonRayShaderNode_Map_UsdPrimvarReader_float2'
127 | layout.operator("node.add_moonray_node", text="UsdPrimvarReader_point").type = 'MoonRayShaderNode_Map_UsdPrimvarReader_point'
128 | layout.operator("node.add_moonray_node", text="UsdUVTexture").type = 'MoonRayShaderNode_Map_UsdUVTexture'
129 | layout.operator("node.add_moonray_node", text="UsdPrimvarReader_float3").type = 'MoonRayShaderNode_Map_UsdPrimvarReader_float3'
130 | layout.operator("node.add_moonray_node", text="UsdPrimvarReader_vector").type = 'MoonRayShaderNode_Map_UsdPrimvarReader_vector'
131 |
132 | class MoonRayShaderNodeMenu_Map_Color(bpy.types.Menu):
133 | bl_idname = "NODE_MT_shader_node_add_moonray_map_color"
134 | bl_label = "Add MoonRay Node"
135 |
136 | def draw(self, context):
137 | layout = self.layout
138 |
139 |
140 |
141 | class MoonRayShaderNodeMenu_Displacement(bpy.types.Menu):
142 | bl_idname = "NODE_MT_shader_node_add_moonray_disp"
143 | bl_label = "Add MoonRay Node"
144 |
145 | def draw(self, context):
146 | layout = self.layout
147 | layout.operator("node.add_moonray_node", text="Combine Displacement").type = 'MoonRayShaderNode_CombineDisplacement'
148 | layout.operator("node.add_moonray_node", text="Normal Displacement").type = 'MoonRayShaderNode_NormalDisplacement'
149 | layout.operator("node.add_moonray_node", text="Switch Displacement").type = 'MoonRayShaderNode_SwitchDisplacement'
150 | layout.operator("node.add_moonray_node", text="Vector Displacement").type = 'MoonRayShaderNode_VectorDisplacement'
151 |
152 | class MoonRayShaderNodeMenu_Normal(bpy.types.Menu):
153 | bl_idname = "NODE_MT_shader_node_add_moonray_normal"
154 | bl_label = "Add MoonRay Node"
155 |
156 | def draw(self, context):
157 | layout = self.layout
158 | layout.operator("node.add_moonray_node", text="Combine Normal Map").type = 'MoonRayShaderNode_CombineNormalMap'
159 | layout.operator("node.add_moonray_node", text="Distort Normal Map").type = 'MoonRayShaderNode_DistortNormalMap'
160 | layout.operator("node.add_moonray_node", text="Image Normal Map").type = 'MoonRayShaderNode_ImageNormalMap'
161 | layout.operator("node.add_moonray_node", text="Project Camera Normal Map").type = 'MoonRayShaderNode_ProjectCameraNormalMap'
162 | layout.operator("node.add_moonray_node", text="Project Planar Normal Map").type = 'MoonRayShaderNode_ProjectPlanarNormalMap'
163 | layout.operator("node.add_moonray_node", text="Project Triplanar Normal Map").type = 'MoonRayShaderNode_ProjectTriplanarNormalMap'
164 | layout.operator("node.add_moonray_node", text="Project Triplanar Normal Map (v2)").type = 'MoonRayShaderNode_ProjectTriplanarNormalMap_v2'
165 | layout.operator("node.add_moonray_node", text="Random Normal Map").type = 'MoonRayShaderNode_RandomNormalMap'
166 | layout.operator("node.add_moonray_node", text="Rgb to Normal Map").type = 'MoonRayShaderNode_RgbToNormalMap'
167 | layout.operator("node.add_moonray_node", text="Switch Normal Map").type = 'MoonRayShaderNode_SwitchNormalMap'
168 | layout.operator("node.add_moonray_node", text="Transform Normal Map").type = 'MoonRayShaderNode_TransformNormalMap'
169 |
170 |
171 | class MoonRayShaderNodeMenu_Output(bpy.types.Menu):
172 | bl_idname = "NODE_MT_shader_node_add_moonray_output"
173 | bl_label = "Add MoonRay Node"
174 |
175 | def draw(self, context):
176 | layout = self.layout
177 | layout.operator("node.add_moonray_node", text="MoonRay Output").type = 'MoonRayShaderNode_Output'
178 | layout.operator("node.add_moonray_node", text="Bake Camera").type = 'MoonRayShaderNode_BakeCamera'
179 |
180 |
181 |
182 | # Light Nodes
183 | class MoonRayLightShaderNodeMenu(bpy.types.Menu):
184 | bl_idname = "NODE_MT_lightshader_node_add_moonray"
185 | bl_label = "Add MoonRay Node"
186 |
187 | def draw(self, context):
188 | layout = self.layout
189 | layout.menu("NODE_MT_lightshader_node_add_moonray_lightfilter", text="Light Filter")
190 | layout.menu("NODE_MT_lightshader_node_add_moonray_output", text="Output")
191 |
192 | class MoonRayLightShaderNodeMenu_LightFilter(bpy.types.Menu):
193 | bl_idname = "NODE_MT_lightshader_node_add_moonray_lightfilter"
194 | bl_label = "Add MoonRay Node"
195 |
196 | def draw(self, context):
197 | layout = self.layout
198 | layout.operator("node.add_moonray_node", text="Barndoor Light Filter").type = 'MoonRayLightShaderNode_BarnDoorLightFilter'
199 | layout.operator("node.add_moonray_node", text="Color Ramp Light Filter").type = 'MoonRayLightShaderNode_ColorRampLightFilter'
200 | layout.operator("node.add_moonray_node", text="Combine Light Filter").type = 'MoonRayLightShaderNode_CombineLightFilter'
201 | layout.operator("node.add_moonray_node", text="Cookie Light Filter").type = 'MoonRayLightShaderNode_CookieLightFilter'
202 | layout.operator("node.add_moonray_node", text="Cookie Light Filter (v2)").type = 'MoonRayLightShaderNode_CookieLightFilter_v2'
203 | layout.operator("node.add_moonray_node", text="Decay Light Filter").type = 'MoonRayLightShaderNode_DecayLightFilter'
204 | layout.operator("node.add_moonray_node", text="Intensity Light Filter").type = 'MoonRayLightShaderNode_IntensityLightFilter'
205 | layout.operator("node.add_moonray_node", text="Rod Light Filter").type = 'MoonRayLightShaderNode_RodLightFilter'
206 | layout.operator("node.add_moonray_node", text="Vdb Light Filter").type = 'MoonRayLightShaderNode_VdbLightFilter'
207 |
208 | class MoonRayLightShaderNodeMenu_Output(bpy.types.Menu):
209 | bl_idname = "NODE_MT_lightshader_node_add_moonray_output"
210 | bl_label = "Add MoonRay Node"
211 |
212 | def draw(self, context):
213 | layout = self.layout
214 | layout.operator("node.add_moonray_node", text="MoonRay Light Output").type = 'MoonRayLightShaderNode_Output'
215 |
216 | # World Nodes
217 | class MoonRayWorldShaderNodeMenu(bpy.types.Menu):
218 | bl_idname = "NODE_MT_worldshader_node_add_moonray"
219 | bl_label = "Add MoonRay Node"
220 |
221 | def draw(self, context):
222 | layout = self.layout
223 | layout.menu("NODE_MT_worldshader_node_add_moonray_light", text="Light")
224 | layout.menu("NODE_MT_worldshader_node_add_moonray_output", text="Output")
225 |
226 | class MoonRayWorldShaderNodeMenu_Light(bpy.types.Menu):
227 | bl_idname = "NODE_MT_worldshader_node_add_moonray_output"
228 | bl_label = "Add MoonRay Node"
229 |
230 | def draw(self, context):
231 | layout = self.layout
232 | layout.operator("node.add_moonray_node", text="MoonRay World Output").type = 'MoonRayWorldShaderNode_Output'
233 |
234 | class MoonRayWorldShaderNodeMenu_Output(bpy.types.Menu):
235 | bl_idname = "NODE_MT_worldshader_node_add_moonray_output"
236 | bl_label = "Add MoonRay Node"
237 |
238 | def draw(self, context):
239 | layout = self.layout
240 | layout.operator("node.add_moonray_node", text="MoonRay World Output").type = 'MoonRayWorldShaderNode_Output'
241 |
242 | # Compositor Nodes
243 |
244 | class MoonRayCompNodeMenu(bpy.types.Menu):
245 | bl_idname = "NODE_MT_comp_node_add_moonray"
246 | bl_label = "MoonRay"
247 |
248 | def draw(self, context):
249 | layout = self.layout
250 | layout.menu("NODE_MT_comp_node_add_moonray_displayfilter", text="Display Filter")
251 |
252 | class MoonRayCompNodeMenu_DisplayFilter(bpy.types.Menu):
253 | bl_idname = "NODE_MT_comp_node_add_moonray_displayfilter"
254 | bl_label = "Display Filter"
255 |
256 | def draw(self, context):
257 | layout = self.layout
258 | layout.operator("node.add_moonray_node", text="Blend Display Filter").type = 'MoonRayCompNode_BlendDisplayFilter'
259 | layout.operator("node.add_moonray_node", text="Clamp Display Filter").type = 'MoonRayCompNode_ClampDisplayFilter'
260 | layout.operator("node.add_moonray_node", text="Color Correct Display Filter").type = 'MoonRayCompNode_ColorCorrectDisplayFilter'
261 | layout.operator("node.add_moonray_node", text="Constant Display Filter").type = 'MoonRayCompNode_ConstantDisplayFilter'
262 | layout.operator("node.add_moonray_node", text="Convolution Display Filter").type = 'MoonRayCompNode_ConvolutionDisplayFilter'
263 | layout.operator("node.add_moonray_node", text="Discretize Display Filter").type = 'MoonRayCompNode_DiscretizeDisplayFilter'
264 | layout.operator("node.add_moonray_node", text="Dof Display Filter").type = 'MoonRayCompNode_DofDisplayFilter'
265 | layout.operator("node.add_moonray_node", text="Halftone Display Filter").type = 'MoonRayCompNode_HalftoneDisplayFilter'
266 | layout.operator("node.add_moonray_node", text="Image Display Filter").type = 'MoonRayCompNode_ImageDisplayFilter'
267 | layout.operator("node.add_moonray_node", text="Op Display Filter").type = 'MoonRayCompNode_OpDisplayFilter'
268 | layout.operator("node.add_moonray_node", text="Over Display Filter").type = 'MoonRayCompNode_OverDisplayFilter'
269 | layout.operator("node.add_moonray_node", text="Ramp Display Filter").type = 'MoonRayCompNode_RampDisplayFilter'
270 | layout.operator("node.add_moonray_node", text="Remap Display Filter").type = 'MoonRayCompNode_RemapDisplayFilter'
271 | layout.operator("node.add_moonray_node", text="RgbToFloat Display Filter").type = 'MoonRayCompNode_RgbToFloatDisplayFilter'
272 | layout.operator("node.add_moonray_node", text="RgbToHsv Display Filter").type = 'MoonRayCompNode_RgbToHsvDisplayFilter'
273 | layout.operator("node.add_moonray_node", text="Shadow Display Filter").type = 'MoonRayCompNode_ShadowDisplayFilter'
274 | layout.operator("node.add_moonray_node", text="TangentSpace Display Filter").type = 'MoonRayCompNode_TangentSpaceDisplayFilter'
275 | layout.operator("node.add_moonray_node", text="Toon Display Filter").type = 'MoonRayCompNode_ToonDisplayFilter'
276 |
277 |
278 | classes = [MoonRayShaderNodeMenu_Shader, MoonRayShaderNodeMenu_Map, MoonRayShaderNodeMenu_Map_USD, MoonRayShaderNodeMenu_Map_Color,
279 | MoonRayShaderNodeMenu_Output, MoonRayShaderNodeMenu_Displacement, MoonRayShaderNodeMenu_Normal, MoonRayShaderNodeMenu,
280 | MoonRayCompNodeMenu, MoonRayCompNodeMenu_DisplayFilter, MoonRayLightShaderNodeMenu, MoonRayLightShaderNodeMenu_LightFilter, MoonRayLightShaderNodeMenu_Output,
281 | MoonRayWorldShaderNodeMenu, MoonRayWorldShaderNodeMenu_Output
282 | ]
283 |
284 | def shader_menu_draw(self, context):
285 | if context.scene.render.engine == MoonRayRenderEngine.bl_idname:
286 | layout = self.layout
287 | space = context.space_data
288 |
289 | if space.type == 'NODE_EDITOR':
290 | if space.tree_type == 'ShaderNodeTree':
291 | if context.active_object and context.active_object.type == 'LIGHT':
292 | layout.menu("NODE_MT_lightshader_node_add_moonray", text="MoonRay")
293 | else:
294 | layout.menu("NODE_MT_shader_node_add_moonray", text="MoonRay")
295 | elif space.tree_type == 'WorldNodeTree':
296 | layout.menu("NODE_MT_world_node_add_moonray", text="MoonRay")
297 |
298 | def comp_menu_draw(self, context):
299 | if context.scene.render.engine == MoonRayRenderEngine.bl_idname:
300 | layout = self.layout
301 | layout.menu("NODE_MT_comp_node_add_moonray", text="MoonRay")
302 |
303 | # Register the custom shader node
304 | def register():
305 | for cls in classes:
306 | bpy.utils.register_class(cls)
307 |
308 | bpy.types.NODE_MT_shader_node_add_all.append(shader_menu_draw)
309 | bpy.types.NODE_MT_compositor_node_add_all.append(comp_menu_draw)
310 |
311 | def unregister():
312 | bpy.types.NODE_MT_shader_node_add_all.remove(shader_menu_draw)
313 | bpy.types.NODE_MT_compositor_node_add_all.remove(comp_menu_draw)
314 |
315 | for cls in reversed(classes):
316 | bpy.utils.unregister_class(cls)
--------------------------------------------------------------------------------
/ui/mfb_object.py:
--------------------------------------------------------------------------------
1 | import bpy
2 | from bpy.props import *
3 |
4 | from .mfb_panel import MOONRAY_PT_Panel
5 |
6 | class MOONRAY_PT_ObjectPanel(MOONRAY_PT_Panel):
7 | bl_label = "MoonRay"
8 | bl_idname = "MOONRAY_PT_ObjectPanel"
9 | bl_space_type = 'PROPERTIES'
10 | bl_region_type = 'WINDOW'
11 | bl_context = "object"
12 |
13 | @classmethod
14 | def poll(cls, context):
15 | return super().poll(context) and context.object and context.object.type != 'LIGHT'
16 |
17 | def draw(self, context):
18 | layout = self.layout
19 | obj = context.object
20 | scene = context.scene
21 | moonray = scene.moonray
22 |
23 | layout.prop(obj.moonray, "is_light")
24 |
25 | layout.prop_search(obj.moonray, "light_set", moonray.light_sets, "items", text="Light Set", results_are_suggestions=True)
26 | layout.prop_search(obj.moonray, "shadow_set", moonray.shadow_sets, "items", text="Shadow Set", results_are_suggestions=True)
27 | layout.prop_search(obj.moonray, "shadowreceiver_set", moonray.shadowreceiver_sets, "items", text="Shadow Receiver Set", results_are_suggestions=True)
28 | layout.prop(obj.moonray, "shadowreceiver_set_input", text="Shadow Receiver Sets")
29 | layout.prop(obj.moonray, "trace_set_input", text="Trace Sets")
30 |
31 |
32 |
33 | class MOONRAY_PT_Object_UserDataPanel(MOONRAY_PT_Panel):
34 | bl_label = "User Data"
35 | bl_idname = "MOONRAY_PT_UserDataPanel"
36 | bl_space_type = 'PROPERTIES'
37 | bl_region_type = 'WINDOW'
38 | bl_context = "object"
39 | bl_parent_id = "MOONRAY_PT_ObjectPanel"
40 |
41 | def draw(self, context):
42 | layout = self.layout
43 | obj = context.object
44 | user_data = obj.moonray.user_data
45 |
46 | row = layout.row()
47 | row.label(text="Add User Data:")
48 | row.operator("moonray.add_userdata", text="", icon='ADD')
49 |
50 | for prop in user_data:
51 | row = layout.row(align=True)
52 | row.prop(prop, "name", text="")
53 | if prop.type == 'BOOL':
54 | row.prop(prop, "value_bool", text="Value")
55 | elif prop.type == 'COLOR':
56 | row.prop(prop, "value_color", text="Value")
57 | elif prop.type == 'FLOAT':
58 | row.prop(prop, "value_float", text="Value")
59 | elif prop.type == 'INTEGER':
60 | row.prop(prop, "value_int", text="Value")
61 | elif prop.type == 'MAT4F':
62 | row.prop(prop, "value_mat4f", text="Value")
63 | elif prop.type == 'STRING':
64 | row.prop(prop, "value_string", text="Value")
65 | elif prop.type == 'VEC2F':
66 | row.prop(prop, "value_vec2f", text="Value")
67 | elif prop.type == 'VEC3F':
68 | row.prop(prop, "value_vec3f", text="Value")
69 |
70 | row.operator("moonray.remove_userdata", text="", icon='X').index = user_data[:].index(prop)
71 |
72 |
73 |
74 | classes = [MOONRAY_PT_ObjectPanel, MOONRAY_PT_Object_UserDataPanel]
75 |
76 | def register():
77 | for cls in classes:
78 | bpy.utils.register_class(cls)
79 |
80 | def unregister():
81 | for cls in reversed(classes):
82 | bpy.utils.unregister_class(cls)
--------------------------------------------------------------------------------
/ui/mfb_output.py:
--------------------------------------------------------------------------------
1 | import bpy
2 |
3 | from .mfb_panel import MOONRAY_PT_Panel
4 |
5 | class MOONRAY_PT_OutputPanel(MOONRAY_PT_Panel):
6 | bl_label = "Output"
7 | bl_idname = "MOONRAY_PT_OutputPanel"
8 | bl_space_type = 'PROPERTIES'
9 | bl_region_type = 'WINDOW'
10 | bl_context = "output"
11 |
12 | def draw(self, context):
13 | layout = self.layout
14 | scene = context.scene
15 | moonray = scene.moonray
16 |
17 | layout.use_property_split = True
18 | layout.use_property_decorate = False
19 |
20 | layout.prop(moonray.output, "channel_format")
21 | layout.prop(moonray.output, "channel_name")
22 | layout.prop(moonray.output, "channel_suffix_mode")
23 | layout.prop(moonray.checkpoint, "checkpoint_active")
24 |
25 | if (moonray.checkpoint.checkpoint_active):
26 | layout.prop(moonray.output, "checkpoint_file_name")
27 | layout.prop(moonray.checkpoint, "checkpoint_bg_write")
28 | layout.prop(moonray.checkpoint, "checkpoint_interval")
29 | layout.prop(moonray.checkpoint, "checkpoint_max_bgcache")
30 | layout.prop(moonray.checkpoint, "checkpoint_max_snapshot_overhead")
31 | layout.prop(moonray.checkpoint, "checkpoint_mode")
32 | layout.prop(moonray.checkpoint, "checkpoint_overwrite")
33 | layout.prop(moonray.checkpoint, "checkpoint_post_script")
34 | layout.prop(moonray.checkpoint, "checkpoint_quality_steps")
35 | layout.prop(moonray.checkpoint, "checkpoint_checkpoint_sample_cap")
36 | layout.prop(moonray.checkpoint, "checkpoint_snapshot_interval")
37 | layout.prop(moonray.checkpoint, "checkpoint_start_sample")
38 | layout.prop(moonray.checkpoint, "checkpoint_time_cap")
39 | layout.prop(moonray.checkpoint, "checkpoint_total_files")
40 | layout.prop(moonray.output, "checkpoint_multi_version_file_name")
41 |
42 | layout.prop(moonray.output, "compression")
43 | layout.prop(moonray.output, "exr_dwa_compression_level")
44 | layout.prop(moonray.output, "exr_header_attributes")
45 |
46 | layout.prop(moonray.output, "file_name")
47 | layout.prop(moonray.output, "file_part")
48 | layout.prop(moonray.output, "lpe")
49 | layout.prop(moonray.output, "material_aov")
50 | layout.prop(moonray.output, "math_filter")
51 | layout.prop(moonray.output, "output_type")
52 |
53 | layout.prop(moonray.output, "primitive_attribute")
54 | layout.prop(moonray.output, "primitive_attribute_type")
55 |
56 | layout.prop(moonray.output, "result")
57 | layout.prop(moonray.output, "resume_file_name")
58 |
59 | layout.prop(moonray.output, "state_variable")
60 | layout.prop(moonray.output, "visibility_aov")
61 |
62 |
63 |
64 |
65 | classes = [MOONRAY_PT_OutputPanel]
66 |
67 | def register():
68 | for cls in classes:
69 | bpy.utils.register_class(cls)
70 |
71 | def unregister():
72 | for cls in reversed(classes):
73 | bpy.utils.unregister_class(cls)
--------------------------------------------------------------------------------
/ui/mfb_panel.py:
--------------------------------------------------------------------------------
1 | import bpy
2 | from ..engine import MoonRayRenderEngine
3 |
4 | class MOONRAY_PT_Panel(bpy.types.Panel):
5 | bl_space_type = 'PROPERTIES'
6 | bl_region_type = 'WINDOW'
7 | bl_context = 'render'
8 | COMPAT_ENGINES = {MoonRayRenderEngine.bl_idname}
9 |
10 | @classmethod
11 | def poll(cls, context):
12 | return context.engine in cls.COMPAT_ENGINES
13 |
--------------------------------------------------------------------------------
/ui/mfb_render.py:
--------------------------------------------------------------------------------
1 | import bpy
2 |
3 | from .mfb_panel import MOONRAY_PT_Panel
4 | from ..engine import MoonRayRenderEngine
5 |
6 | class MOONRAY_PT_RenderPanel(MOONRAY_PT_Panel):
7 | bl_label = "MoonRay"
8 | bl_idname = "MOONRAY_PT_RenderPanel"
9 | bl_space_type = 'PROPERTIES'
10 | bl_region_type = 'WINDOW'
11 | bl_context = "render"
12 |
13 | def draw(self, context):
14 | layout = self.layout
15 |
16 | class MOONRAY_PT_RenderSettingsPanel(MOONRAY_PT_Panel):
17 | bl_label = "Render Settings"
18 | bl_idname = "MOONRAY_PT_RenderSettingsPanel"
19 | bl_space_type = 'PROPERTIES'
20 | bl_region_type = 'WINDOW'
21 | bl_context = "render"
22 | bl_parent_id = "MOONRAY_PT_RenderPanel"
23 |
24 | def draw(self, context):
25 | layout = self.layout
26 | scene = context.scene
27 | moonray = scene.moonray
28 |
29 | layout.prop(moonray.path_guide, "path_guide_enable")
30 |
31 | class MOONRAY_PT_RenderGlobalsPanel(MOONRAY_PT_Panel):
32 | bl_label = "Render Globals"
33 | bl_idname = "MOONRAY_PT_RenderGlobalsPanel"
34 | bl_space_type = 'PROPERTIES'
35 | bl_region_type = 'WINDOW'
36 | bl_context = "render"
37 | bl_parent_id = "MOONRAY_PT_RenderSettingsPanel"
38 |
39 | def draw(self, context):
40 | layout = self.layout
41 | scene = context.scene
42 | moonray = scene.moonray
43 |
44 | layout.prop(moonray.global_toggles, "enable_displacement")
45 | layout.prop(moonray.global_toggles, "enable_dof")
46 | layout.prop(moonray.global_toggles, "enable_max_geometry_resolution")
47 | layout.prop(moonray.global_toggles, "enable_motion_blur")
48 | layout.prop(moonray.global_toggles, "enable_presence_shadows")
49 | layout.prop(moonray.global_toggles, "enable_shadowing")
50 | layout.prop(moonray.global_toggles, "enable_subsurface_scattering")
51 | layout.prop(moonray.global_toggles, "lights_visible_in_camera")
52 | layout.prop(moonray.global_toggles, "max_geometry_resolution")
53 | layout.prop(moonray.global_toggles, "propagate_visibility_bounce_type")
54 | layout.prop(moonray.global_toggles, "shadow_terminator_fix")
55 |
56 |
57 | class MOONRAY_PT_RenderSamplesPanel(MOONRAY_PT_Panel):
58 | bl_label = "Render Samples"
59 | bl_idname = "MOONRAY_PT_RenderSamplesPanel"
60 | bl_space_type = 'PROPERTIES'
61 | bl_region_type = 'WINDOW'
62 | bl_context = "render"
63 | bl_parent_id = "MOONRAY_PT_RenderSettingsPanel"
64 |
65 | def draw(self, context):
66 | layout = self.layout
67 | scene = context.scene
68 | moonray = scene.moonray
69 |
70 | layout.use_property_split = True
71 | layout.use_property_decorate = False
72 |
73 | layout.prop(moonray.sampling, "bsdf_samples")
74 | layout.prop(moonray.sampling, "bssrdf_samples")
75 | layout.prop(moonray.sampling, "disable_optimized_hair_sampling")
76 | layout.prop(moonray.sampling, "light_samples")
77 | layout.prop(moonray.sampling, "lock_frame_noise")
78 | layout.prop(moonray.sampling, "max_depth")
79 | layout.prop(moonray.sampling, "max_diffuse_depth")
80 | layout.prop(moonray.sampling, "max_glossy_depth")
81 | layout.prop(moonray.sampling, "max_hair_depth")
82 | layout.prop(moonray.sampling, "max_presence_depth")
83 | layout.prop(moonray.sampling, "max_subsurface_per_path")
84 | layout.prop(moonray.sampling, "pixel_samples")
85 | layout.prop(moonray.sampling, "presence_threshold")
86 | layout.prop(moonray.sampling, "russian_roulette_threshold")
87 | layout.prop(moonray.sampling, "transparency_threshold")
88 |
89 | class MOONRAY_PT_RenderVolumePanel(MOONRAY_PT_Panel):
90 | bl_label = "Volume"
91 | bl_idname = "MOONRAY_PT_RenderVolumePanel"
92 | bl_space_type = 'PROPERTIES'
93 | bl_region_type = 'WINDOW'
94 | bl_context = "render"
95 | bl_parent_id = "MOONRAY_PT_RenderSamplesPanel"
96 |
97 | def draw(self, context):
98 | layout = self.layout
99 | scene = context.scene
100 | moonray = scene.moonray
101 |
102 | layout.use_property_split = True
103 | layout.use_property_decorate = False
104 |
105 | layout.prop(moonray.volumes, "max_volume_depth")
106 | layout.prop(moonray.volumes, "volume_attenuation_factor")
107 | layout.prop(moonray.volumes, "volume_contribution_factor")
108 | layout.prop(moonray.volumes, "volume_illumination_samples")
109 | layout.prop(moonray.volumes, "volume_opacity_threshold")
110 | layout.prop(moonray.volumes, "volume_overlap_mode")
111 | layout.prop(moonray.volumes, "volume_phase_attenuation_factor")
112 | layout.prop(moonray.volumes, "volume_quality")
113 | layout.prop(moonray.volumes, "volume_shadow_quality")
114 |
115 | class MOONRAY_PT_RenderFilteringPanel(MOONRAY_PT_Panel):
116 | bl_label = "Filtering"
117 | bl_idname = "MOONRAY_PT_RenderFilteringPanel"
118 | bl_space_type = 'PROPERTIES'
119 | bl_region_type = 'WINDOW'
120 | bl_context = "render"
121 | bl_parent_id = "MOONRAY_PT_RenderSamplesPanel"
122 |
123 | def draw(self, context):
124 | layout = self.layout
125 | scene = context.scene
126 | moonray = scene.moonray
127 |
128 | layout.use_property_split = True
129 | layout.use_property_decorate = False
130 |
131 | layout.prop(moonray.fireflies_removal, "roughness_clamping_factor")
132 | layout.prop(moonray.fireflies_removal, "sample_clamping_depth")
133 | layout.prop(moonray.fireflies_removal, "sample_clamping_value")
134 |
135 | layout.prop(moonray.filtering, "pixel_filter")
136 | layout.prop(moonray.filtering, "pixel_filter_width")
137 | layout.prop(moonray.filtering, "texture_blur")
138 |
139 |
140 | classes = [MOONRAY_PT_RenderPanel, MOONRAY_PT_RenderSettingsPanel, MOONRAY_PT_RenderGlobalsPanel, MOONRAY_PT_RenderSamplesPanel, MOONRAY_PT_RenderVolumePanel, MOONRAY_PT_RenderFilteringPanel]
141 |
142 |
143 |
144 |
145 | def render_header_draw(self, context):
146 | if context.scene.render.engine == MoonRayRenderEngine.bl_idname:
147 | layout = self.layout
148 | scene = context.scene
149 | moonray = scene.moonray
150 |
151 | self.layout.prop(moonray.mfb, "execution_mode")
152 |
153 | def register():
154 | bpy.types.RENDER_PT_context.append(render_header_draw)
155 |
156 | for cls in classes:
157 | bpy.utils.register_class(cls)
158 |
159 | def unregister():
160 | bpy.types.RENDER_PT_context.remove(render_header_draw)
161 |
162 | for cls in reversed(classes):
163 | bpy.utils.unregister_class(cls)
--------------------------------------------------------------------------------
/ui/mfb_view_layer.py:
--------------------------------------------------------------------------------
1 | import bpy
2 | from bpy.props import *
3 |
4 | from .mfb_panel import MOONRAY_PT_Panel
5 |
6 |
7 | class MOONRAY_UL_SetList(bpy.types.UIList):
8 | def draw_item(self, context, layout, data, item, icon, active_data, active_propname, index):
9 | self.use_filter_show = True
10 | if self.layout_type in {'DEFAULT', 'COMPACT'}:
11 | layout.prop(item, "name", text="", emboss=False, icon_value=icon)
12 | elif self.layout_type in {'GRID'}:
13 | layout.alignment = 'CENTER'
14 | layout.label(text="", icon_value=icon)
15 |
16 | class MOONRAY_PT_ViewLayerPanel(MOONRAY_PT_Panel):
17 | bl_label = "MoonRay"
18 | bl_idname = "MOONRAY_PT_ViewLayerPanel"
19 | bl_space_type = 'PROPERTIES'
20 | bl_region_type = 'WINDOW'
21 | bl_context = "view_layer"
22 |
23 | def draw(self, context):
24 | layout = self.layout
25 | scene = context.scene
26 | moonray = scene.moonray
27 |
28 | layout.use_property_split = True
29 | layout.use_property_decorate = False
30 |
31 | layout.prop(moonray.output, "denoise")
32 | layout.prop(moonray.output, "denoiser_input")
33 | layout.prop(moonray.output, "display_filter")
34 |
35 | class MOONRAY_MT_ViewLayer_SetsPanel(MOONRAY_PT_Panel):
36 | bl_label = "Sets"
37 | bl_idname = "MOONRAY_PT_ViewLayer_SetsPanel"
38 | bl_space_type = 'PROPERTIES'
39 | bl_region_type = 'WINDOW'
40 | bl_context = "view_layer"
41 | bl_parent_id = "MOONRAY_PT_ViewLayerPanel"
42 |
43 | def draw(self, context):
44 | layout = self.layout
45 | layout.use_property_split = True
46 | layout.use_property_decorate = False
47 |
48 | class MOONRAY_MT_ViewLayer_CryptomattePanel(MOONRAY_PT_Panel):
49 | bl_label = "Cryptomattes"
50 | bl_idname = "MOONRAY_PT_ViewLayer_CryptomattePanel"
51 | bl_space_type = 'PROPERTIES'
52 | bl_region_type = 'WINDOW'
53 | bl_context = "view_layer"
54 | bl_parent_id = "MOONRAY_PT_ViewLayerPanel"
55 |
56 | def draw(self, context):
57 | layout = self.layout
58 | scene = context.scene
59 | moonray = scene.moonray
60 |
61 | layout.use_property_split = True
62 | layout.use_property_decorate = False
63 |
64 | layout.prop(moonray.output, "cryptomatte_depth")
65 | layout.prop(moonray.output, "cryptomatte_enable_refract")
66 | layout.prop(moonray.output, "cryptomatte_output_beauty")
67 | layout.prop(moonray.output, "cryptomatte_output_normals")
68 | layout.prop(moonray.output, "cryptomatte_output_p0")
69 | layout.prop(moonray.output, "cryptomatte_output_positions")
70 | layout.prop(moonray.output, "cryptomatte_output_refn")
71 | layout.prop(moonray.output, "cryptomatte_output_refp")
72 | layout.prop(moonray.output, "cryptomatte_output_uv")
73 | layout.prop(moonray.output, "cryptomatte_support_resume_render")
74 |
75 | class MOONRAY_MT_ViewLayer_LightFilterPanel(MOONRAY_PT_Panel):
76 | bl_label = "Light Filters"
77 | bl_idname = "MOONRAY_PT_ViewLayer_LightFilterPanel"
78 | bl_space_type = 'PROPERTIES'
79 | bl_region_type = 'WINDOW'
80 | bl_context = "view_layer"
81 | bl_parent_id = "MOONRAY_PT_ViewLayerPanel"
82 |
83 | def draw(self, context):
84 | layout = self.layout
85 | scene = context.scene
86 | moonray = scene.moonray
87 |
88 | layout.use_property_split = True
89 | layout.use_property_decorate = False
90 |
91 |
92 |
93 | class MOONRAY_MT_ViewLayer_LightSetsPanel(MOONRAY_PT_Panel):
94 | bl_label = "Lights"
95 | bl_idname = "MOONRAY_PT_ViewLayer_LightSetsPanel"
96 | bl_space_type = 'PROPERTIES'
97 | bl_region_type = 'WINDOW'
98 | bl_context = "view_layer"
99 | bl_parent_id = "MOONRAY_PT_ViewLayer_SetsPanel"
100 |
101 | def draw(self, context):
102 | layout = self.layout
103 | layout.use_property_split = True
104 | layout.use_property_decorate = False
105 |
106 |
107 | light_sets = context.scene.moonray.light_sets
108 | lightfilter_sets = context.scene.moonray.lightfilter_sets
109 |
110 | layout.label(text="Light Sets")
111 | row = layout.row()
112 | col = row.column()
113 | col.template_list("MOONRAY_UL_SetList", "light_sets", light_sets,
114 | "items", light_sets, "index", rows=3)
115 |
116 | col = row.column()
117 | sub = col.column(align=True)
118 | sub.operator("moonray.add_light_set", icon='ADD', text="")
119 | sub.operator("moonray.remove_light_set", icon='REMOVE', text="")
120 | sub.separator()
121 |
122 | # Light Filter Sets
123 | layout.label(text="Light Filter Sets")
124 | row = layout.row()
125 | col = row.column()
126 | col.template_list("MOONRAY_UL_SetList", "lightfilter_sets", lightfilter_sets,
127 | "items", lightfilter_sets, "index", rows=3)
128 |
129 | col = row.column()
130 | sub = col.column(align=True)
131 | sub.operator("moonray.add_lightfilter_set", icon='ADD', text="")
132 | sub.operator("moonray.remove_lightfilter_set", icon='REMOVE', text="")
133 | sub.separator()
134 |
135 | class MOONRAY_MT_ViewLayer_ShadowSetsPanel(MOONRAY_PT_Panel):
136 | bl_label = "Shadows"
137 | bl_idname = "MOONRAY_PT_ViewLayer_ShadowSetsPanel"
138 | bl_space_type = 'PROPERTIES'
139 | bl_region_type = 'WINDOW'
140 | bl_context = "view_layer"
141 | bl_parent_id = "MOONRAY_PT_ViewLayer_SetsPanel"
142 |
143 | def draw(self, context):
144 | layout = self.layout
145 | layout.use_property_split = True
146 | layout.use_property_decorate = False
147 |
148 | shadow_sets = context.scene.moonray.shadow_sets
149 | shadowreceiver_sets = context.scene.moonray.shadowreceiver_sets
150 | # Shadow Set
151 |
152 | layout.label(text="Shadow Sets")
153 | row = layout.row()
154 | col = row.column()
155 | col.template_list("MOONRAY_UL_SetList", "shadow_sets", shadow_sets,
156 | "items", shadow_sets, "index", rows=3)
157 |
158 | col = row.column()
159 | sub = col.column(align=True)
160 | sub.operator("moonray.add_shadow_set", icon='ADD', text="")
161 | sub.operator("moonray.remove_shadow_set", icon='REMOVE', text="")
162 | sub.separator()
163 |
164 | # Shadow Receiver Set
165 |
166 | layout.label(text="Shadow Receiver Sets")
167 | row = layout.row()
168 | col = row.column()
169 | col.template_list("MOONRAY_UL_SetList", "shadowreceiver_sets", shadowreceiver_sets,
170 | "items", shadowreceiver_sets, "index", rows=3)
171 |
172 | col = row.column()
173 | sub = col.column(align=True)
174 | sub.operator("moonray.add_shadowreceiver_set", icon='ADD', text="")
175 | sub.operator("moonray.remove_shadowreceiver_set", icon='REMOVE', text="")
176 | sub.separator()
177 |
178 | class MOONRAY_MT_ViewLayer_TraceSetsPanel(MOONRAY_PT_Panel):
179 | bl_label = "Trace"
180 | bl_idname = "MOONRAY_PT_ViewLayer_TraceSetsPanel"
181 | bl_space_type = 'PROPERTIES'
182 | bl_region_type = 'WINDOW'
183 | bl_context = "view_layer"
184 | bl_parent_id = "MOONRAY_PT_ViewLayer_SetsPanel"
185 |
186 | def draw(self, context):
187 | layout = self.layout
188 | layout.use_property_split = True
189 | layout.use_property_decorate = False
190 |
191 | trace_sets = context.scene.moonray.trace_sets
192 |
193 | layout.label(text="Trace Sets")
194 | row = layout.row()
195 | col = row.column()
196 | col.template_list("MOONRAY_UL_SetList", "trace_sets", trace_sets,
197 | "items", trace_sets, "index", rows=3)
198 |
199 | col = row.column()
200 | sub = col.column(align=True)
201 | sub.operator("moonray.add_trace_set", icon='ADD', text="")
202 | sub.operator("moonray.remove_trace_set", icon='REMOVE', text="")
203 | sub.separator()
204 |
205 |
206 | classes = [MOONRAY_UL_SetList, MOONRAY_PT_ViewLayerPanel, MOONRAY_MT_ViewLayer_SetsPanel, MOONRAY_MT_ViewLayer_LightSetsPanel, MOONRAY_MT_ViewLayer_ShadowSetsPanel, MOONRAY_MT_ViewLayer_TraceSetsPanel, MOONRAY_MT_ViewLayer_CryptomattePanel, MOONRAY_MT_ViewLayer_LightFilterPanel]
207 |
208 | def register():
209 | for cls in classes:
210 | bpy.utils.register_class(cls)
211 |
212 | def unregister():
213 | for cls in reversed(classes):
214 | bpy.utils.unregister_class(cls)
--------------------------------------------------------------------------------
| |