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>2004-07-16 07:08:43 +0400
committerWillian Padovani Germano <wpgermano@gmail.com>2004-07-16 07:08:43 +0400
commit97bba404fbf97d247d0b6623c7a38f46247afddb (patch)
tree9a881f85bb539508ff184a95d4e50b3db1ae8436 /source/blender/src
parent146021ea2eba641285167814dae99cef79d7d419 (diff)
Demo mode and BPython:
- small additions and fixes to enable the demo mode; - Added sleep() to Blender.sys and 17 new functions to Blender.Window module: things to help demo script writing and as a bonus read / write access to Blender's input event queue; - updates in docs, those interested please check Window.py in python/api2_2x/doc/ to read about the new Blender.Window functions. ---- Demo mode should be working well now for (I) playing rt animation -- aka ALT+A -- and (II) rendering pics and anims and playing anims. I'll still add access to radiosity data and functions. PS: Joseph Gilbert made (II) possible with the Scene.Render module he added for 2.32. He's been coding great things for bpython, so I'd like to take the chance to point that and thank him here.
Diffstat (limited to 'source/blender/src')
-rw-r--r--source/blender/src/editscreen.c14
-rw-r--r--source/blender/src/eventdebug.c1
2 files changed, 15 insertions, 0 deletions
diff --git a/source/blender/src/editscreen.c b/source/blender/src/editscreen.c
index fa9d8f88d07..b592e25daff 100644
--- a/source/blender/src/editscreen.c
+++ b/source/blender/src/editscreen.c
@@ -98,6 +98,7 @@
#include "BSE_headerbuttons.h"
#include "BSE_view.h"
+#include "BPY_extern.h"
#include "mydevice.h"
#include "blendef.h"
#include "render.h"
@@ -191,6 +192,13 @@ void getmouseco_sc(short *mval) /* screen coordinates */
getmouse(mval);
}
+/* mouse_cursor called during a script (via Window.QHandle) need
+ * this function for getmouseco_areawin to work: */
+void set_g_activearea(ScrArea *sa)
+{
+ if (sa) g_activearea = sa;
+}
+
void getmouseco_areawin(short *mval) /* internal area coordinates */
{
getmouseco_sc(mval);
@@ -1027,6 +1035,9 @@ void screenmain(void)
BIF_read_file(ext_load_str);
sound_initialize_sounds();
}
+ else if (event==ONLOAD_SCRIPT) {
+ firsttime = 1; /* trick to run BPY_do_pyscript below */
+ }
else {
towin= 1;
}
@@ -1134,6 +1145,9 @@ void screenmain(void)
// fake a 'p' keypress
mainqenter(PKEY, 1);
+ } else if (G.f & G_SCENESCRIPT) {
+ /* ONLOAD scriptlink */
+ BPY_do_pyscript(&G.scene->id, SCRIPT_ONLOAD);
} else {
extern char datatoc_splash_jpg[];
extern int datatoc_splash_jpg_size;
diff --git a/source/blender/src/eventdebug.c b/source/blender/src/eventdebug.c
index 0f9c425ded7..a4aeabcd406 100644
--- a/source/blender/src/eventdebug.c
+++ b/source/blender/src/eventdebug.c
@@ -187,6 +187,7 @@ char *event_to_string(short evt) {
smap(PAGEDOWNKEY);
smap(ENDKEY);
smap(REDRAWNLA);
+ smap(ONLOAD_SCRIPT);
}
#undef smap
}