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:
authorCampbell Barton <ideasman42@gmail.com>2010-02-28 14:18:54 +0300
committerCampbell Barton <ideasman42@gmail.com>2010-02-28 14:18:54 +0300
commit3bbf1917c51bc005d8c5f5d64c5f7546b3e459c2 (patch)
tree677864a3240218f4d354741152bc33670a95275a /release/scripts/templates
parentf9d24eab559b2252c8840498b5bdc66170375f29 (diff)
python BLF module for drawing text, updated template to draw text in the 3D view.
Diffstat (limited to 'release/scripts/templates')
-rw-r--r--release/scripts/templates/operator_modal_draw.py14
1 files changed, 10 insertions, 4 deletions
diff --git a/release/scripts/templates/operator_modal_draw.py b/release/scripts/templates/operator_modal_draw.py
index d830a380250..0cf2dede4ce 100644
--- a/release/scripts/templates/operator_modal_draw.py
+++ b/release/scripts/templates/operator_modal_draw.py
@@ -1,7 +1,13 @@
import BGL
+import BLF
def draw_callback_px(self, context):
- print("mouse points", len(self.mouse_path))
+ print("mouse points", len(self.mouse_path))
+
+ # draw some text
+ BLF.position(15, 30, 0)
+ BLF.size(20, 72)
+ BLF.draw("Hello Word " + str(len(self.mouse_path)))
# 50% alpha, 2 pixel width line
BGL.glEnable(BGL.GL_BLEND)
@@ -22,8 +28,8 @@ def draw_callback_px(self, context):
class ModalDrawOperator(bpy.types.Operator):
'''Draw a line with the mouse'''
- bl_idname = "object.modal_operator"
- bl_label = "Simple Modal Operator"
+ bl_idname = "view3d.modal_operator"
+ bl_label = "Simple Modal View3D Operator"
def modal(self, context, event):
context.area.tag_redraw()
@@ -66,4 +72,4 @@ def unregister():
if __name__ == "__main__":
- register()
+ register() \ No newline at end of file