[Bf-python] [ #2074 ] Blank GUI String field Crashes Blender

Roland Hess rolandh at reed-witting.com
Tue Feb 15 14:20:27 CET 2005


I submitted this to the bug tracker at the end of December, and it 
was assigned to IanWill, but there's been no visible activity on it 
since then. Anyone else have an idea what's going on here? Copy and 
paste of what I posted in the tracker:

The following Python GUI code crashes blender every time:

import Blender
from Blender import *

testVar = Draw.Create('')

def drawGUI():
global testVar

BGL.glClearColor(0.5, 0.5, 0.5, 0.0)
BGL.glClear(BGL.GL_COLOR_BUFFER_BIT)

Draw.String('',10,12,12,80,15,testVar.val,30)

def event(evt, val):
if ((evt == Draw.QKEY or evt == Draw.ESCKEY) and not val):
Draw.Exit()

def buttonEvents(evt):
pass

Draw.Register(drawGUI, event, buttonEvents)

Hit alt-P, select the text entry box at the bottom, clear it, then 
hit Enter (or click out of the box). Moving focus from the box while 
there is text in it is not a problem. Remove the text and BOOM. 
Crashes Blender 2.36 on Win2K and 2.35 on Mac OS 10.3.

This is very bad for GUI-based Python scripts. Is this a problem with 
Blender's Python implementation, or am I doing something wrong in the 
code?
-- 
Roland Hess - harkyman



More information about the Bf-python mailing list