+class MspGLLightProperties(bpy.types.Panel):
+ bl_idname = "LIGHT_PT_mspgl_properties"
+ bl_label = "MspGL properties"
+ bl_space_type = "PROPERTIES"
+ bl_region_type = "WINDOW"
+ bl_context = "data"
+
+ @classmethod
+ def poll(cls, context):
+ return context.active_object.type=="LIGHT"
+
+ def draw(self, context):
+ light = context.active_object.data
+
+ if light.use_shadow:
+ self.layout.prop(light, "shadow_map_size")
+
+class MspGLRenderProperties(bpy.types.Panel):
+ bl_idname = "RENDER_PT_mspgl_properties"
+ bl_label = "MspGL properties"
+ bl_space_type = "PROPERTIES"
+ bl_region_type = "WINDOW"
+ bl_context = "render"
+
+ def draw(self, context):
+ scene = context.scene
+ self.layout.prop(scene, "use_hdr")
+ if scene.eevee.use_gtao:
+ self.layout.prop(scene, "ao_samples")
+
+class MspGLRenderMethod(bpy.types.PropertyGroup):
+ tag: bpy.props.StringProperty(name="Tag", description="Tag of the render method")
+ shader: bpy.props.StringProperty(name="Shader", description="Shader to use")
+ use_material: bpy.props.BoolProperty(name="Use material", description="Use material properties in this render method")
+
+class MspGLRenderMethodList(bpy.types.UIList):
+ bl_idname = "MATERIAL_UL_mspgl_render_methods"
+
+ def draw_item(self, context, layout, data, item, icon, active_data, active_propname):
+ method = item
+ if self.layout_type=="GRID":
+ layout.label(text="", icon_value=icon)
+ else:
+ layout.prop(method, "tag", text="", emboss=False, icon_value=icon)
+ layout.label(text=(method.shader or "(no shader)"))
+
+class MspGLUniform(bpy.types.PropertyGroup):
+ name: bpy.props.StringProperty(name="Name", description="Name of the uniform variable")
+ size: bpy.props.IntProperty(name="Size", description="Number of elements in the uniform", min=1, max=4, default=4)
+ values: bpy.props.FloatVectorProperty(name="Values", description="Values stored in the uniform", size=4)
+
+class MspGLUniformList(bpy.types.UIList):
+ bl_idname = "MATERIAL_UL_mspgl_uniforms"
+
+ def draw_item(self, context, layout, data, item, icon, active_data, active_propname):
+ uniform = item
+ if self.layout_type=="GRID":
+ layout.label(text="", icon_value=icon)
+ else:
+ layout.prop(uniform, "name", text="", emboss=False, icon_value=icon)
+ layout.label(text="({})".format(", ".join("{:.3f}".format(v) for v in uniform.values[:uniform.size])))
+
+classes = [MspGLSceneProperties, MspGLWorldProperties, MspGLMeshProperties, MspGLObjectProperties, MspGLMaterialProperties,
+ MspGLTextureNodeProperties, MspGLLightProperties, MspGLRenderProperties, MspGLRenderMethod,
+ MspGLRenderMethodList, MspGLUniform, MspGLUniformList]