-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathAddObjectScript.py
More file actions
31 lines (23 loc) · 817 Bytes
/
AddObjectScript.py
File metadata and controls
31 lines (23 loc) · 817 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
import bpy
class TestPanel(bpy.types.Panel):
bl_label="Test Panel"
bl_idname="PT_TestPanel"
bl_space_type='VIEW_3D'
bl_region_type='UI'
bl_category='My 1st Addon'
def draw(self,context):
layout=self.layout
row=layout.row()
row.label(text="Add an object", icon='CUBE')
row=layout.row()
row.operator("mesh.primitive_cube_add", icon='CUBE')
row=layout.row()
row.operator("mesh.primitive_uv_sphere_add", icon='SPHERE')
row=layout.row()
row.operator("object.text_add", text="Font Button")
def register():
bpy.utils.register_class(TestPanel)
def unregister():
bpy.utils.unregister_class(TestPanel)
if __name__=="__main__":
register()