GUIのサンプルコード
The Blender Python API Reference 日本語版http://www.geocities.co.jp/SiliconValley-Cupertino/2019/blender/PythonDocJpn/index.html
上記にあるBlender.Draw サブモジュールの一部サンプルコードです。詳細な説明はしていません。
DrawText.py
import Blender
from Blender import Draw,BGL
def DrawGui():
BGL.glClearColor(0.6, 0.6, 0.6, 0.0)
BGL.glClear(Blender.BGL.GL_COLOR_BUFFER_BIT)
BGL.glColor3f(0.1, 0.1, 0.15) # Text Color
BGL.glRasterPos2f(20, 40)
Draw.Text('Hellow World.')
BGL.glRasterPos2f(20, 20)
Draw.Text('Hit [ESC] or [Q] Key .')
def ButtonEvent(evt):
pass
def KeyEvent(evt, val):
# val: 1=KeyDown 0=KeyUp
if (not val) :
return
if evt in [Draw.ESCKEY, Draw.QKEY]:
Draw.Exit()
Draw.Register(DrawGui, KeyEvent, ButtonEvent)
2006.05.11(Thu) 20:42 初出
![[head]](../img/head.png)