-
-
Save bdancer/2f29c23251b4af247ad0 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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