forked from bartvdbraak/blender
c0e702694f
from luke frisken (lfrisken), with some edits. some tooltip colors weren't visible with different backgrounds, now the base tooltip color is used and tinted for python/alert/shortcuts etc. the tint colors are still hard coded.
36 lines
761 B
Python
36 lines
761 B
Python
import bpy
|
|
|
|
|
|
class HelloWorldPanel(bpy.types.Panel):
|
|
"""Creates a Panel in the Object properties window"""
|
|
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()
|