2010-01-23 18:51:56 +00:00
|
|
|
import bpy
|
|
|
|
|
2011-01-26 07:54:27 +00:00
|
|
|
|
2011-07-26 07:39:00 +00:00
|
|
|
class HelloWorldPanel(bpy.types.Panel):
|
2012-03-22 20:24:11 +00:00
|
|
|
"""Creates a Panel in the Object properties window"""
|
2010-01-23 18:51:56 +00:00
|
|
|
bl_label = "Hello World Panel"
|
2011-07-26 07:39:00 +00:00
|
|
|
bl_idname = "OBJECT_PT_hello"
|
2012-07-04 21:41:05 +00:00
|
|
|
bl_space_type = 'PROPERTIES'
|
|
|
|
bl_region_type = 'WINDOW'
|
2010-01-23 18:51:56 +00:00
|
|
|
bl_context = "object"
|
2010-01-31 14:46:28 +00:00
|
|
|
|
2010-01-23 18:51:56 +00:00
|
|
|
def draw(self, context):
|
|
|
|
layout = self.layout
|
2010-01-31 14:46:28 +00:00
|
|
|
|
2010-01-23 18:51:56 +00:00
|
|
|
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")
|
2011-02-12 08:04:32 +00:00
|
|
|
|
|
|
|
|
|
|
|
def register():
|
2011-07-26 07:39:00 +00:00
|
|
|
bpy.utils.register_class(HelloWorldPanel)
|
2011-02-12 08:04:32 +00:00
|
|
|
|
|
|
|
|
|
|
|
def unregister():
|
2011-07-26 07:39:00 +00:00
|
|
|
bpy.utils.unregister_class(HelloWorldPanel)
|
2011-02-12 08:04:32 +00:00
|
|
|
|
|
|
|
|
|
|
|
if __name__ == "__main__":
|
|
|
|
register()
|