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:
authorCampbell Barton <ideasman42@gmail.com>2008-10-28 21:47:13 +0300
committerCampbell Barton <ideasman42@gmail.com>2008-10-28 21:47:13 +0300
commitac4ff83ca6b5795f4451a7e743d3975aeb17ae3b (patch)
treec4f3f58a967b6c4df9339ffa159f6bb04d619c0f /source/creator
parent705a248c75467ef67eba1cda124fd5375eb4666f (diff)
added scons option BF_WITH_PYTHON (defined as DISABLE_PYTHON)
Diffstat (limited to 'source/creator')
-rw-r--r--source/creator/SConscript3
-rw-r--r--source/creator/creator.c32
2 files changed, 24 insertions, 11 deletions
diff --git a/source/creator/SConscript b/source/creator/SConscript
index c5a661abd69..16556643707 100644
--- a/source/creator/SConscript
+++ b/source/creator/SConscript
@@ -25,4 +25,7 @@ if env['WITH_BF_OPENEXR']:
if not env['WITH_BF_SDL']:
defs.append('DISABLE_SDL')
+if not env['WITH_BF_PYTHON']:
+ defs.append('DISABLE_PYTHON')
+
env.BlenderLib ( libname = 'blender_creator', sources = Split(sources), includes = Split(incs), defines = defs, libtype='core', priority = 1 )
diff --git a/source/creator/creator.c b/source/creator/creator.c
index b5360b31a0a..872a5f4d497 100644
--- a/source/creator/creator.c
+++ b/source/creator/creator.c
@@ -72,7 +72,9 @@
#include "IMB_imbuf.h" // for quicktime_init
+#ifndef DISABLE_PYTHON
#include "BPY_extern.h"
+#endif
#include "RE_pipeline.h"
@@ -515,9 +517,9 @@ int main(int argc, char **argv)
if ( (G.windowstate == G_WINDOWSTATE_BORDER) || (G.windowstate == G_WINDOWSTATE_FULLSCREEN))
setprefsize(stax, stay, sizx, sizy, 0);
-
+#ifndef DISABLE_PYTHON
BPY_start_python(argc, argv);
-
+#endif
/**
* NOTE: sound_init_audio() *must be* after start_python,
* at least on FreeBSD.
@@ -539,8 +541,9 @@ int main(int argc, char **argv)
#endif
}
else {
+#ifndef DISABLE_PYTHON
BPY_start_python(argc, argv);
-
+#endif
BLI_where_is_temp( btempdir, 0 ); /* call after loading the .B.blend so we can read U.tempdir */
// (ton) Commented out. I have no idea whats thisfor... will mail around!
@@ -549,7 +552,7 @@ int main(int argc, char **argv)
// sound_init_audio();
// if (G.f & G_DEBUG) printf("setting audio to: %d\n", audio);
}
-
+#ifndef DISABLE_PYTHON
/**
* NOTE: the U.pythondir string is NULL until BIF_init() is executed,
* so we provide the BPY_ function below to append the user defined
@@ -559,7 +562,8 @@ int main(int argc, char **argv)
* on U.pythondir.
*/
BPY_post_start_python();
-
+#endif
+
#ifdef WITH_QUICKTIME
quicktime_init();
@@ -644,13 +648,14 @@ int main(int argc, char **argv)
if (a < argc) {
int frame= MIN2(MAXFRAME, MAX2(1, atoi(argv[a])));
Render *re= RE_NewRender(G.scene->id.name);
-
+#ifndef DISABLE_PYTHON
if (G.f & G_DOSCRIPTLINKS)
BPY_do_all_scripts(SCRIPT_RENDER, 0);
-
+#endif
RE_BlenderAnim(re, G.scene, frame, frame, G.scene->frame_step);
-
+#ifndef DISABLE_PYTHON
BPY_do_all_scripts(SCRIPT_POSTRENDER, 0);
+#endif
}
} else {
printf("\nError: no blend loaded. cannot use '-f'.\n");
@@ -659,14 +664,15 @@ int main(int argc, char **argv)
case 'a':
if (G.scene) {
Render *re= RE_NewRender(G.scene->id.name);
-
+#ifndef DISABLE_PYTHON
if (G.f & G_DOSCRIPTLINKS)
BPY_do_all_scripts(SCRIPT_RENDER, 1);
-
+#endif
RE_BlenderAnim(re, G.scene, G.scene->r.sfra, G.scene->r.efra, G.scene->frame_step);
-
+#ifndef DISABLE_PYTHON
if (G.f & G_DOSCRIPTLINKS)
BPY_do_all_scripts(SCRIPT_POSTRENDER, 1);
+#endif
} else {
printf("\nError: no blend loaded. cannot use '-a'.\n");
}
@@ -704,6 +710,7 @@ int main(int argc, char **argv)
}
break;
case 'P':
+#ifndef DISABLE_PYTHON
a++;
if (a < argc) {
/* If we're not running in background mode, then give python a valid screen */
@@ -714,6 +721,9 @@ int main(int argc, char **argv)
BPY_run_python_script (argv[a]);
}
else printf("\nError: you must specify a Python script after '-P '.\n");
+#else
+ printf("This blender was built without python support\n");
+#endif /* DISABLE_PYTHON */
break;
case 'o':
a++;