Changeset View
Changeset View
Standalone View
Standalone View
release/scripts/templates_py/ui_space_type.py
- This file was added.
| import bpy | |||||
| from bpy.types import SpaceProperties, SpaceScript | |||||
| class Foo(SpaceProperties): | |||||
| bl_idname = "FOO_BAR" | |||||
| bl_label = "My Space Type" | |||||
| bl_icon = 'STYLUS_PRESSURE' | |||||
| def draw(self, context): | |||||
| import bgl | |||||
| bgl.glClearColor(0.0, 0.0, 0.0, 1.0) | |||||
| import blf | |||||
| font_id = 2 | |||||
| blf.position(font_id, 15, 30, 0) | |||||
| blf.size(font_id, 20, 72) | |||||
| blf.draw(font_id, "Hello Word") | |||||
| bpy.utils.register_class(Foo) | |||||
| class Bar(SpaceProperties): | |||||
| bl_idname = "BAR_FOO" | |||||
| bl_label = "My Other Space Type" | |||||
| bl_icon = 'QUESTION' | |||||
| def draw(self, context): | |||||
| import bgl | |||||
| bgl.glClearColor(0.0, 0.0, 0.0, 1.0) | |||||
| import blf | |||||
| font_id = 2 | |||||
| blf.position(font_id, 15, 30, 0) | |||||
| blf.size(font_id, 20, 72) | |||||
| blf.draw(font_id, "Word Hello") | |||||
| bpy.utils.register_class(Bar) | |||||
| class Boof(SpaceScript): | |||||
| bl_idname = "WOO_HOO" | |||||
| bl_label = "Py Space" | |||||
| bl_icon = 'QUESTION' | |||||
| def draw(self, context): | |||||
| import blf | |||||
| font_id = 2 | |||||
| blf.position(font_id, 15, 30, 0) | |||||
| blf.size(font_id, 20, 72) | |||||
| blf.draw(font_id, "Script") | |||||
| print(123) | |||||
| bpy.utils.register_class(Boof) | |||||