diff options
Diffstat (limited to 'source/blender/src/drawscript.c')
-rw-r--r-- | source/blender/src/drawscript.c | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/source/blender/src/drawscript.c b/source/blender/src/drawscript.c index 1ab13355f70..5fc48370d75 100644 --- a/source/blender/src/drawscript.c +++ b/source/blender/src/drawscript.c @@ -91,13 +91,21 @@ void drawscriptspace(ScrArea *sa, void *spacedata) glClear(GL_COLOR_BUFFER_BIT); myortho2(-0.5, curarea->winrct.xmax-curarea->winrct.xmin-0.5, -0.5, curarea->winrct.ymax-curarea->winrct.ymin-0.5); - if(!sc->script) { - if (G.main->script.first) - sc->script = G.main->script.first; - else - return; + if (!sc->script) { + Script *script = G.main->script.first; + + while (script) { + + if (script->py_draw || script->py_event || script->py_button) { + sc->script = script; + break; + } + else script = script->id.next; + } } + if (!sc->script) return; + BPY_spacescript_do_pywin_draw(sc); } |