X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=blender%2Fio_mspgl%2Foperators.py;h=a6fc592307fd5a549e57f6035271d8b2054e5d3b;hb=08942dd73918a51baefbe7344b62afc0cad42e55;hp=8d214eacf4d0f83af2ecc740fc60db5c9224ece5;hpb=358c29e44cff64b8dd7d9d8b643e6e8bdf4b31fa;p=libs%2Fgl.git diff --git a/blender/io_mspgl/operators.py b/blender/io_mspgl/operators.py index 8d214eac..a6fc5923 100644 --- a/blender/io_mspgl/operators.py +++ b/blender/io_mspgl/operators.py @@ -138,6 +138,30 @@ class ExportMspGLProject(bpy.types.Operator): exporter.export_to_directory(context, self.directory) return {'FINISHED'} +class AddRenderMethod(bpy.types.Operator): + bl_idname = "material.add_render_method" + bl_label = "Add Render Method" + bl_description = "Add a new render method to the material" + + def execute(self, context): + mat = context.active_object.active_material + mat.render_methods.add() + mat.active_render_method_index = len(mat.uniforms)-1 + + return {"FINISHED"} + +class RemoveRenderMethod(bpy.types.Operator): + bl_idname = "material.remove_render_method" + bl_label = "Remove Render Method" + bl_description = "Remove the selected render method from the material" + + def execute(self, context): + mat = context.active_object.active_material + mat.render_methods.remove(mat.active_render_method_index) + mat.active_render_method_index = min(mat.active_render_method_index, len(mat.render_methods)-1) + + return {"FINISHED"} + class AddUniform(bpy.types.Operator): bl_idname = "material.add_uniform" bl_label = "Add Uniform" @@ -162,7 +186,8 @@ class RemoveUniform(bpy.types.Operator): return {"FINISHED"} -classes = [ExportMspGLData, ExportMspGLAnimation, ExportMspGLScene, ExportMspGLProject, AddUniform, RemoveUniform] +classes = [ExportMspGLData, ExportMspGLAnimation, ExportMspGLScene, ExportMspGLProject, AddRenderMethod, + RemoveRenderMethod, AddUniform, RemoveUniform] def register_operators(): for c in classes: