py api:
- added menu templates - move template menu into the header of the text editor (so users will find more easily) - updated mathutils examples, switching the order of multiplication.
This commit is contained in:
34
release/scripts/templates/ui_panel_simple.py
Normal file
34
release/scripts/templates/ui_panel_simple.py
Normal file
@@ -0,0 +1,34 @@
|
||||
import bpy
|
||||
|
||||
|
||||
class HelloWorldPanel(bpy.types.Panel):
|
||||
bl_label = "Hello World Panel"
|
||||
bl_idname = "OBJECT_PT_hello"
|
||||
bl_space_type = "PROPERTIES"
|
||||
bl_region_type = "WINDOW"
|
||||
bl_context = "object"
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
|
||||
obj = context.object
|
||||
|
||||
row = layout.row()
|
||||
row.label(text="Hello world!", icon='WORLD_DATA')
|
||||
|
||||
row = layout.row()
|
||||
row.label(text="Active object is: " + obj.name)
|
||||
row = layout.row()
|
||||
row.prop(obj, "name")
|
||||
|
||||
|
||||
def register():
|
||||
bpy.utils.register_class(HelloWorldPanel)
|
||||
|
||||
|
||||
def unregister():
|
||||
bpy.utils.unregister_class(HelloWorldPanel)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
register()
|
Reference in New Issue
Block a user