#creating custom panels in blender toolbar ('t' key) import bpy class CustomPanel(bpy.types.Panel): """ A custom panel in the viewport Toolbar""" bl_label = 'Custom Panel' bl_space_type = 'View_3D' # Choosing Viewport bl_region_type = 'TOOLS' # Choosing tools panel in viewport def draw(self, context): #self.layout.row.label(text = 'this is my panel") # You can simplify this by: layout = self.layout row = layout.row() row.label(text="this is my panel") split = layout.split() col = split.column col.operator("mesh.primitive_plane_add", text = 'Plane', icon = 'MESH_PLANE') col.operator("mesh.primitive_torus_add", text = 'Torus', icon = 'MESH_TORUS') def register(): bpy.utils.register_class(CustomPanel) def unregister(): bpy.utils.unregister_class(CustomPanel) if __name__ == "__main__": register()
Run
Reset
Share
Import
Link
Embed
Language▼
English
中文
Python Fiddle
Python Cloud IDE
Follow @python_fiddle
Browser Version Not Supported
Due to Python Fiddle's reliance on advanced JavaScript techniques, older browsers might have problems running it correctly. Please download the latest version of your favourite browser.
Chrome 10+
Firefox 4+
Safari 5+
IE 10+
Let me try anyway!
url:
Go
Python Snippet
Stackoverflow Question