Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- bl_info = {"name": "yellowsubmarine",
- "author": "anonb",
- "version": (1, 0, 0),
- "blender": (2, 72, 0),
- "location": "Add > Mesh",
- "description": "Create yellowsubmarine primitive.",
- "warning": "",
- "wiki_url": "",
- "tracker_url": "",
- "category": "Add Mesh"}
- if "bpy" in locals():
- import imp
- import bpy
- import bmesh
- import math
- from mathutils import *
- class OBJECT_OT_addSubmarine(bpy.types.Operator):
- '''
- Class representing an operator for adding a yellow submarine
- '''
- bl_idname = "mesh.addsubmarine" #name used to refer to this operator
- bl_label = "Add Submarine" #operator's label
- bl_options = {'REGISTER', 'UNDO'}
- bl_description = "Add a yellow submarine" #tooltip
- def execute(self, context):
- '''
- Function to process a click on the "Add Submarine" button
- '''
- bpy.ops.wm.append(directory="C:/Users/Youruser/Desktop/test_append/yellowsubmarine.blend/Scene/",
- filename="submarine", link=False) #append submarine from .blend file
- return{'FINISHED'}
- def menu_item(self, context):
- self.layout.operator(OBJECT_OT_addSubmarine.bl_idn ame, text="yellowsubmarine", icon="PLUGIN")
- def register():
- bpy.utils.register_module(__name__)
- bpy.types.INFO_MT_mesh_add.append(menu_item)
- def unregister():
- bpy.utils.unregister_module(__name__)
- bpy.types.INFO_MT_mesh_add.remove(menu_item)
- if __name__ == "__main__":
- register()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement