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>2008-07-27 02:00:26 +0400
committerWillian Padovani Germano <wpgermano@gmail.com>2008-07-27 02:00:26 +0400
commit8a295553f7fef22b67e3cb3be4d9881cfadedafc (patch)
treecdd9fcfe179773abb450810ae98ca989e6752bd2 /source/creator
parent70ce017777dcaf0ddd68b9533eba8a926aceff1e (diff)
== Python scriptlinks ==
Render/postrender events were missing from bg rendering (and also from rendering called inside scripts). Found this because of bug #17389, the code to prevent race conditions with pynodes is currently inside BPY_do_all_scripts (that runs scriptlinks) and so was not being called in bg mode or rendering via scripts. http://projects.blender.org/tracker/?func=detail&atid=125&aid=17389&group_id=9
Diffstat (limited to 'source/creator')
-rw-r--r--source/creator/creator.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/source/creator/creator.c b/source/creator/creator.c
index 9589f1e3e94..e17b0f66977 100644
--- a/source/creator/creator.c
+++ b/source/creator/creator.c
@@ -618,8 +618,23 @@ int main(int argc, char **argv)
if (G.scene) {
if (a < argc) {
int frame= MIN2(MAXFRAME, MAX2(1, atoi(argv[a])));
+ int slink_flag= 0;
Render *re= RE_NewRender(G.scene->id.name);
+
+ if (G.f & G_DOSCRIPTLINKS) {
+ BPY_do_all_scripts(SCRIPT_RENDER);
+ /* avoid FRAMECHANGED slink event
+ * (should only be triggered in anims): */
+ G.f &= ~G_DOSCRIPTLINKS;
+ slink_flag= 1;
+ }
+
RE_BlenderAnim(re, G.scene, frame, frame);
+
+ if (slink_flag) {
+ G.f |= G_DOSCRIPTLINKS;
+ BPY_do_all_scripts(SCRIPT_POSTRENDER);
+ }
}
} else {
printf("\nError: no blend loaded. cannot use '-f'.\n");
@@ -628,7 +643,14 @@ int main(int argc, char **argv)
case 'a':
if (G.scene) {
Render *re= RE_NewRender(G.scene->id.name);
+
+ if (G.f & G_DOSCRIPTLINKS)
+ BPY_do_all_scripts(SCRIPT_RENDER);
+
RE_BlenderAnim(re, G.scene, G.scene->r.sfra, G.scene->r.efra);
+
+ if (G.f & G_DOSCRIPTLINKS)
+ BPY_do_all_scripts(SCRIPT_POSTRENDER);
} else {
printf("\nError: no blend loaded. cannot use '-a'.\n");
}