Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'doc/python_api/examples/bpy.types.Panel.py')
-rw-r--r--doc/python_api/examples/bpy.types.Panel.py28
1 files changed, 28 insertions, 0 deletions
diff --git a/doc/python_api/examples/bpy.types.Panel.py b/doc/python_api/examples/bpy.types.Panel.py
new file mode 100644
index 00000000000..210665b5a47
--- /dev/null
+++ b/doc/python_api/examples/bpy.types.Panel.py
@@ -0,0 +1,28 @@
+"""
+Basic Panel Example
++++++++++++++++++++
+This script is a simple panel which will draw into the object properties
+section.
+
+Notice the 'CATEGORY_PT_name' :class:`Panel.bl_idname`, this is a naming
+convention for panels.
+
+.. note::
+
+ Panel subclasses must be registered for blender to use them.
+"""
+import bpy
+
+
+class HelloWorldPanel(bpy.types.Panel):
+ bl_idname = "OBJECT_PT_hello_world"
+ bl_label = "Hello World"
+ bl_space_type = 'PROPERTIES'
+ bl_region_type = 'WINDOW'
+ bl_context = "object"
+
+ def draw(self, context):
+ self.layout.label(text="Hello World")
+
+
+bpy.utils.register_class(HelloWorldPanel) \ No newline at end of file