X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=blender%2Fio_mspgl%2Fproperties.py;h=744630f70ca8dd505073beb2ed86e735ba808cf9;hb=dbc91b65728ab9c0e574bb1127cfe4d2da55de7f;hp=39911b85511a16b7df387b93ab9255393743fe36;hpb=9d8e4aa5a9573b34fe06455af249c762433d47c0;p=libs%2Fgl.git diff --git a/blender/io_mspgl/properties.py b/blender/io_mspgl/properties.py index 39911b85..744630f7 100644 --- a/blender/io_mspgl/properties.py +++ b/blender/io_mspgl/properties.py @@ -1,5 +1,18 @@ import bpy +class MspGLSceneProperties(bpy.types.Panel): + bl_idname = "SCENE_PT_mspgl_properties" + bl_label = "MspGL properties" + bl_space_type = "PROPERTIES" + bl_region_type = "WINDOW" + bl_context = "scene" + + def draw(self, context): + scene = context.scene + + self.layout.prop(scene, "scene_type") + self.layout.prop(scene, "export_disposition") + class MspGLMeshProperties(bpy.types.Panel): bl_idname = "MESH_PT_mspgl_properties" bl_label = "MspGL properties" @@ -16,11 +29,12 @@ class MspGLMeshProperties(bpy.types.Panel): self.layout.prop(mesh, "winding_test") self.layout.prop(mesh, "smoothing") + self.layout.prop(mesh, "use_strips") self.layout.separator() col = self.layout.column() - col.label("Data selection") + col.label(text="Data selection") col.prop(mesh, "use_lines") col.prop(mesh, "vertex_groups") col.prop(mesh, "max_groups_per_vertex") @@ -28,10 +42,10 @@ class MspGLMeshProperties(bpy.types.Panel): self.layout.separator() col = self.layout.column() - col.label("Texturing") + col.label(text="Texturing") col.prop(mesh, "use_uv") - col.prop(mesh, "tbn_vecs") - col.prop(mesh, "tbn_uvtex") + col.prop(mesh, "tangent_vecs") + col.prop(mesh, "tangent_uvtex") class MspGLObjectProperties(bpy.types.Panel): bl_idname = "OBJECT_PT_mspgl_properties" @@ -40,15 +54,14 @@ class MspGLObjectProperties(bpy.types.Panel): bl_region_type = "WINDOW" bl_context = "object" + @classmethod + def poll(cls, context): + return context.active_object.type=="MESH" + def draw(self, context): obj = context.active_object - self.layout.prop(obj, "technique"); - self.layout.prop(obj, "inherit_tech"); - if obj.inherit_tech: - self.layout.prop(obj, "override_material"); - self.layout.prop(obj, "material_tex") - self.layout.prop(obj, "compound"); + self.layout.prop(obj, "compound") self.layout.prop(obj, "lod_for_parent") if obj.lod_for_parent: self.layout.prop(obj, "lod_index") @@ -69,35 +82,164 @@ class MspGLMaterialProperties(bpy.types.Panel): if not mat: return - self.layout.prop(mat, "srgb_colors") - self.layout.prop(mat, "array_atlas"); + self.layout.prop(mat, "render_mode") + if mat.render_mode=='CUSTOM': + self.layout.prop(mat, "shader") + if mat.shadow_method!='NONE': + self.layout.prop(mat, "shadow_shader") + elif mat.render_mode=='EXTERNAL': + self.layout.prop(mat, "technique") + if mat.render_mode=='BUILTIN': + self.layout.prop(mat, "receive_shadows") + self.layout.prop(mat, "image_based_lighting") + self.layout.prop(mat, "array_atlas") if mat.array_atlas: - self.layout.prop(mat, "array_layer"); + self.layout.prop(mat, "array_layer") + if mat.render_mode!='EXTERNAL': + self.layout.prop(mat, "material_atlas") + if mat.render_mode=='CUSTOM': + self.layout.separator() + self.layout.label(text="Uniform values") + self.layout.template_list("MATERIAL_UL_mspgl_uniforms", "", mat, "uniforms", mat, "active_uniform_index") + row = self.layout.row() + row.operator("material.add_uniform") + row.operator("material.remove_uniform") + + if mat.active_uniform_index