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:
authorWillian Padovani Germano <wpgermano@gmail.com>2005-06-11 09:30:14 +0400
committerWillian Padovani Germano <wpgermano@gmail.com>2005-06-11 09:30:14 +0400
commit6cec51b259a25a54b2aa553633994fe79541eaca (patch)
treedc9fe3e48c42eb328ee499db81046dd82efa5fd8 /source/blender/src
parent9c63b95d34130410ea2f1a3a13541289c226015d (diff)
BPython bug fixes:
- #2646 reported by Campbell: Python/Fileselector (moving from fileselector called by script to another space caused script to hang around open but not accessible) http://projects.blender.org/tracker/?func=detail&atid=125&aid=2646&group_id=9 - #2676 reported by Wim Van Hoydonck: 2.37 python scripts gui: event 8 ignored (thanks Ton for discussing / pointing what to do, Ken Hughes for also working on a fix) http://projects.blender.org/tracker/?func=detail&atid=125&aid=2676&group_id=9 - gui-less scripts with calls to progress bar inside fileselector callbacks didn't return to the previous space on exit (staying on Scripts win), requiring an event to do so (mouse movement, for example). Quick fix for now, will rework a little after 2.37a for a better alternative, not needing to move to the Scripts win at all. - added syntax colors access to Window.Theme module. Scripts: - updates by Jean-Michel Soler: svg2obj (svg paths import), tex2uvbaker, fixfromarmature; - updates by Campbell Barton: obj import / export, console; - tiny: converted vrml97 export to unix line endings; - updates in ac3d exporter, help browser, save theme. Thanks all mentioned above.
Diffstat (limited to 'source/blender/src')
-rw-r--r--source/blender/src/drawscript.c24
1 files changed, 21 insertions, 3 deletions
diff --git a/source/blender/src/drawscript.c b/source/blender/src/drawscript.c
index c4ec1a4db3a..30c3e11f00b 100644
--- a/source/blender/src/drawscript.c
+++ b/source/blender/src/drawscript.c
@@ -85,13 +85,14 @@ void winqreadscriptspace(struct ScrArea *sa, void *spacedata, struct BWinEvent *
void drawscriptspace(ScrArea *sa, void *spacedata)
{
SpaceScript *sc = curarea->spacedata.first;
+ Script *script = NULL;
glClearColor(0.6, 0.6, 0.6, 1.0);
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) {
- Script *script = G.main->script.first;
+ script = G.main->script.first;
while (script) {
@@ -105,7 +106,16 @@ void drawscriptspace(ScrArea *sa, void *spacedata)
if (!sc->script) return;
- BPY_spacescript_do_pywin_draw(sc);
+ script = sc->script;
+
+ if (script->py_draw) {
+ BPY_spacescript_do_pywin_draw(sc);
+ }
+ /* quick hack for 2.37a for scripts that call the progress bar inside a
+ * file selector callback, to show previous space after finishing, w/o
+ * needing an event */
+ else if (!script->flags && !script->py_event && !script->py_button)
+ addqueue(curarea->win, MOUSEX, 0);
}
void winqreadscriptspace(struct ScrArea *sa, void *spacedata, struct BWinEvent *evt)
@@ -117,7 +127,15 @@ void winqreadscriptspace(struct ScrArea *sa, void *spacedata, struct BWinEvent *
Script *script = sc->script;
if (script) {
- BPY_spacescript_do_pywin_event(sc, event, val, ascii);
+ if (script->py_event || script->py_button)
+ BPY_spacescript_do_pywin_event(sc, event, val, ascii);
+
+ /* for file/image sel scripts: if user leaves file/image selection space,
+ * this frees the script (since it can't be accessed anymore): */
+ else if (script->flags == SCRIPT_FILESEL) {
+ script->flags = 0;
+ script->lastspace = SPACE_SCRIPT;
+ }
if (!script->flags) {/* finished with this script, let's free it */
if (script->lastspace != SPACE_SCRIPT)