Skip to content

Instantly share code, notes, and snippets.

@bdancer
Created February 27, 2015 21:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bdancer/2f29c23251b4af247ad0 to your computer and use it in GitHub Desktop.
Save bdancer/2f29c23251b4af247ad0 to your computer and use it in GitHub Desktop.
bl_info = {
"name": "My First Addon",
"category": "3D View"
}
import bpy
class MyOperator(bpy.types.Operator):
bl_idname = "nig_rishat.append"
bl_label = "Append Door"
def execute(self, context):
bpy.ops.wm.append(directory="/D:/Project_Blender/windows/w1.blend/Object/", filepath="w1.blend", filename="Cube.000")
return {'FINISHED'}
class MyPanel(bpy.types.Panel):
bl_label = "My Menu"
bl_space_type = 'VIEW_3D'
bl_region_type = 'TOOLS'
def draw(self, context):
layout = self.layout
layout.label(text="Windows")
layout.operator("mesh.primitive_plane_add")
layout.label(text="Doors")
layout.operator("nig_rishat.append")
def register():
bpy.utils.register_class(MyOperator)
bpy.utils.register_class(MyPanel)
def unregister():
bpy.utils.unregister_class(MyOperator)
bpy.utils.unregister_class(MyPanel)
if __name__ == "__main__":
register()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment