diff options
author | Willian Padovani Germano <wpgermano@gmail.com> | 2008-09-19 02:33:49 +0400 |
---|---|---|
committer | Willian Padovani Germano <wpgermano@gmail.com> | 2008-09-19 02:33:49 +0400 |
commit | 6ff74f45279aeea88fa9a93ba0ced726fdeafc5a (patch) | |
tree | a08f2ad3bd979a4707658ae79490874e010c632e /source/creator | |
parent | ec6bd008c1899986c619ce1976709eac1c1c1e0c (diff) |
== Python Script Links ==
Bug #17599:
Summary: Python constraints, good in 2.46 not working anymore in 2.47
http://projects.blender.org/tracker/?func=detail&atid=125&aid=17599&group_id=9
Improved my old hack to avoid frame changed scriptlinks from running when rendering stills, should fix this bug. It also causes REDRAW scriptlinks to be executed during renders, but that conforms to how FRAMECHANGED ones work.
BTW: this can still be improved. The current system meant to disable all Python functionality at once needs imo to be replaced by one that allows to enable / disable per feature (scriptlinks, pyconstraints, pynodes, etc.). A better way to inform scriptlinks about what is going on (render, anim, render anim, etc.) would also help. Will discuss with others.
Diffstat (limited to 'source/creator')
-rw-r--r-- | source/creator/creator.c | 19 |
1 files changed, 5 insertions, 14 deletions
diff --git a/source/creator/creator.c b/source/creator/creator.c index f27dee946ed..ac81557110f 100644 --- a/source/creator/creator.c +++ b/source/creator/creator.c @@ -618,23 +618,14 @@ 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; - } + if (G.f & G_DOSCRIPTLINKS) + BPY_do_all_scripts(SCRIPT_RENDER, 0); RE_BlenderAnim(re, G.scene, frame, frame); - if (slink_flag) { - G.f |= G_DOSCRIPTLINKS; - BPY_do_all_scripts(SCRIPT_POSTRENDER); - } + BPY_do_all_scripts(SCRIPT_POSTRENDER, 0); } } else { printf("\nError: no blend loaded. cannot use '-f'.\n"); @@ -645,12 +636,12 @@ int main(int argc, char **argv) Render *re= RE_NewRender(G.scene->id.name); if (G.f & G_DOSCRIPTLINKS) - BPY_do_all_scripts(SCRIPT_RENDER); + BPY_do_all_scripts(SCRIPT_RENDER, 1); RE_BlenderAnim(re, G.scene, G.scene->r.sfra, G.scene->r.efra); if (G.f & G_DOSCRIPTLINKS) - BPY_do_all_scripts(SCRIPT_POSTRENDER); + BPY_do_all_scripts(SCRIPT_POSTRENDER, 1); } else { printf("\nError: no blend loaded. cannot use '-a'.\n"); } |