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:
Diffstat (limited to 'source/blender/blenkernel')
-rw-r--r--source/blender/blenkernel/CMakeLists.txt3
-rw-r--r--source/blender/blenkernel/SConscript5
-rw-r--r--source/blender/blenkernel/intern/constraint.c10
-rw-r--r--source/blender/blenkernel/intern/context.c4
-rw-r--r--source/blender/blenkernel/intern/exotic.c6
-rw-r--r--source/blender/blenkernel/intern/fcurve.c12
-rw-r--r--source/blender/blenkernel/intern/fmodifier.c4
-rw-r--r--source/blender/blenkernel/intern/node.c2
-rw-r--r--source/blender/blenkernel/intern/object.c2
-rw-r--r--source/blender/blenkernel/intern/script.c2
-rw-r--r--source/blender/blenkernel/intern/text.c6
11 files changed, 27 insertions, 29 deletions
diff --git a/source/blender/blenkernel/CMakeLists.txt b/source/blender/blenkernel/CMakeLists.txt
index 5252003c5b3..eb564720915 100644
--- a/source/blender/blenkernel/CMakeLists.txt
+++ b/source/blender/blenkernel/CMakeLists.txt
@@ -188,8 +188,7 @@ ENDIF(WITH_LCMS)
IF(WITH_PYTHON)
LIST(APPEND INC ../python ${PYTHON_INC})
-ELSE(WITH_PYTHON)
- ADD_DEFINITIONS(-DDISABLE_PYTHON)
+ ADD_DEFINITIONS(-DWITH_PYTHON)
ENDIF(WITH_PYTHON)
IF(WITH_OPENMP)
diff --git a/source/blender/blenkernel/SConscript b/source/blender/blenkernel/SConscript
index e8919a1008a..517c4ce713f 100644
--- a/source/blender/blenkernel/SConscript
+++ b/source/blender/blenkernel/SConscript
@@ -19,11 +19,10 @@ incs += ' ' + env['BF_ZLIB_INC']
defs = [ 'GLEW_STATIC' ]
-if not env['WITH_BF_PYTHON']:
- defs.append('DISABLE_PYTHON')
-else:
+if env['WITH_BF_PYTHON']:
incs += ' ../python'
incs += ' ' + env['BF_PYTHON_INC']
+ defs.append('WITH_PYTHON')
if env['BF_DEBUG']:
defs.append('DEBUG')
diff --git a/source/blender/blenkernel/intern/constraint.c b/source/blender/blenkernel/intern/constraint.c
index 1892f6f0a27..5f387500dd1 100644
--- a/source/blender/blenkernel/intern/constraint.c
+++ b/source/blender/blenkernel/intern/constraint.c
@@ -70,7 +70,7 @@
#include "BKE_shrinkwrap.h"
#include "BKE_mesh.h"
-#ifndef DISABLE_PYTHON
+#ifdef WITH_PYTHON
#include "BPY_extern.h"
#endif
@@ -1983,7 +1983,7 @@ static void pycon_id_looper (bConstraint *con, ConstraintIDFunc func, void *user
/* Whether this approach is maintained remains to be seen (aligorith) */
static void pycon_get_tarmat (bConstraint *con, bConstraintOb *cob, bConstraintTarget *ct, float UNUSED(ctime))
{
-#ifndef DISABLE_PYTHON
+#ifdef WITH_PYTHON
bPythonConstraint *data= con->data;
#endif
@@ -2003,7 +2003,7 @@ static void pycon_get_tarmat (bConstraint *con, bConstraintOb *cob, bConstraintT
constraint_target_to_mat4(cob->scene, ct->tar, ct->subtarget, ct->matrix, CONSTRAINT_SPACE_WORLD, ct->space, con->headtail);
/* only execute target calculation if allowed */
-#ifndef DISABLE_PYTHON
+#ifdef WITH_PYTHON
if (G.f & G_SCRIPT_AUTOEXEC)
BPY_pyconstraint_target(data, ct);
#endif
@@ -2014,7 +2014,7 @@ static void pycon_get_tarmat (bConstraint *con, bConstraintOb *cob, bConstraintT
static void pycon_evaluate (bConstraint *con, bConstraintOb *cob, ListBase *targets)
{
-#ifdef DISABLE_PYTHON
+#ifndef WITH_PYTHON
(void)con; (void)cob; (void)targets; /* unused */
return;
#else
@@ -2034,7 +2034,7 @@ static void pycon_evaluate (bConstraint *con, bConstraintOb *cob, ListBase *targ
/* Now, run the actual 'constraint' function, which should only access the matrices */
BPY_pyconstraint_eval(data, cob, targets);
-#endif /* DISABLE_PYTHON */
+#endif /* WITH_PYTHON */
}
static bConstraintTypeInfo CTI_PYTHON = {
diff --git a/source/blender/blenkernel/intern/context.c b/source/blender/blenkernel/intern/context.c
index a5d96baf049..e1a7ef7bbef 100644
--- a/source/blender/blenkernel/intern/context.c
+++ b/source/blender/blenkernel/intern/context.c
@@ -46,7 +46,7 @@
#include "BKE_main.h"
#include "BKE_screen.h"
-#ifndef DISABLE_PYTHON
+#ifdef WITH_PYTHON
#include "BPY_extern.h"
#endif
@@ -425,7 +425,7 @@ static int ctx_data_get(bContext *C, const char *member, bContextDataResult *res
int ret= 0;
memset(result, 0, sizeof(bContextDataResult));
-#ifndef DISABLE_PYTHON
+#ifdef WITH_PYTHON
if(CTX_py_dict_get(C)) {
return BPY_context_get(C, member, result);
// if (BPY_context_get(C, member, result))
diff --git a/source/blender/blenkernel/intern/exotic.c b/source/blender/blenkernel/intern/exotic.c
index 5e2ca921ef2..a1af728c562 100644
--- a/source/blender/blenkernel/intern/exotic.c
+++ b/source/blender/blenkernel/intern/exotic.c
@@ -79,7 +79,7 @@
#include "BKE_DerivedMesh.h"
#include "BKE_curve.h"
-#ifndef DISABLE_PYTHON
+#ifdef WITH_PYTHON
#include "BPY_extern.h"
#endif
@@ -489,7 +489,7 @@ int BKE_read_exotic(Scene *scene, char *name)
read_stl_mesh_binary(scene, name);
retval = 1;
}
-#ifndef DISABLE_PYTHON
+#ifdef WITH_PYTHON
// TODO: this should not be in the kernel...
else { // unknown format, call Python importloader
if (BPY_call_importloader(name)) {
@@ -499,7 +499,7 @@ int BKE_read_exotic(Scene *scene, char *name)
}
}
-#endif /* DISABLE_PYTHON */
+#endif /* WITH_PYTHON */
//XXX waitcursor(0);
}
}
diff --git a/source/blender/blenkernel/intern/fcurve.c b/source/blender/blenkernel/intern/fcurve.c
index 1575f69209f..75029af4b10 100644
--- a/source/blender/blenkernel/intern/fcurve.c
+++ b/source/blender/blenkernel/intern/fcurve.c
@@ -53,7 +53,7 @@
#include "RNA_access.h"
-#ifndef DISABLE_PYTHON
+#ifdef WITH_PYTHON
#include "BPY_extern.h"
#endif
@@ -1174,7 +1174,7 @@ void driver_free_variable (ChannelDriver *driver, DriverVar *dvar)
else
MEM_freeN(dvar);
-#ifndef DISABLE_PYTHON
+#ifdef WITH_PYTHON
/* since driver variables are cached, the expression needs re-compiling too */
if(driver->type==DRIVER_TYPE_PYTHON)
driver->flag |= DRIVER_FLAG_RENAMEVAR;
@@ -1231,7 +1231,7 @@ DriverVar *driver_add_new_variable (ChannelDriver *driver)
/* set the default type to 'single prop' */
driver_change_variable_type(dvar, DVAR_TYPE_SINGLE_PROP);
-#ifndef DISABLE_PYTHON
+#ifdef WITH_PYTHON
/* since driver variables are cached, the expression needs re-compiling too */
if(driver->type==DRIVER_TYPE_PYTHON)
driver->flag |= DRIVER_FLAG_RENAMEVAR;
@@ -1258,7 +1258,7 @@ void fcurve_free_driver(FCurve *fcu)
driver_free_variable(driver, dvar);
}
-#ifndef DISABLE_PYTHON
+#ifdef WITH_PYTHON
/* free compiled driver expression */
if (driver->expr_comp)
BPY_DECREF(driver->expr_comp);
@@ -1406,7 +1406,7 @@ static float evaluate_driver (ChannelDriver *driver, float UNUSED(evaltime))
case DRIVER_TYPE_PYTHON: /* expression */
{
-#ifndef DISABLE_PYTHON
+#ifdef WITH_PYTHON
/* check for empty or invalid expression */
if ( (driver->expression[0] == '\0') ||
(driver->flag & DRIVER_FLAG_INVALID) )
@@ -1420,7 +1420,7 @@ static float evaluate_driver (ChannelDriver *driver, float UNUSED(evaltime))
*/
driver->curval= BPY_eval_driver(driver);
}
-#endif /* DISABLE_PYTHON*/
+#endif /* WITH_PYTHON*/
}
break;
diff --git a/source/blender/blenkernel/intern/fmodifier.c b/source/blender/blenkernel/intern/fmodifier.c
index c900f178ca7..5ef41d17d63 100644
--- a/source/blender/blenkernel/intern/fmodifier.c
+++ b/source/blender/blenkernel/intern/fmodifier.c
@@ -802,13 +802,13 @@ static void fcm_python_copy (FModifier *fcm, FModifier *src)
static void fcm_python_evaluate (FCurve *UNUSED(fcu), FModifier *UNUSED(fcm), float *UNUSED(cvalue), float UNUSED(evaltime))
{
-#ifndef DISABLE_PYTHON
+#ifdef WITH_PYTHON
//FMod_Python *data= (FMod_Python *)fcm->data;
/* FIXME... need to implement this modifier...
* It will need it execute a script using the custom properties
*/
-#endif /* DISABLE_PYTHON */
+#endif /* WITH_PYTHON */
}
static FModifierTypeInfo FMI_PYTHON = {
diff --git a/source/blender/blenkernel/intern/node.c b/source/blender/blenkernel/intern/node.c
index 6b53e538f8e..41c4fece1a4 100644
--- a/source/blender/blenkernel/intern/node.c
+++ b/source/blender/blenkernel/intern/node.c
@@ -27,7 +27,7 @@
* ***** END GPL LICENSE BLOCK *****
*/
-#ifndef DISABLE_PYTHON
+#ifdef WITH_PYTHON
#include <Python.h>
#endif
diff --git a/source/blender/blenkernel/intern/object.c b/source/blender/blenkernel/intern/object.c
index 5ade08478a2..e006c48aca5 100644
--- a/source/blender/blenkernel/intern/object.c
+++ b/source/blender/blenkernel/intern/object.c
@@ -96,7 +96,7 @@
#include "LBM_fluidsim.h"
-#ifndef DISABLE_PYTHON
+#ifdef WITH_PYTHON
#include "BPY_extern.h"
#endif
diff --git a/source/blender/blenkernel/intern/script.c b/source/blender/blenkernel/intern/script.c
index c07032f71d7..6ffac09e843 100644
--- a/source/blender/blenkernel/intern/script.c
+++ b/source/blender/blenkernel/intern/script.c
@@ -36,7 +36,7 @@
/*
-#ifndef DISABLE_PYTHON
+#ifdef WITH_PYTHON
#include "BPY_extern.h" // Blender Python library
#endif
*/
diff --git a/source/blender/blenkernel/intern/text.c b/source/blender/blenkernel/intern/text.c
index cb3c0c08cc0..09910481bf9 100644
--- a/source/blender/blenkernel/intern/text.c
+++ b/source/blender/blenkernel/intern/text.c
@@ -53,7 +53,7 @@
#include "BKE_text.h"
#include "BKE_utildefines.h"
-#ifndef DISABLE_PYTHON
+#ifdef WITH_PYTHON
#include "BPY_extern.h"
#endif
@@ -167,7 +167,7 @@ void free_text(Text *text)
if(text->name) MEM_freeN(text->name);
MEM_freeN(text->undo_buf);
-#ifndef DISABLE_PYTHON
+#ifdef WITH_PYTHON
if (text->compiled) BPY_free_compiled_text(text);
#endif
}
@@ -683,7 +683,7 @@ int txt_get_span (TextLine *from, TextLine *to)
static void txt_make_dirty (Text *text)
{
text->flags |= TXT_ISDIRTY;
-#ifndef DISABLE_PYTHON
+#ifdef WITH_PYTHON
if (text->compiled) BPY_free_compiled_text(text);
#endif
}