diff options
author | Campbell Barton <ideasman42@gmail.com> | 2010-10-31 07:11:39 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2010-10-31 07:11:39 +0300 |
commit | 0876fce0094ad3e37be4b197ef8850757eacd37b (patch) | |
tree | bdcd409899a59f1d0239b14d0ec79a7e5f531a06 | |
parent | 50dab4fc37d33352c2f1c6181da9d54799e36a12 (diff) |
rename and negate DISABLE_PYTHON --> WITH_PYTHON
217 files changed, 477 insertions, 505 deletions
diff --git a/build_files/make/nan_compile.mk b/build_files/make/nan_compile.mk index a6d157d99c6..2931adb444c 100644 --- a/build_files/make/nan_compile.mk +++ b/build_files/make/nan_compile.mk @@ -35,6 +35,8 @@ include nan_definitions.mk CPPFLAGS ?= $(NAN_CPPFLAGS) # common parts --------------------------------------------------- +CFLAGS += -DWITH_PYTHON +CCFLAGS += -DWITH_PYTHON # Uncomment next lines to enable integrated game engine ifneq ($(NAN_NO_KETSJI), true) diff --git a/intern/audaspace/CMakeLists.txt b/intern/audaspace/CMakeLists.txt index 2dd4694d8a9..be39a7348aa 100644 --- a/intern/audaspace/CMakeLists.txt +++ b/intern/audaspace/CMakeLists.txt @@ -178,8 +178,7 @@ IF(WITH_PYTHON) SET(PYTHONSRC Python/AUD_PyAPI.cpp ) -ELSE(WITH_PYTHON) - ADD_DEFINITIONS(-DDISABLE_PYTHON) + ADD_DEFINITIONS(-DWITH_PYTHON) ENDIF(WITH_PYTHON) SET(SRC ${SRC} ${FFMPEGSRC} ${SNDFILESRC} ${FFTW3SRC} ${SDLSRC} ${OPENALSRC} ${JACKSRC} ${PYTHONSRC}) diff --git a/intern/audaspace/SConscript b/intern/audaspace/SConscript index 7230bffebdc..2c86849bc62 100644 --- a/intern/audaspace/SConscript +++ b/intern/audaspace/SConscript @@ -39,8 +39,7 @@ if env['WITH_BF_SNDFILE']: if env['WITH_BF_PYTHON']: sources += env.Glob('Python/*.cpp') incs += ' Python ' + env['BF_PYTHON_INC'] -else: - defs.append('DISABLE_PYTHON') + defs.append('WITH_PYTHON') if env['OURPLATFORM'] in ('win32-vc', 'win32-mingw', 'linuxcross', 'win64-vc'): incs += ' ' + env['BF_PTHREADS_INC'] diff --git a/intern/audaspace/intern/AUD_C-API.cpp b/intern/audaspace/intern/AUD_C-API.cpp index 38732fc13e1..1dd0ab1ac95 100644 --- a/intern/audaspace/intern/AUD_C-API.cpp +++ b/intern/audaspace/intern/AUD_C-API.cpp @@ -28,7 +28,7 @@ #define __STDC_CONSTANT_MACROS #endif -#ifndef DISABLE_PYTHON +#ifdef WITH_PYTHON #include "AUD_PyInit.h" #include "AUD_PyAPI.h" @@ -141,7 +141,7 @@ int AUD_init(AUD_DeviceType device, AUD_DeviceSpecs specs, int buffersize) AUD_device = dev; AUD_3ddevice = dynamic_cast<AUD_I3DDevice*>(AUD_device); -#ifndef DISABLE_PYTHON +#ifdef WITH_PYTHON if(g_pyinitialized) { g_device = (Device*)Device_empty(); @@ -162,7 +162,7 @@ int AUD_init(AUD_DeviceType device, AUD_DeviceSpecs specs, int buffersize) void AUD_exit() { -#ifndef DISABLE_PYTHON +#ifdef WITH_PYTHON if(g_device) { Py_XDECREF(g_device); @@ -176,7 +176,7 @@ void AUD_exit() AUD_3ddevice = NULL; } -#ifndef DISABLE_PYTHON +#ifdef WITH_PYTHON static PyObject* AUD_getCDevice(PyObject* self) { if(g_device) diff --git a/intern/audaspace/intern/AUD_PyInit.h b/intern/audaspace/intern/AUD_PyInit.h index bd67259449a..0b80b3a9ae1 100644 --- a/intern/audaspace/intern/AUD_PyInit.h +++ b/intern/audaspace/intern/AUD_PyInit.h @@ -26,7 +26,7 @@ #ifndef AUD_PYINIT #define AUD_PYINIT -#ifndef DISABLE_PYTHON +#ifdef WITH_PYTHON #include "Python.h" #ifdef __cplusplus diff --git a/release/scripts/ui/space_text.py b/release/scripts/ui/space_text.py index 163fa07e1d6..58f12ba51e4 100644 --- a/release/scripts/ui/space_text.py +++ b/release/scripts/ui/space_text.py @@ -174,7 +174,7 @@ class TEXT_MT_text(bpy.types.Menu): layout.column() layout.operator("text.run_script") - #ifndef DISABLE_PYTHON + #ifdef WITH_PYTHON # XXX if(BPY_is_pyconstraint(text)) # XXX uiMenuItemO(head, 0, "text.refresh_pyconstraints"); #endif 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 } diff --git a/source/blender/editors/interface/CMakeLists.txt b/source/blender/editors/interface/CMakeLists.txt index 31de4537c24..23a96cce3dc 100644 --- a/source/blender/editors/interface/CMakeLists.txt +++ b/source/blender/editors/interface/CMakeLists.txt @@ -56,8 +56,8 @@ IF(WITH_INTERNATIONAL) ADD_DEFINITIONS(-DINTERNATIONAL) ENDIF(WITH_INTERNATIONAL) -IF(NOT WITH_PYTHON) - ADD_DEFINITIONS(-DDISABLE_PYTHON) -ENDIF(NOT WITH_PYTHON) +IF(WITH_PYTHON) + ADD_DEFINITIONS(-DWITH_PYTHON) +ENDIF(WITH_PYTHON) BLENDERLIB(bf_editor_interface "${SRC}" "${INC}") diff --git a/source/blender/editors/interface/SConscript b/source/blender/editors/interface/SConscript index 81964a661a4..639a5268ca2 100644 --- a/source/blender/editors/interface/SConscript +++ b/source/blender/editors/interface/SConscript @@ -16,7 +16,7 @@ defs = [] if env['WITH_BF_INTERNATIONAL']: defs.append('INTERNATIONAL') -if not env['WITH_BF_PYTHON']: - defs.append('DISABLE_PYTHON') +if env['WITH_BF_PYTHON']: + defs.append('WITH_PYTHON') env.BlenderLib ( 'bf_editors_interface', sources, Split(incs), defs, libtype=['core'], priority=[110] ) diff --git a/source/blender/editors/interface/interface.c b/source/blender/editors/interface/interface.c index f65b10eaaea..eee4f133043 100644 --- a/source/blender/editors/interface/interface.c +++ b/source/blender/editors/interface/interface.c @@ -1645,7 +1645,7 @@ int ui_set_but_string(bContext *C, uiBut *but, const char *str) /* number editing */ double value; -#ifndef DISABLE_PYTHON +#ifdef WITH_PYTHON { char str_unit_convert[256]; int unit_type; @@ -1672,7 +1672,7 @@ int ui_set_but_string(bContext *C, uiBut *but, const char *str) } #else value= atof(str); -#endif +#endif // WITH_PYTHON if(!ui_is_but_float(but)) value= (int)floor(value + 0.5); if(but->type==NUMABS) value= fabs(value); diff --git a/source/blender/editors/mesh/editface.c b/source/blender/editors/mesh/editface.c index e33e24a75ce..81e19e5db3f 100644 --- a/source/blender/editors/mesh/editface.c +++ b/source/blender/editors/mesh/editface.c @@ -52,7 +52,7 @@ #include "BIF_gl.h" -#ifndef DISABLE_PYTHON +#ifdef WITH_PYTHON //#include "BPY_extern.h" //#include "BPY_menus.h" #endif diff --git a/source/blender/editors/object/CMakeLists.txt b/source/blender/editors/object/CMakeLists.txt index bfcb233e466..224d72895ba 100644 --- a/source/blender/editors/object/CMakeLists.txt +++ b/source/blender/editors/object/CMakeLists.txt @@ -55,8 +55,8 @@ IF(WIN32) LIST(APPEND INC ${PTHREADS_INC}) ENDIF(WIN32) -IF(NOT WITH_PYTHON) - ADD_DEFINITIONS(-DDISABLE_PYTHON) -ENDIF(NOT WITH_PYTHON) +IF(WITH_PYTHON) + ADD_DEFINITIONS(-DWITH_PYTHON) +ENDIF(WITH_PYTHON) BLENDERLIB(bf_editor_object "${SRC}" "${INC}") diff --git a/source/blender/editors/object/SConscript b/source/blender/editors/object/SConscript index 98085dd2fe5..e39190c0ef3 100644 --- a/source/blender/editors/object/SConscript +++ b/source/blender/editors/object/SConscript @@ -17,7 +17,7 @@ if env['OURPLATFORM'] == 'linux2': if env['OURPLATFORM'] in ('win32-vc', 'win32-mingw', 'linuxcross', 'win64-vc'): incs += ' ' + env['BF_PTHREADS_INC'] -if not env['WITH_BF_PYTHON']: - defs.append('DISABLE_PYTHON') +if env['WITH_BF_PYTHON']: + defs.append('WITH_PYTHON') env.BlenderLib ( 'bf_editors_object', sources, Split(incs), defs, libtype=['core'], priority=[35] ) diff --git a/source/blender/editors/object/object_constraint.c b/source/blender/editors/object/object_constraint.c index 09760a8f51b..d3b26100727 100644 --- a/source/blender/editors/object/object_constraint.c +++ b/source/blender/editors/object/object_constraint.c @@ -53,7 +53,7 @@ #include "BKE_report.h" #include "BIK_api.h" -#ifndef DISABLE_PYTHON +#ifdef WITH_PYTHON #include "BPY_extern.h" #endif @@ -154,7 +154,7 @@ void validate_pyconstraint_cb (void *arg1, void *arg2) data->text = text; } -#ifndef DISABLE_PYTHON +#ifdef WITH_PYTHON /* this returns a string for the list of usable pyconstraint script names */ char *buildmenu_pyconstraints (Text *con_text, int *pyconindex) { @@ -195,12 +195,12 @@ char *buildmenu_pyconstraints (Text *con_text, int *pyconindex) return str; } -#endif /* DISABLE_PYTHON */ +#endif /* WITH_PYTHON */ /* this callback gets called when the 'refresh' button of a pyconstraint gets pressed */ void update_pyconstraint_cb (void *arg1, void *arg2) { -#ifdef DISABLE_PYTHON +#ifndef WITH_PYTHON (void)arg1; /* unused */ (void)arg2; /* unused */ #else @@ -1297,7 +1297,7 @@ static int constraint_add_exec(bContext *C, wmOperator *op, Object *ob, ListBase case CONSTRAINT_TYPE_PYTHON: // FIXME: this code is not really valid anymore { -#ifndef DISABLE_PYTHON +#ifdef WITH_PYTHON char *menustr; int scriptint= 0; /* popup a list of usable scripts */ diff --git a/source/blender/editors/space_console/CMakeLists.txt b/source/blender/editors/space_console/CMakeLists.txt index b1d9920fed4..dbef838db65 100644 --- a/source/blender/editors/space_console/CMakeLists.txt +++ b/source/blender/editors/space_console/CMakeLists.txt @@ -38,8 +38,8 @@ SET(SRC space_console.c ) -IF(NOT WITH_PYTHON) - ADD_DEFINITIONS(-DDISABLE_PYTHON) -ENDIF(NOT WITH_PYTHON) +IF(WITH_PYTHON) + ADD_DEFINITIONS(-DWITH_PYTHON) +ENDIF(WITH_PYTHON) BLENDERLIB(bf_editor_space_console "${SRC}" "${INC}") diff --git a/source/blender/editors/space_console/SConscript b/source/blender/editors/space_console/SConscript index 087090a7740..f246f08d7ac 100644 --- a/source/blender/editors/space_console/SConscript +++ b/source/blender/editors/space_console/SConscript @@ -17,7 +17,7 @@ incs = [ '../../blenloader', ] -if not env['WITH_BF_PYTHON']: - defs.append('DISABLE_PYTHON') +if env['WITH_BF_PYTHON']: + defs.append('WITH_PYTHON') env.BlenderLib ( 'bf_editors_space_console', sources, incs, defs, libtype=['core'], priority=[95] ) diff --git a/source/blender/editors/space_console/space_console.c b/source/blender/editors/space_console/space_console.c index 70263788b13..72478133f1c 100644 --- a/source/blender/editors/space_console/space_console.c +++ b/source/blender/editors/space_console/space_console.c @@ -327,7 +327,7 @@ void console_keymap(struct wmKeyConfig *keyconf) RNA_enum_set(WM_keymap_add_item(keymap, "CONSOLE_OT_delete", DELKEY, KM_PRESS, 0, 0)->ptr, "type", DEL_NEXT_CHAR); RNA_enum_set(WM_keymap_add_item(keymap, "CONSOLE_OT_delete", BACKSPACEKEY, KM_PRESS, 0, 0)->ptr, "type", DEL_PREV_CHAR); -#ifndef DISABLE_PYTHON +#ifdef WITH_PYTHON WM_keymap_add_item(keymap, "CONSOLE_OT_execute", RETKEY, KM_PRESS, 0, 0); /* python operator - space_text.py */ WM_keymap_add_item(keymap, "CONSOLE_OT_execute", PADENTER, KM_PRESS, 0, 0); diff --git a/source/blender/editors/space_script/CMakeLists.txt b/source/blender/editors/space_script/CMakeLists.txt index 88c0ea56ab2..17fcf2296e9 100644 --- a/source/blender/editors/space_script/CMakeLists.txt +++ b/source/blender/editors/space_script/CMakeLists.txt @@ -38,8 +38,7 @@ SET(SRC IF(WITH_PYTHON) LIST(APPEND INC ${PYTHON_INC} ../../python) -ELSE(WITH_PYTHON) - ADD_DEFINITIONS(-DDISABLE_PYTHON) + ADD_DEFINITIONS(-DWITH_PYTHON) ENDIF(WITH_PYTHON) BLENDERLIB(bf_editor_space_script "${SRC}" "${INC}") diff --git a/source/blender/editors/space_script/SConscript b/source/blender/editors/space_script/SConscript index f187df19117..8c75b999bc0 100644 --- a/source/blender/editors/space_script/SConscript +++ b/source/blender/editors/space_script/SConscript @@ -10,7 +10,7 @@ incs += ' ../../python' defs = [] -if not env['WITH_BF_PYTHON']: - defs.append('DISABLE_PYTHON') +if env['WITH_BF_PYTHON']: + defs.append('WITH_PYTHON') env.BlenderLib ( 'bf_editors_space_script', sources, Split(incs), defs, libtype=['core'], priority=[90] ) diff --git a/source/blender/editors/space_script/script_edit.c b/source/blender/editors/space_script/script_edit.c index 23bc385c758..b9ece0add2f 100644 --- a/source/blender/editors/space_script/script_edit.c +++ b/source/blender/editors/space_script/script_edit.c @@ -46,7 +46,7 @@ #include "script_intern.h" // own include -#ifndef DISABLE_PYTHON +#ifdef WITH_PYTHON #include "BPY_extern.h" /* BPY_run_python_script */ #endif @@ -54,7 +54,7 @@ static int run_pyfile_exec(bContext *C, wmOperator *op) { char path[512]; RNA_string_get(op->ptr, "filepath", path); -#ifndef DISABLE_PYTHON +#ifdef WITH_PYTHON if(BPY_run_python_script(C, path, NULL, op->reports)) { ARegion *ar= CTX_wm_region(C); ED_region_tag_redraw(ar); @@ -84,7 +84,7 @@ void SCRIPT_OT_python_file_run(wmOperatorType *ot) static int script_reload_exec(bContext *C, wmOperator *UNUSED(op)) { -#ifndef DISABLE_PYTHON +#ifdef WITH_PYTHON /* TODO, this crashes on netrender and keying sets, need to look into why * disable for now unless running in debug mode */ WM_cursor_wait(1); diff --git a/source/blender/editors/space_script/space_script.c b/source/blender/editors/space_script/space_script.c index 2036b0f730a..57d7bba8e3b 100644 --- a/source/blender/editors/space_script/space_script.c +++ b/source/blender/editors/space_script/space_script.c @@ -49,7 +49,7 @@ #include "UI_resources.h" #include "UI_view2d.h" -#ifndef DISABLE_PYTHON +#ifdef WITH_PYTHON #include "BPY_extern.h" #endif @@ -94,7 +94,7 @@ static void script_free(SpaceLink *sl) { SpaceScript *sscript= (SpaceScript*) sl; -#ifndef DISABLE_PYTHON +#ifdef WITH_PYTHON /*free buttons references*/ if (sscript->but_refs) { // XXX BPy_Set_DrawButtonsList(sscript->but_refs); @@ -150,7 +150,7 @@ static void script_main_area_draw(const bContext *C, ARegion *ar) /* data... */ // BPY_run_python_script(C, "/root/blender-svn/blender25/test.py", NULL); -#ifndef DISABLE_PYTHON +#ifdef WITH_PYTHON if (sscript->script) { //BPY_run_python_script_space(scpt->script.filename, NULL); BPY_run_script_space_draw(C, sscript); diff --git a/source/blender/editors/space_text/CMakeLists.txt b/source/blender/editors/space_text/CMakeLists.txt index b53a86fbe39..708fc161655 100644 --- a/source/blender/editors/space_text/CMakeLists.txt +++ b/source/blender/editors/space_text/CMakeLists.txt @@ -40,8 +40,7 @@ SET(SRC IF(WITH_PYTHON) LIST(APPEND INC ${PYTHON_INC} ../../python) -ELSE(WITH_PYTHON) - ADD_DEFINITIONS(-DDISABLE_PYTHON) + ADD_DEFINITIONS(-DWITH_PYTHON) ENDIF(WITH_PYTHON) BLENDERLIB(bf_editor_text "${SRC}" "${INC}") diff --git a/source/blender/editors/space_text/SConscript b/source/blender/editors/space_text/SConscript index bd87a799756..6d2816b7834 100644 --- a/source/blender/editors/space_text/SConscript +++ b/source/blender/editors/space_text/SConscript @@ -7,7 +7,7 @@ incs = '../include ../../blenlib ../../blenkernel ../../makesdna ../../imbuf' incs += ' ../../windowmanager #/intern/guardedalloc #/extern/glew/include' incs += ' ../../python ../../makesrna ../../blenfont' -if not env['WITH_BF_PYTHON']: - defs.append('DISABLE_PYTHON') +if env['WITH_BF_PYTHON']: + defs.append('WITH_PYTHON') env.BlenderLib ( 'bf_editors_space_text', sources, Split(incs), defs, libtype=['core'], priority=[95] ) diff --git a/source/blender/editors/space_text/text_header.c b/source/blender/editors/space_text/text_header.c index 464e144515f..b7bf61497bd 100644 --- a/source/blender/editors/space_text/text_header.c +++ b/source/blender/editors/space_text/text_header.c @@ -57,7 +57,7 @@ -#ifndef DISABLE_PYTHON +#ifdef WITH_PYTHON // XXX #include "BPY_menus.h" #endif diff --git a/source/blender/editors/space_text/text_ops.c b/source/blender/editors/space_text/text_ops.c index af29e575482..d2defb0341d 100644 --- a/source/blender/editors/space_text/text_ops.c +++ b/source/blender/editors/space_text/text_ops.c @@ -58,7 +58,7 @@ #include "RNA_access.h" #include "RNA_define.h" -#ifndef DISABLE_PYTHON +#ifdef WITH_PYTHON #include "BPY_extern.h" #endif @@ -310,7 +310,7 @@ static int reload_exec(bContext *C, wmOperator *op) return OPERATOR_CANCELLED; } -#ifndef DISABLE_PYTHON +#ifdef WITH_PYTHON if(text->compiled) BPY_free_compiled_text(text); #endif @@ -557,7 +557,7 @@ static int run_script_poll(bContext *C) static int run_script_exec(bContext *C, wmOperator *op) { -#ifdef DISABLE_PYTHON +#ifndef WITH_PYTHON (void)C; /* unused */ BKE_report(op->reports, RPT_ERROR, "Python disabled in this build"); @@ -597,7 +597,7 @@ void TEXT_OT_run_script(wmOperatorType *ot) static int refresh_pyconstraints_exec(bContext *UNUSED(C), wmOperator *UNUSED(op)) { -#ifndef DISABLE_PYTHON +#ifdef WITH_PYTHON #if 0 Text *text= CTX_data_edit_text(C); Object *ob; diff --git a/source/blender/editors/space_text/text_python.c b/source/blender/editors/space_text/text_python.c index 6e64bef4c85..720e80ec162 100644 --- a/source/blender/editors/space_text/text_python.c +++ b/source/blender/editors/space_text/text_python.c @@ -358,7 +358,7 @@ short do_texttools(SpaceText *st, char ascii, unsigned short evnt, short val) } #if 0 -#ifndef DISABLE_PYTHON +#ifdef WITH_PYTHON /* Run text plugin scripts if enabled */ if(st->doplugins && event && val) { if(BPY_menu_do_shortcut(PYMENU_TEXTPLUGIN, event, qual)) { diff --git a/source/blender/editors/util/undo.c b/source/blender/editors/util/undo.c index a4f661e9511..37a3a65f170 100644 --- a/source/blender/editors/util/undo.c +++ b/source/blender/editors/util/undo.c @@ -156,7 +156,7 @@ static int ed_undo_step(bContext *C, int step, const char *undoname) if(do_glob_undo) { if(U.uiflag & USER_GLOBALUNDO) { -#ifndef DISABLE_PYTHON +#ifdef WITH_PYTHON // XXX BPY_scripts_clear_pyobjects(); #endif if(undoname) diff --git a/source/blender/makesrna/SConscript b/source/blender/makesrna/SConscript index 68a292d8386..d8937d044d3 100644 --- a/source/blender/makesrna/SConscript +++ b/source/blender/makesrna/SConscript @@ -51,8 +51,8 @@ if env['WITH_BF_GAMEENGINE']: if env['BF_UNIT_TEST']: defs.append('UNIT_TEST') -if not env['WITH_BF_PYTHON']: - defs.append('DISABLE_PYTHON') +if env['WITH_BF_PYTHON']: + defs.append('WITH_PYTHON') if env['OURPLATFORM'] == 'linux2': cflags='-pthread' diff --git a/source/blender/makesrna/intern/CMakeLists.txt b/source/blender/makesrna/intern/CMakeLists.txt index 6ca5203d249..d0219009a45 100644 --- a/source/blender/makesrna/intern/CMakeLists.txt +++ b/source/blender/makesrna/intern/CMakeLists.txt @@ -65,16 +65,16 @@ INCLUDE_DIRECTORIES( FILE(GLOB INC_FILES ../*.h ../../makesdna/*.h) -IF(NOT WITH_PYTHON) - ADD_DEFINITIONS(-DDISABLE_PYTHON) -ENDIF(NOT WITH_PYTHON) +IF(WITH_PYTHON) + ADD_DEFINITIONS(-DWITH_PYTHON) +ENDIF(WITH_PYTHON) IF(WIN32) LIST(APPEND INC ${PTHREADS_INC}) ENDIF(WIN32) IF(WITH_GAMEENGINE) - ADD_DEFINITIONS(-DWITH_GAME_ENGINE) + ADD_DEFINITIONS(-DWITH_GAMEENGINE) ENDIF(WITH_GAMEENGINE) IF(WITH_IMAGE_OPENEXR) diff --git a/source/blender/makesrna/intern/SConscript b/source/blender/makesrna/intern/SConscript index b37cfd5c38b..b8e30bcfe98 100644 --- a/source/blender/makesrna/intern/SConscript +++ b/source/blender/makesrna/intern/SConscript @@ -85,8 +85,8 @@ if env['WITH_BF_JACK']: if env['BF_UNIT_TEST']: defs.append('UNIT_TEST') -if not env['WITH_BF_PYTHON']: - defs.append('DISABLE_PYTHON') +if env['WITH_BF_PYTHON']: + defs.append('WITH_PYTHON') if env['OURPLATFORM'] == 'linux2': cflags='-pthread' diff --git a/source/blender/makesrna/intern/rna_wm.c b/source/blender/makesrna/intern/rna_wm.c index 1bc22b7af25..f8c262dff43 100644 --- a/source/blender/makesrna/intern/rna_wm.c +++ b/source/blender/makesrna/intern/rna_wm.c @@ -649,7 +649,7 @@ static void rna_wmClipboard_set(PointerRNA *ptr, const char *value) WM_clipboard_text_set((void *) value, FALSE); } -#ifndef DISABLE_PYTHON +#ifdef WITH_PYTHON static void rna_Operator_unregister(const bContext *C, StructRNA *type) { char *idname; @@ -952,7 +952,7 @@ static StructRNA *rna_MacroOperator_register(const bContext *C, ReportList *repo return dummyot.ext.srna; } -#endif /* DISABLE_PYTHON */ +#endif /* WITH_PYTHON */ static StructRNA* rna_Operator_refine(PointerRNA *opr) { @@ -1061,7 +1061,7 @@ static void rna_def_operator(BlenderRNA *brna) RNA_def_struct_ui_text(srna, "Operator", "Storage of an operator being executed, or registered after execution"); RNA_def_struct_sdna(srna, "wmOperator"); RNA_def_struct_refine_func(srna, "rna_Operator_refine"); -#ifndef DISABLE_PYTHON +#ifdef WITH_PYTHON RNA_def_struct_register_funcs(srna, "rna_Operator_register", "rna_Operator_unregister"); #endif @@ -1124,7 +1124,7 @@ static void rna_def_macro_operator(BlenderRNA *brna) RNA_def_struct_ui_text(srna, "Macro Operator", "Storage of a macro operator being executed, or registered after execution"); RNA_def_struct_sdna(srna, "wmOperator"); RNA_def_struct_refine_func(srna, "rna_MacroOperator_refine"); -#ifndef DISABLE_PYTHON +#ifdef WITH_PYTHON RNA_def_struct_register_funcs(srna, "rna_MacroOperator_register", "rna_Operator_unregister"); #endif diff --git a/source/blender/nodes/CMakeLists.txt b/source/blender/nodes/CMakeLists.txt index d4383f330c4..5a6470d994e 100644 --- a/source/blender/nodes/CMakeLists.txt +++ b/source/blender/nodes/CMakeLists.txt @@ -146,8 +146,7 @@ ENDIF(WIN32) IF(WITH_PYTHON) SET(INC ${INC} ../python ${PYTHON_INC}) -ELSE(WITH_PYTHON) - ADD_DEFINITIONS(-DDISABLE_PYTHON) + ADD_DEFINITIONS(-DWITH_PYTHON) ENDIF(WITH_PYTHON) BLENDERLIB(bf_nodes "${SRC}" "${INC}") diff --git a/source/blender/nodes/SConscript b/source/blender/nodes/SConscript index 3e7e0dbe54c..4bed612144c 100644 --- a/source/blender/nodes/SConscript +++ b/source/blender/nodes/SConscript @@ -22,10 +22,9 @@ defs = [] if env['WITH_BF_PYTHON']: incs += ' ' + env['BF_PYTHON_INC'] incs += ' ../python' + defs.append('WITH_PYTHON') if env['BF_DEBUG']: defs.append('_DEBUG') -else: - defs.append('DISABLE_PYTHON') if env['OURPLATFORM'] == 'linux2': cflags='-pthread' diff --git a/source/blender/nodes/intern/SHD_nodes/SHD_dynamic.c b/source/blender/nodes/intern/SHD_nodes/SHD_dynamic.c index 5e391e02feb..a548893905a 100644 --- a/source/blender/nodes/intern/SHD_nodes/SHD_dynamic.c +++ b/source/blender/nodes/intern/SHD_nodes/SHD_dynamic.c @@ -27,22 +27,22 @@ * ***** END GPL LICENSE BLOCK ***** */ -#ifndef DISABLE_PYTHON +/* TODO, support python3.x */ +#undef WITH_PYTHON + +#ifdef WITH_PYTHON #include <Python.h> #include <compile.h> #include <eval.h> #endif -/* TODO, support python3.x */ -#define DISABLE_PYTHON 1 - #include "DNA_text_types.h" #include "BKE_text.h" #include "BKE_utildefines.h" // XXX #if 0 -#ifndef DISABLE_PYTHON +#ifdef WITH_PYTHON #include "api2_2x/Node.h" #include "api2_2x/gen_utils.h" #include "BPY_extern.h" @@ -57,7 +57,7 @@ static void node_dynamic_setup(bNode *node); static void node_dynamic_exec_cb(void *data, bNode *node, bNodeStack **in, bNodeStack **out); static void node_dynamic_free_storage_cb(bNode *node); -#ifndef DISABLE_PYTHON +#ifdef WITH_PYTHON static PyObject *init_dynamicdict(void) { PyObject *newscriptdict, *item; PyGILState_STATE gilstate = PyGILState_Ensure(); @@ -156,7 +156,7 @@ static void node_dynamic_update_socket_links(bNode *node, bNodeTree *ntree) static void node_dynamic_free_storage_cb(bNode *node) { -#ifndef DISABLE_PYTHON +#ifdef WITH_PYTHON NodeScriptDict *nsd; PyObject *pydict; BPy_Node *pynode; @@ -186,7 +186,7 @@ static void node_dynamic_disable(bNode *node) /* Disable all pynodes using the given text (script) id */ static void node_dynamic_disable_all_by_id(ID *id) { -#ifndef DISABLE_PYTHON +#ifdef WITH_PYTHON Material *ma; /* XXX hardcoded for shaders */ for (ma= G.main->mat.first; ma; ma= ma->id.next) { @@ -346,7 +346,7 @@ int nodeDynamicUnlinkText(ID *txtid) { static void node_dynamic_pyerror_print(bNode *node) { -#ifndef DISABLE_PYTHON +#ifdef WITH_PYTHON PyGILState_STATE gilstate = PyGILState_Ensure(); fprintf(stderr, "\nError in dynamic node script \"%s\":\n", node->name); @@ -373,7 +373,7 @@ static void node_dynamic_register_type(bNode *node) node->typeinfo->name = BLI_strdup(node->name); } -#ifndef DISABLE_PYTHON +#ifdef WITH_PYTHON /* node_dynamic_get_pynode: * Find the pynode definition from the script */ static PyObject *node_dynamic_get_pynode(PyObject *dict) @@ -415,11 +415,11 @@ static PyObject *node_dynamic_get_pynode(PyObject *dict) "no PyNode definition found in the script!"); return NULL; } -#endif /* DISABLE_PYTHON */ +#endif /* WITH_PYTHON */ static int node_dynamic_parse(struct bNode *node) { -#ifdef DISABLE_PYTHON +#ifndef WITH_PYTHON return -1; #else PyObject *dict= NULL; @@ -516,7 +516,7 @@ static int node_dynamic_parse(struct bNode *node) * pynodes already linked to a script (node->id != NULL). */ static void node_dynamic_setup(bNode *node) { -#ifndef DISABLE_PYTHON +#ifdef WITH_PYTHON NodeScriptDict *nsd = NULL; bNodeTree *nodetree = NULL; bNodeType *ntype = NULL; @@ -640,7 +640,7 @@ static void node_dynamic_setup(bNode *node) node->custom1 = BSET(node->custom1, NODE_DYNAMIC_READY); PyGILState_Release(gilstate); -#endif /* DISABLE_PYTHON */ +#endif /* WITH_PYTHON */ return; } @@ -673,7 +673,7 @@ static void node_dynamic_init_cb(bNode *node) { /* node_dynamic_copy_cb: pynode copy callback */ static void node_dynamic_copy_cb(bNode *orig_node, bNode *new_node) { -#ifdef DISABLE_PYTHON +#ifndef WITH_PYTHON return; #else NodeScriptDict *nsd; @@ -698,7 +698,7 @@ static void node_dynamic_copy_cb(bNode *orig_node, bNode *new_node) /* node_dynamic_exec_cb: the execution callback called per pixel * during rendering. */ static void node_dynamic_exec_cb(void *data, bNode *node, bNodeStack **in, bNodeStack **out) { -#ifdef DISABLE_PYTHON +#ifndef WITH_PYTHON return; #else BPy_Node *mynode = NULL; diff --git a/source/blender/windowmanager/CMakeLists.txt b/source/blender/windowmanager/CMakeLists.txt index fa3a196d9c5..6c93334fd0a 100644 --- a/source/blender/windowmanager/CMakeLists.txt +++ b/source/blender/windowmanager/CMakeLists.txt @@ -86,8 +86,7 @@ ENDIF(WITH_FFMPEG) 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_GAMEENGINE) diff --git a/source/blender/windowmanager/SConscript b/source/blender/windowmanager/SConscript index 51168d7a9d3..cbaf74ddc10 100644 --- a/source/blender/windowmanager/SConscript +++ b/source/blender/windowmanager/SConscript @@ -16,8 +16,8 @@ incs += ' #/intern/elbeem #/extern/glew/include' defs = [ 'GLEW_STATIC' ] -if not env['WITH_BF_PYTHON']: - defs.append('DISABLE_PYTHON') +if env['WITH_BF_PYTHON']: + defs.append('WITH_PYTHON') if env['WITH_BF_COLLADA']: defs.append('WITH_COLLADA') diff --git a/source/blender/windowmanager/intern/wm.c b/source/blender/windowmanager/intern/wm.c index 5c4912d7aee..426069245c3 100644 --- a/source/blender/windowmanager/intern/wm.c +++ b/source/blender/windowmanager/intern/wm.c @@ -58,7 +58,7 @@ #include "ED_screen.h" -#ifndef DISABLE_PYTHON +#ifdef WITH_PYTHON #include "BPY_extern.h" #endif @@ -69,7 +69,7 @@ void WM_operator_free(wmOperator *op) { -#ifndef DISABLE_PYTHON +#ifdef WITH_PYTHON if(op->py_instance) { /* do this first incase there are any __del__ functions or * similar that use properties */ diff --git a/source/blender/windowmanager/intern/wm_files.c b/source/blender/windowmanager/intern/wm_files.c index 6db7f2554c4..aa99e8fcb1c 100644 --- a/source/blender/windowmanager/intern/wm_files.c +++ b/source/blender/windowmanager/intern/wm_files.c @@ -96,7 +96,7 @@ #include "GPU_draw.h" -#ifndef DISABLE_PYTHON +#ifdef WITH_PYTHON #include "BPY_extern.h" #endif @@ -317,7 +317,7 @@ void WM_read_file(bContext *C, char *name, ReportList *reports) ED_editors_init(C); DAG_on_load_update(CTX_data_main(C)); -#ifndef DISABLE_PYTHON +#ifdef WITH_PYTHON /* run any texts that were loaded in and flagged as modules */ BPY_load_user_modules(C); #endif @@ -400,7 +400,7 @@ int WM_read_homefile(bContext *C, wmOperator *op) ED_editors_init(C); DAG_on_load_update(CTX_data_main(C)); -#ifndef DISABLE_PYTHON +#ifdef WITH_PYTHON if(CTX_py_init_get(C)) { /* sync addons, these may have changed from the defaults */ BPY_eval_string(C, "__import__('bpy').utils.addon_reset_all()"); diff --git a/source/blender/windowmanager/intern/wm_init_exit.c b/source/blender/windowmanager/intern/wm_init_exit.c index b8e6cf5424d..d98459a113c 100644 --- a/source/blender/windowmanager/intern/wm_init_exit.c +++ b/source/blender/windowmanager/intern/wm_init_exit.c @@ -61,11 +61,11 @@ #include "RE_pipeline.h" /* RE_ free stuff */ -#ifndef DISABLE_PYTHON +#ifdef WITH_PYTHON #include "BPY_extern.h" #endif -#ifdef WITH_GAME_ENGINE +#ifdef WITH_GAMEENGINE #include "SYS_System.h" #endif @@ -143,7 +143,7 @@ void WM_init(bContext *C, int argc, char **argv) * before WM_read_homefile() or make py-drivers check if python is running. * Will try fix when the crash can be repeated. - campbell. */ -#ifndef DISABLE_PYTHON +#ifdef WITH_PYTHON BPY_set_context(C); /* necessary evil */ BPY_start_python(argc, argv); BPY_load_user_modules(C); @@ -398,7 +398,7 @@ void WM_exit(bContext *C) // free_txt_data(); -#ifndef DISABLE_PYTHON +#ifdef WITH_PYTHON /* XXX - old note */ /* before free_blender so py's gc happens while library still exists */ /* needed at least for a rare sigsegv that can happen in pydrivers */ @@ -434,7 +434,7 @@ void WM_exit(bContext *C) wm_ghost_exit(); CTX_free(C); -#ifdef WITH_GAME_ENGINE +#ifdef WITH_GAMEENGINE SYS_DeleteSystem(SYS_GetSystem()); #endif if(MEM_get_memory_blocks_in_use()!=0) { diff --git a/source/creator/CMakeLists.txt b/source/creator/CMakeLists.txt index c8885cbba11..c661f6b2812 100644 --- a/source/creator/CMakeLists.txt +++ b/source/creator/CMakeLists.txt @@ -74,8 +74,7 @@ ENDIF(WITH_IMAGE_HDR) IF(WITH_PYTHON) INCLUDE_DIRECTORIES(../blender/python) -ELSE(WITH_PYTHON) - ADD_DEFINITIONS(-DDISABLE_PYTHON) + ADD_DEFINITIONS(-DWITH_PYTHON) ENDIF(WITH_PYTHON) IF(WITH_GAMEENGINE) diff --git a/source/creator/SConscript b/source/creator/SConscript index 6ee9aea29a5..8577872c48a 100644 --- a/source/creator/SConscript +++ b/source/creator/SConscript @@ -31,10 +31,9 @@ if not env['WITH_BF_SDL']: if env['WITH_BF_PYTHON']: incs += ' ../blender/python' + defs.append('WITH_PYTHON') if env['BF_DEBUG']: defs.append('_DEBUG') -else: - defs.append('DISABLE_PYTHON') if env['BF_BUILDINFO']: defs.append('BUILD_DATE') diff --git a/source/creator/creator.c b/source/creator/creator.c index 0d7a31340ed..4a217a147fa 100644 --- a/source/creator/creator.c +++ b/source/creator/creator.c @@ -80,7 +80,7 @@ #include "IMB_imbuf.h" // for IMB_init -#ifndef DISABLE_PYTHON +#ifdef WITH_PYTHON #include "BPY_extern.h" #endif @@ -829,7 +829,7 @@ static int set_skip_frame(int argc, char **argv, void *data) } /* macro for ugly context setup/reset */ -#ifndef DISABLE_PYTHON +#ifdef WITH_PYTHON #define BPY_CTX_SETUP(_cmd) \ { \ wmWindowManager *wm= CTX_wm_manager(C); \ @@ -847,11 +847,11 @@ static int set_skip_frame(int argc, char **argv, void *data) CTX_data_scene_set(C, prevscene); \ } \ -#endif /* DISABLE_PYTHON */ +#endif /* WITH_PYTHON */ static int run_python(int argc, char **argv, void *data) { -#ifndef DISABLE_PYTHON +#ifdef WITH_PYTHON bContext *C = data; /* workaround for scripts not getting a bpy.context.scene, causes internal errors elsewhere */ @@ -872,12 +872,12 @@ static int run_python(int argc, char **argv, void *data) (void)argc; (void)argv; (void)data; /* unused */ printf("This blender was built without python support\n"); return 0; -#endif /* DISABLE_PYTHON */ +#endif /* WITH_PYTHON */ } static int run_python_console(int UNUSED(argc), char **argv, void *data) { -#ifndef DISABLE_PYTHON +#ifdef WITH_PYTHON bContext *C = data; const char *expr= "__import__('code').interact()"; @@ -888,7 +888,7 @@ static int run_python_console(int UNUSED(argc), char **argv, void *data) (void)argv; (void)data; /* unused */ printf("This blender was built without python support\n"); return 0; -#endif /* DISABLE_PYTHON */ +#endif /* WITH_PYTHON */ } static int load_file(int UNUSED(argc), char **argv, void *data) @@ -914,7 +914,7 @@ static int load_file(int UNUSED(argc), char **argv, void *data) } /* WM_read_file() runs normally but since we're in background mode do here */ -#ifndef DISABLE_PYTHON +#ifdef WITH_PYTHON /* run any texts that were loaded in and flagged as modules */ BPY_load_user_modules(C); #endif @@ -1150,7 +1150,7 @@ int main(int argc, char **argv) BLI_where_is_temp( btempdir, 0 ); /* call after loading the startup.blend so we can read U.tempdir */ } -#ifndef DISABLE_PYTHON +#ifdef WITH_PYTHON /** * NOTE: the U.pythondir string is NULL until WM_init() is executed, * so we provide the BPY_ function below to append the user defined diff --git a/source/gameengine/BlenderRoutines/BL_KetsjiEmbedStart.cpp b/source/gameengine/BlenderRoutines/BL_KetsjiEmbedStart.cpp index 858a5964a52..9de4020ecff 100644 --- a/source/gameengine/BlenderRoutines/BL_KetsjiEmbedStart.cpp +++ b/source/gameengine/BlenderRoutines/BL_KetsjiEmbedStart.cpp @@ -142,7 +142,7 @@ extern "C" void StartKetsjiShell(struct bContext *C, struct ARegion *ar, rcti *c BLI_strncpy(pathname, blenderdata->name, sizeof(pathname)); BLI_strncpy(oldsce, G.main->name, sizeof(oldsce)); -#ifndef DISABLE_PYTHON +#ifdef WITH_PYTHON resetGamePythonPath(); // need this so running a second time wont use an old blendfiles path setGamePythonPath(G.main->name); @@ -172,7 +172,7 @@ extern "C" void StartKetsjiShell(struct bContext *C, struct ARegion *ar, rcti *c bool frameRate = (SYS_GetCommandLineInt(syshandle, "show_framerate", 0) != 0); bool animation_record = (SYS_GetCommandLineInt(syshandle, "animation_record", 0) != 0); bool displaylists = (SYS_GetCommandLineInt(syshandle, "displaylists", 0) != 0); -#ifndef DISABLE_PYTHON +#ifdef WITH_PYTHON bool nodepwarnings = (SYS_GetCommandLineInt(syshandle, "ignore_deprecation_warnings", 0) != 0); #endif bool novertexarrays = (SYS_GetCommandLineInt(syshandle, "novertexarrays", 0) != 0); @@ -221,7 +221,7 @@ extern "C" void StartKetsjiShell(struct bContext *C, struct ARegion *ar, rcti *c ketsjiengine->SetUseFixedTime(usefixed); ketsjiengine->SetTimingDisplay(frameRate, profile, properties); -#ifndef DISABLE_PYTHON +#ifdef WITH_PYTHON CValue::SetDeprecationWarnings(nodepwarnings); #endif @@ -311,7 +311,7 @@ extern "C" void StartKetsjiShell(struct bContext *C, struct ARegion *ar, rcti *c if(blenderdata) { BLI_strncpy(G.main->name, blenderdata->name, sizeof(G.main->name)); BLI_strncpy(pathname, blenderdata->name, sizeof(pathname)); -#ifndef DISABLE_PYTHON +#ifdef WITH_PYTHON setGamePythonPath(G.main->name); #endif } @@ -382,11 +382,11 @@ extern "C" void StartKetsjiShell(struct bContext *C, struct ARegion *ar, rcti *c scene, canvas); -#ifndef DISABLE_PYTHON +#ifdef WITH_PYTHON // some python things PyObject *gameLogic, *gameLogic_keys; setupGamePython(ketsjiengine, startscene, blenderdata, pyGlobalDict, &gameLogic, &gameLogic_keys, 0, NULL); -#endif // DISABLE_PYTHON +#endif // WITH_PYTHON //initialize Dome Settings if(scene->gm.stereoflag == STEREO_DOME) @@ -477,7 +477,7 @@ extern "C" void StartKetsjiShell(struct bContext *C, struct ARegion *ar, rcti *c // when exiting the mainloop -#ifndef DISABLE_PYTHON +#ifdef WITH_PYTHON // Clears the dictionary by hand: // This prevents, extra references to global variables // inside the GameLogic dictionary when the python interpreter is finalized. @@ -499,7 +499,7 @@ extern "C" void StartKetsjiShell(struct bContext *C, struct ARegion *ar, rcti *c gameLogic_keys_new = NULL; #endif ketsjiengine->StopEngine(); -#ifndef DISABLE_PYTHON +#ifdef WITH_PYTHON exitGamePythonScripting(); #endif networkdevice->Disconnect(); @@ -510,7 +510,7 @@ extern "C" void StartKetsjiShell(struct bContext *C, struct ARegion *ar, rcti *c sceneconverter = NULL; } -#ifndef DISABLE_PYTHON +#ifdef WITH_PYTHON Py_DECREF(gameLogic_keys); gameLogic_keys = NULL; #endif @@ -575,7 +575,7 @@ extern "C" void StartKetsjiShell(struct bContext *C, struct ARegion *ar, rcti *c BLI_strncpy(G.main->name, oldsce, sizeof(G.main->name)); -#ifndef DISABLE_PYTHON +#ifdef WITH_PYTHON Py_DECREF(pyGlobalDict); // Release Python's GIL diff --git a/source/gameengine/BlenderRoutines/CMakeLists.txt b/source/gameengine/BlenderRoutines/CMakeLists.txt index 7abdeba0740..1f895ad0abc 100644 --- a/source/gameengine/BlenderRoutines/CMakeLists.txt +++ b/source/gameengine/BlenderRoutines/CMakeLists.txt @@ -51,8 +51,7 @@ ENDIF(WITH_FFMPEG) IF(WITH_PYTHON) LIST(APPEND INC ${PYTHON_INC}) -ELSE(WITH_PYTHON) - ADD_DEFINITIONS(-DDISABLE_PYTHON) + ADD_DEFINITIONS(-DWITH_PYTHON) ENDIF(WITH_PYTHON) BLENDERLIB(bf_blroutines "${SRC}" "${INC}") diff --git a/source/gameengine/BlenderRoutines/SConscript b/source/gameengine/BlenderRoutines/SConscript index 1a774fc8aba..91dc2692384 100644 --- a/source/gameengine/BlenderRoutines/SConscript +++ b/source/gameengine/BlenderRoutines/SConscript @@ -27,8 +27,7 @@ if env['WITH_BF_FFMPEG']: if env['WITH_BF_PYTHON']: incs += ' ' + env['BF_PYTHON_INC'] -else: - defs.append('DISABLE_PYTHON') + defs.append('WITH_PYTHON') if env['WITH_BF_CXX_GUARDEDALLOC']: defs.append('WITH_CXX_GUARDEDALLOC') diff --git a/source/gameengine/Converter/BL_ActionActuator.cpp b/source/gameengine/Converter/BL_ActionActuator.cpp index b8d4c4e0f04..39e3e87708e 100644 --- a/source/gameengine/Converter/BL_ActionActuator.cpp +++ b/source/gameengine/Converter/BL_ActionActuator.cpp @@ -428,7 +428,7 @@ bool BL_ActionActuator::Update(double curtime, bool frame) return keepgoing; }; -#ifndef DISABLE_PYTHON +#ifdef WITH_PYTHON /* ------------------------------------------------------------------------- */ /* Python functions */ @@ -674,4 +674,4 @@ PyObject* BL_ActionActuator::pyattr_get_channel_names(void *self_v, const KX_PYA return ret; } -#endif // DISABLE_PYTHON +#endif // WITH_PYTHON diff --git a/source/gameengine/Converter/BL_ActionActuator.h b/source/gameengine/Converter/BL_ActionActuator.h index 10ce1fad27a..9682c0e45f7 100644 --- a/source/gameengine/Converter/BL_ActionActuator.h +++ b/source/gameengine/Converter/BL_ActionActuator.h @@ -84,7 +84,7 @@ public: bAction* GetAction() { return m_action; } void SetAction(bAction* act) { m_action= act; } -#ifndef DISABLE_PYTHON +#ifdef WITH_PYTHON KX_PYMETHOD_O(BL_ActionActuator,GetChannel); KX_PYMETHOD_DOC(BL_ActionActuator,setChannel); @@ -131,7 +131,7 @@ public: return 1; } } -#endif // DISABLE_PYTHON +#endif // WITH_PYTHON protected: diff --git a/source/gameengine/Converter/BL_ArmatureActuator.cpp b/source/gameengine/Converter/BL_ArmatureActuator.cpp index 82b8307a2bc..db36f7e7c38 100644 --- a/source/gameengine/Converter/BL_ArmatureActuator.cpp +++ b/source/gameengine/Converter/BL_ArmatureActuator.cpp @@ -175,7 +175,7 @@ bool BL_ArmatureActuator::Update(double curtime, bool frame) return result; } -#ifndef DISABLE_PYTHON +#ifdef WITH_PYTHON /* ------------------------------------------------------------------------- */ /* Python Integration Hooks */ @@ -257,5 +257,5 @@ PyObject* BL_ArmatureActuator::pyattr_get_constraint(void *self, const struct KX return constraint->GetProxy(); } -#endif // DISABLE_PYTHON +#endif // WITH_PYTHON diff --git a/source/gameengine/Converter/BL_ArmatureActuator.h b/source/gameengine/Converter/BL_ArmatureActuator.h index 72e2e96ea73..b3f9ee2f1f2 100644 --- a/source/gameengine/Converter/BL_ArmatureActuator.h +++ b/source/gameengine/Converter/BL_ArmatureActuator.h @@ -66,14 +66,14 @@ public: virtual bool Update(double curtime, bool frame); virtual void ReParent(SCA_IObject* parent); -#ifndef DISABLE_PYTHON +#ifdef WITH_PYTHON /* These are used to get and set m_target */ static PyObject* pyattr_get_constraint(void *self, const struct KX_PYATTRIBUTE_DEF *attrdef); static PyObject* pyattr_get_object(void *self, const struct KX_PYATTRIBUTE_DEF *attrdef); static int pyattr_set_object(void *self, const struct KX_PYATTRIBUTE_DEF *attrdef, PyObject *value); -#endif // DISABLE_PYTHON +#endif // WITH_PYTHON private: // identify the constraint that this actuator controls diff --git a/source/gameengine/Converter/BL_ArmatureChannel.cpp b/source/gameengine/Converter/BL_ArmatureChannel.cpp index 8f5ec230486..13de701c510 100644 --- a/source/gameengine/Converter/BL_ArmatureChannel.cpp +++ b/source/gameengine/Converter/BL_ArmatureChannel.cpp @@ -33,7 +33,7 @@ #include "BLI_math.h" #include "BLI_string.h" -#ifndef DISABLE_PYTHON +#ifdef WITH_PYTHON PyTypeObject BL_ArmatureChannel::Type = { PyVarObject_HEAD_INIT(NULL, 0) @@ -72,7 +72,7 @@ PyObject *BL_ArmatureChannel::NewProxy(bool py_owns) return NewProxyPlus_Ext(this, &Type, m_posechannel, py_owns); } -#endif // DISABLE_PYTHON +#endif // WITH_PYTHON BL_ArmatureChannel::BL_ArmatureChannel( BL_ArmatureObject *armature, @@ -85,7 +85,7 @@ BL_ArmatureChannel::~BL_ArmatureChannel() { } -#ifndef DISABLE_PYTHON +#ifdef WITH_PYTHON // PYTHON @@ -461,4 +461,4 @@ PyObject *BL_ArmatureBone::py_bone_get_children(void *self, const struct KX_PYAT return childrenlist; } -#endif // DISABLE_PYTHON +#endif // WITH_PYTHON diff --git a/source/gameengine/Converter/BL_ArmatureChannel.h b/source/gameengine/Converter/BL_ArmatureChannel.h index 79f0cc80348..e1c18215c53 100644 --- a/source/gameengine/Converter/BL_ArmatureChannel.h +++ b/source/gameengine/Converter/BL_ArmatureChannel.h @@ -57,7 +57,7 @@ public: struct bPoseChannel *posechannel); virtual ~BL_ArmatureChannel(); -#ifndef DISABLE_PYTHON +#ifdef WITH_PYTHON // Python access virtual PyObject* py_repr(void); @@ -65,7 +65,7 @@ public: static int py_attr_setattr(void *self, const struct KX_PYATTRIBUTE_DEF *attrdef, PyObject *value); static PyObject* py_attr_get_joint_rotation(void *self, const struct KX_PYATTRIBUTE_DEF *attrdef); static int py_attr_set_joint_rotation(void *self, const struct KX_PYATTRIBUTE_DEF *attrdef, PyObject *value); -#endif // DISABLE_PYTHON +#endif // WITH_PYTHON }; /* this is a factory class to access bBone data field in the GE. @@ -82,7 +82,7 @@ private: public: -#ifndef DISABLE_PYTHON +#ifdef WITH_PYTHON static PyObject *py_bone_repr(PyObject *self); static PyObject *py_bone_get_parent(void *self, const struct KX_PYATTRIBUTE_DEF *attrdef); static PyObject *py_bone_get_children(void *self, const struct KX_PYATTRIBUTE_DEF *attrdef); diff --git a/source/gameengine/Converter/BL_ArmatureConstraint.cpp b/source/gameengine/Converter/BL_ArmatureConstraint.cpp index 0b7ab043d16..fa7f8a1bea1 100644 --- a/source/gameengine/Converter/BL_ArmatureConstraint.cpp +++ b/source/gameengine/Converter/BL_ArmatureConstraint.cpp @@ -33,7 +33,7 @@ #include "BLI_math.h" #include "BLI_string.h" -#ifndef DISABLE_PYTHON +#ifdef WITH_PYTHON PyTypeObject BL_ArmatureConstraint::Type = { PyVarObject_HEAD_INIT(NULL, 0) @@ -62,7 +62,7 @@ PyObject* BL_ArmatureConstraint::py_repr(void) return PyUnicode_FromString(m_name); } -#endif // DISABLE_PYTHON +#endif // WITH_PYTHON BL_ArmatureConstraint::BL_ArmatureConstraint( BL_ArmatureObject *armature, @@ -237,7 +237,7 @@ void BL_ArmatureConstraint::SetSubtarget(KX_GameObject* subtarget) } -#ifndef DISABLE_PYTHON +#ifdef WITH_PYTHON // PYTHON @@ -447,4 +447,4 @@ int BL_ArmatureConstraint::py_attr_setattr(void *self_v, const struct KX_PYATTRI return PY_SET_ATTR_FAIL; } -#endif // DISABLE_PYTHON +#endif // WITH_PYTHON diff --git a/source/gameengine/Converter/BL_ArmatureConstraint.h b/source/gameengine/Converter/BL_ArmatureConstraint.h index a9f612b6c0c..92da8327edb 100644 --- a/source/gameengine/Converter/BL_ArmatureConstraint.h +++ b/source/gameengine/Converter/BL_ArmatureConstraint.h @@ -104,14 +104,14 @@ public: void SetTarget(KX_GameObject* target); void SetSubtarget(KX_GameObject* subtarget); -#ifndef DISABLE_PYTHON +#ifdef WITH_PYTHON // Python access virtual PyObject* py_repr(void); static PyObject* py_attr_getattr(void *self, const struct KX_PYATTRIBUTE_DEF *attrdef); static int py_attr_setattr(void *self, const struct KX_PYATTRIBUTE_DEF *attrdef, PyObject *value); -#endif // DISABLE_PYTHON +#endif // WITH_PYTHON }; #endif //__BL_ARMATURECONSTRAINT diff --git a/source/gameengine/Converter/BL_ArmatureObject.cpp b/source/gameengine/Converter/BL_ArmatureObject.cpp index 97d6b6efd27..0c5bb036b04 100644 --- a/source/gameengine/Converter/BL_ArmatureObject.cpp +++ b/source/gameengine/Converter/BL_ArmatureObject.cpp @@ -594,7 +594,7 @@ float BL_ArmatureObject::GetBoneLength(Bone* bone) const return (float)(MT_Point3(bone->head) - MT_Point3(bone->tail)).length(); } -#ifndef DISABLE_PYTHON +#ifdef WITH_PYTHON // PYTHON @@ -661,4 +661,4 @@ KX_PYMETHODDEF_DOC_NOARGS(BL_ArmatureObject, update, Py_RETURN_NONE; } -#endif // DISABLE_PYTHON +#endif // WITH_PYTHON diff --git a/source/gameengine/Converter/BL_ArmatureObject.h b/source/gameengine/Converter/BL_ArmatureObject.h index 646e9d45365..525c265d607 100644 --- a/source/gameengine/Converter/BL_ArmatureObject.h +++ b/source/gameengine/Converter/BL_ArmatureObject.h @@ -108,14 +108,14 @@ public: virtual int GetGameObjectType() { return OBJ_ARMATURE; } -#ifndef DISABLE_PYTHON +#ifdef WITH_PYTHON // PYTHON static PyObject* pyattr_get_constraints(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef); static PyObject* pyattr_get_channels(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef); KX_PYMETHOD_DOC_NOARGS(BL_ArmatureObject, update); -#endif // DISABLE_PYTHON +#endif // WITH_PYTHON protected: /* list element: BL_ArmatureConstraint. Use SG_DListHead to have automatic list replication */ diff --git a/source/gameengine/Converter/BL_ShapeActionActuator.cpp b/source/gameengine/Converter/BL_ShapeActionActuator.cpp index 08d3e54a7c5..ccd7dc6f745 100644 --- a/source/gameengine/Converter/BL_ShapeActionActuator.cpp +++ b/source/gameengine/Converter/BL_ShapeActionActuator.cpp @@ -408,7 +408,7 @@ bool BL_ShapeActionActuator::Update(double curtime, bool frame) return keepgoing; }; -#ifndef DISABLE_PYTHON +#ifdef WITH_PYTHON /* ------------------------------------------------------------------------- */ /* Python functions */ @@ -491,4 +491,4 @@ int BL_ShapeActionActuator::pyattr_set_action(void *self_v, const KX_PYATTRIBUTE } -#endif // DISABLE_PYTHON +#endif // WITH_PYTHON diff --git a/source/gameengine/Converter/BL_ShapeActionActuator.h b/source/gameengine/Converter/BL_ShapeActionActuator.h index 64cd21e5544..e6457e2c686 100644 --- a/source/gameengine/Converter/BL_ShapeActionActuator.h +++ b/source/gameengine/Converter/BL_ShapeActionActuator.h @@ -82,7 +82,7 @@ public: bAction* GetAction() { return m_action; } void SetAction(bAction* act) { m_action= act; } -#ifndef DISABLE_PYTHON +#ifdef WITH_PYTHON static PyObject* pyattr_get_action(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef); static int pyattr_set_action(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef, PyObject *value); @@ -125,7 +125,7 @@ public: } -#endif // DISABLE_PYTHON +#endif // WITH_PYTHON protected: diff --git a/source/gameengine/Converter/CMakeLists.txt b/source/gameengine/Converter/CMakeLists.txt index a23629e3341..9e0b4242f28 100644 --- a/source/gameengine/Converter/CMakeLists.txt +++ b/source/gameengine/Converter/CMakeLists.txt @@ -85,8 +85,7 @@ SET(SRC IF(WITH_PYTHON) LIST(APPEND INC ${PYTHON_INC}) -ELSE(WITH_PYTHON) - ADD_DEFINITIONS(-DDISABLE_PYTHON) + ADD_DEFINITIONS(-DWITH_PYTHON) ENDIF(WITH_PYTHON) IF(WITH_BULLET) diff --git a/source/gameengine/Converter/KX_BlenderSceneConverter.cpp b/source/gameengine/Converter/KX_BlenderSceneConverter.cpp index 7ec7104f1f4..05b0e75b070 100644 --- a/source/gameengine/Converter/KX_BlenderSceneConverter.cpp +++ b/source/gameengine/Converter/KX_BlenderSceneConverter.cpp @@ -906,7 +906,7 @@ void KX_BlenderSceneConverter::TestHandlesPhysicsObjectToAnimationIpo() } -#ifndef DISABLE_PYTHON +#ifdef WITH_PYTHON PyObject *KX_BlenderSceneConverter::GetPyNamespace() { return m_ketsjiEngine->GetPyNamespace(); diff --git a/source/gameengine/Converter/KX_BlenderSceneConverter.h b/source/gameengine/Converter/KX_BlenderSceneConverter.h index 20f3f863563..8692a75ecb6 100644 --- a/source/gameengine/Converter/KX_BlenderSceneConverter.h +++ b/source/gameengine/Converter/KX_BlenderSceneConverter.h @@ -174,7 +174,7 @@ public: -#ifndef DISABLE_PYTHON +#ifdef WITH_PYTHON PyObject *GetPyNamespace(); #endif diff --git a/source/gameengine/Converter/KX_ConvertControllers.cpp b/source/gameengine/Converter/KX_ConvertControllers.cpp index a6b62ecb7b0..3bca6b9ab11 100644 --- a/source/gameengine/Converter/KX_ConvertControllers.cpp +++ b/source/gameengine/Converter/KX_ConvertControllers.cpp @@ -153,7 +153,7 @@ void BL_ConvertControllers( bPythonCont* pycont = (bPythonCont*) bcontr->data; SCA_PythonController* pyctrl = new SCA_PythonController(gameobj, pycont->mode); gamecontroller = pyctrl; -#ifndef DISABLE_PYTHON +#ifdef WITH_PYTHON pyctrl->SetNamespace(converter->GetPyNamespace()); @@ -183,7 +183,7 @@ void BL_ConvertControllers( } } -#endif // DISABLE_PYTHON +#endif // WITH_PYTHON break; } @@ -210,7 +210,7 @@ void BL_ConvertControllers( converter->RegisterGameController(gamecontroller, bcontr); -#ifndef DISABLE_PYTHON +#ifdef WITH_PYTHON if (bcontr->type==CONT_PYTHON) { SCA_PythonController *pyctrl= static_cast<SCA_PythonController*>(gamecontroller); /* not strictly needed but gives syntax errors early on and @@ -225,7 +225,7 @@ void BL_ConvertControllers( // pyctrl->Import(); } } -#endif // DISABLE_PYTHON +#endif // WITH_PYTHON //done with gamecontroller gamecontroller->Release(); diff --git a/source/gameengine/Converter/KX_ConvertProperties.cpp b/source/gameengine/Converter/KX_ConvertProperties.cpp index 44c0ad38909..6c850008e5e 100644 --- a/source/gameengine/Converter/KX_ConvertProperties.cpp +++ b/source/gameengine/Converter/KX_ConvertProperties.cpp @@ -126,7 +126,7 @@ void BL_ConvertProperties(Object* object,KX_GameObject* gameobj,SCA_TimeEventMan propval->Release(); } -#ifndef DISABLE_PYTHON +#ifdef WITH_PYTHON /* Warn if we double up on attributes, this isnt quite right since it wont find inherited attributes however there arnt many */ for(PyAttributeDef *attrdef = KX_GameObject::Attributes; attrdef->m_name; attrdef++) { if(strcmp(prop->name, attrdef->m_name)==0) { @@ -141,7 +141,7 @@ void BL_ConvertProperties(Object* object,KX_GameObject* gameobj,SCA_TimeEventMan } } /* end warning check */ -#endif // DISABLE_PYTHON +#endif // WITH_PYTHON prop = prop->next; } diff --git a/source/gameengine/Converter/SConscript b/source/gameengine/Converter/SConscript index a276d1623df..f6cf2331a43 100644 --- a/source/gameengine/Converter/SConscript +++ b/source/gameengine/Converter/SConscript @@ -29,8 +29,7 @@ if env['BF_DEBUG']: if env['WITH_BF_PYTHON']: incs += ' ' + env['BF_PYTHON_INC'] -else: - defs.append('DISABLE_PYTHON') + defs.append('WITH_PYTHON') if env['WITH_BF_CXX_GUARDEDALLOC']: defs.append('WITH_CXX_GUARDEDALLOC') diff --git a/source/gameengine/Expressions/BoolValue.cpp b/source/gameengine/Expressions/BoolValue.cpp index e6bb454a1b5..5510554bd22 100644 --- a/source/gameengine/Expressions/BoolValue.cpp +++ b/source/gameengine/Expressions/BoolValue.cpp @@ -201,9 +201,9 @@ CValue* CBoolValue::GetReplica() return replica; } -#ifndef DISABLE_PYTHON +#ifdef WITH_PYTHON PyObject* CBoolValue::ConvertValueToPython() { return PyBool_FromLong(m_bool != 0); } -#endif // DISABLE_PYTHON +#endif // WITH_PYTHON diff --git a/source/gameengine/Expressions/BoolValue.h b/source/gameengine/Expressions/BoolValue.h index dac70e3c0b7..8110b9719bf 100644 --- a/source/gameengine/Expressions/BoolValue.h +++ b/source/gameengine/Expressions/BoolValue.h @@ -45,7 +45,7 @@ public: void Configure(CValue* menuvalue); virtual CValue* GetReplica(); -#ifndef DISABLE_PYTHON +#ifdef WITH_PYTHON virtual PyObject* ConvertValueToPython(); #endif diff --git a/source/gameengine/Expressions/CMakeLists.txt b/source/gameengine/Expressions/CMakeLists.txt index 828afa7ae92..ad446d1085e 100644 --- a/source/gameengine/Expressions/CMakeLists.txt +++ b/source/gameengine/Expressions/CMakeLists.txt @@ -58,8 +58,7 @@ SET(SRC IF(WITH_PYTHON) LIST(APPEND INC ${PYTHON_INC}) -ELSE(WITH_PYTHON) - ADD_DEFINITIONS(-DDISABLE_PYTHON) + ADD_DEFINITIONS(-DWITH_PYTHON) ENDIF(WITH_PYTHON) BLENDERLIB(bf_expressions "${SRC}" "${INC}") diff --git a/source/gameengine/Expressions/FloatValue.cpp b/source/gameengine/Expressions/FloatValue.cpp index 82c86ac68b2..e00121354f8 100644 --- a/source/gameengine/Expressions/FloatValue.cpp +++ b/source/gameengine/Expressions/FloatValue.cpp @@ -310,9 +310,9 @@ CValue* CFloatValue::GetReplica() } -#ifndef DISABLE_PYTHON +#ifdef WITH_PYTHON PyObject* CFloatValue::ConvertValueToPython() { return PyFloat_FromDouble(m_float); } -#endif // DISABLE_PYTHON +#endif // WITH_PYTHON diff --git a/source/gameengine/Expressions/FloatValue.h b/source/gameengine/Expressions/FloatValue.h index 49d4efa9f74..83b9ff1db5e 100644 --- a/source/gameengine/Expressions/FloatValue.h +++ b/source/gameengine/Expressions/FloatValue.h @@ -36,7 +36,7 @@ public: virtual CValue* GetReplica(); virtual CValue* Calc(VALUE_OPERATOR op, CValue *val); virtual CValue* CalcFinal(VALUE_DATA_TYPE dtype, VALUE_OPERATOR op, CValue *val); -#ifndef DISABLE_PYTHON +#ifdef WITH_PYTHON virtual PyObject* ConvertValueToPython(); #endif diff --git a/source/gameengine/Expressions/IntValue.cpp b/source/gameengine/Expressions/IntValue.cpp index 83e57200db0..5ba57e756c0 100644 --- a/source/gameengine/Expressions/IntValue.cpp +++ b/source/gameengine/Expressions/IntValue.cpp @@ -322,7 +322,7 @@ void CIntValue::SetValue(CValue* newval) } -#ifndef DISABLE_PYTHON +#ifdef WITH_PYTHON PyObject* CIntValue::ConvertValueToPython() { if((m_int > INT_MIN) && (m_int < INT_MAX)) @@ -330,4 +330,4 @@ PyObject* CIntValue::ConvertValueToPython() else return PyLong_FromLongLong(m_int); } -#endif // DISABLE_PYTHON +#endif // WITH_PYTHON diff --git a/source/gameengine/Expressions/IntValue.h b/source/gameengine/Expressions/IntValue.h index 63efea56d14..e484c436177 100644 --- a/source/gameengine/Expressions/IntValue.h +++ b/source/gameengine/Expressions/IntValue.h @@ -48,7 +48,7 @@ public: void AddConfigurationData(CValue* menuvalue); virtual CValue* GetReplica(); -#ifndef DISABLE_PYTHON +#ifdef WITH_PYTHON virtual PyObject* ConvertValueToPython(); #endif diff --git a/source/gameengine/Expressions/KX_Python.h b/source/gameengine/Expressions/KX_Python.h index 7901d5226f7..62353f04e50 100644 --- a/source/gameengine/Expressions/KX_Python.h +++ b/source/gameengine/Expressions/KX_Python.h @@ -40,7 +40,7 @@ #undef _POSIX_C_SOURCE #endif -#ifndef DISABLE_PYTHON +#ifdef WITH_PYTHON #include "Python.h" #define USE_MATHUTILS // Blender 2.5x api will use mathutils, for a while we might want to test without it diff --git a/source/gameengine/Expressions/ListValue.cpp b/source/gameengine/Expressions/ListValue.cpp index 4d9d82efb98..258aada6565 100644 --- a/source/gameengine/Expressions/ListValue.cpp +++ b/source/gameengine/Expressions/ListValue.cpp @@ -268,7 +268,7 @@ bool CListValue::IsModified() return bmod; } -#ifndef DISABLE_PYTHON +#ifdef WITH_PYTHON /* --------------------------------------------------------------------- */ /* Python interface ---------------------------------------------------- */ @@ -674,4 +674,4 @@ PyObject* CListValue::Pyfrom_id(PyObject* value) } -#endif // DISABLE_PYTHON +#endif // WITH_PYTHON diff --git a/source/gameengine/Expressions/ListValue.h b/source/gameengine/Expressions/ListValue.h index 8f3b9dcda0b..ff675dd0e68 100644 --- a/source/gameengine/Expressions/ListValue.h +++ b/source/gameengine/Expressions/ListValue.h @@ -60,7 +60,7 @@ public: bool CheckEqual(CValue* first,CValue* second); -#ifndef DISABLE_PYTHON +#ifdef WITH_PYTHON virtual PyObject* py_repr(void) { PyObject *py_proxy= this->GetProxy(); PyObject *py_list= PySequence_List(py_proxy); diff --git a/source/gameengine/Expressions/PyObjectPlus.cpp b/source/gameengine/Expressions/PyObjectPlus.cpp index 32bf4ba95c4..9195bd64f3f 100644 --- a/source/gameengine/Expressions/PyObjectPlus.cpp +++ b/source/gameengine/Expressions/PyObjectPlus.cpp @@ -49,7 +49,7 @@ PyObjectPlus::~PyObjectPlus() { -#ifndef DISABLE_PYTHON +#ifdef WITH_PYTHON if(m_proxy) { BGE_PROXY_REF(m_proxy)= NULL; Py_DECREF(m_proxy); /* Remove own reference, python may still have 1 */ @@ -60,14 +60,14 @@ PyObjectPlus::~PyObjectPlus() PyObjectPlus::PyObjectPlus() : SG_QList() // constructor { -#ifndef DISABLE_PYTHON +#ifdef WITH_PYTHON m_proxy= NULL; #endif }; void PyObjectPlus::ProcessReplica() { -#ifndef DISABLE_PYTHON +#ifdef WITH_PYTHON /* Clear the proxy, will be created again if needed with GetProxy() * otherwise the PyObject will point to the wrong reference */ m_proxy= NULL; @@ -84,7 +84,7 @@ void PyObjectPlus::ProcessReplica() */ void PyObjectPlus::InvalidateProxy() // check typename of each parent { -#ifndef DISABLE_PYTHON +#ifdef WITH_PYTHON if(m_proxy) { BGE_PROXY_REF(m_proxy)=NULL; Py_DECREF(m_proxy); @@ -94,7 +94,7 @@ void PyObjectPlus::InvalidateProxy() // check typename of each parent } -#ifndef DISABLE_PYTHON +#ifdef WITH_PYTHON /*------------------------------ * PyObjectPlus Type -- Every class, even the abstract one should have a Type @@ -1224,4 +1224,4 @@ void PyObjectPlus::SetDeprecationWarningFirst(WarnLink* wlink) {m_base_wlink_f void PyObjectPlus::SetDeprecationWarningLinkLast(WarnLink* wlink) {m_base_wlink_last= wlink;} void PyObjectPlus::NullDeprecationWarning() {m_base_wlink_first= m_base_wlink_last= NULL;} -#endif // DISABLE_PYTHON +#endif // WITH_PYTHON diff --git a/source/gameengine/Expressions/PyObjectPlus.h b/source/gameengine/Expressions/PyObjectPlus.h index b2688231a43..d69be6af5e5 100644 --- a/source/gameengine/Expressions/PyObjectPlus.h +++ b/source/gameengine/Expressions/PyObjectPlus.h @@ -43,7 +43,7 @@ * Python defines ------------------------------*/ -#ifndef DISABLE_PYTHON +#ifdef WITH_PYTHON #ifdef USE_MATHUTILS extern "C" { #include "../../blender/python/generic/mathutils.h" /* so we can have mathutils callbacks */ @@ -459,7 +459,7 @@ typedef struct KX_PYATTRIBUTE_DEF { ------------------------------*/ typedef PyTypeObject * PyParentObject; // Define the PyParent Object -#else // DISABLE_PYTHON +#else // WITH_PYTHON #ifdef WITH_CXX_GUARDEDALLOC #define Py_Header \ @@ -505,7 +505,7 @@ public: virtual ~PyObjectPlus(); // destructor -#ifndef DISABLE_PYTHON +#ifdef WITH_PYTHON PyObject *m_proxy; /* actually a PyObjectPlus_Proxy */ /* These static functions are referenced by ALL PyObjectPlus_Proxy types @@ -561,7 +561,7 @@ public: static bool m_ignore_deprecation_warnings; }; -#ifndef DISABLE_PYTHON +#ifdef WITH_PYTHON PyObject *py_getattr_dict(PyObject *pydict, PyObject *tp_dict); #endif diff --git a/source/gameengine/Expressions/SConscript b/source/gameengine/Expressions/SConscript index 85db689a9ba..dea652dabb4 100644 --- a/source/gameengine/Expressions/SConscript +++ b/source/gameengine/Expressions/SConscript @@ -9,8 +9,7 @@ defs = [] if env['WITH_BF_PYTHON']: incs += ' ' + env['BF_PYTHON_INC'] -else: - defs.append('DISABLE_PYTHON') + defs.append('WITH_PYTHON') if env['WITH_BF_CXX_GUARDEDALLOC']: defs.append('WITH_CXX_GUARDEDALLOC') diff --git a/source/gameengine/Expressions/StringValue.h b/source/gameengine/Expressions/StringValue.h index d28e435e2a7..ef8228141a2 100644 --- a/source/gameengine/Expressions/StringValue.h +++ b/source/gameengine/Expressions/StringValue.h @@ -39,11 +39,11 @@ public: virtual CValue* CalcFinal(VALUE_DATA_TYPE dtype, VALUE_OPERATOR op, CValue *val); virtual void SetValue(CValue* newval) { m_strString = newval->GetText(); SetModified(true); }; virtual CValue* GetReplica(); -#ifndef DISABLE_PYTHON +#ifdef WITH_PYTHON virtual PyObject* ConvertValueToPython() { return PyUnicode_FromString(m_strString.Ptr()); } -#endif // DISABLE_PYTHON +#endif // WITH_PYTHON private: // data member diff --git a/source/gameengine/Expressions/Value.cpp b/source/gameengine/Expressions/Value.cpp index 1f4f961268b..262f543f834 100644 --- a/source/gameengine/Expressions/Value.cpp +++ b/source/gameengine/Expressions/Value.cpp @@ -29,7 +29,7 @@ double CValue::m_sZeroVec[3] = {0.0,0.0,0.0}; -#ifndef DISABLE_PYTHON +#ifdef WITH_PYTHON PyTypeObject CValue::Type = { PyVarObject_HEAD_INIT(NULL, 0) @@ -60,7 +60,7 @@ PyTypeObject CValue::Type = { PyMethodDef CValue::Methods[] = { {NULL,NULL} //Sentinel }; -#endif // DISABLE_PYTHON +#endif // WITH_PYTHON /*#define CVALUE_DEBUG*/ @@ -520,7 +520,7 @@ CValue* CValue::FindIdentifier(const STR_String& identifiername) return result; } -#ifndef DISABLE_PYTHON +#ifdef WITH_PYTHON PyAttributeDef CValue::Attributes[] = { KX_PYATTRIBUTE_RO_FUNCTION("name", CValue, pyattr_get_name), @@ -611,7 +611,7 @@ PyObject* CValue::ConvertKeysToPython( void ) return pylist; } -#endif // DISABLE_PYTHON +#endif // WITH_PYTHON /////////////////////////////////////////////////////////////////////////////////////////////// diff --git a/source/gameengine/Expressions/Value.h b/source/gameengine/Expressions/Value.h index 009d95ee4d2..e6ea431ec1c 100644 --- a/source/gameengine/Expressions/Value.h +++ b/source/gameengine/Expressions/Value.h @@ -198,7 +198,7 @@ public: #include "PyObjectPlus.h" -#ifndef DISABLE_PYTHON +#ifdef WITH_PYTHON #include "object.h" #endif class CValue : public PyObjectPlus @@ -221,7 +221,7 @@ public: // Construction / Destruction CValue(); -#ifndef DISABLE_PYTHON +#ifdef WITH_PYTHON //static PyObject* PyMake(PyObject*,PyObject*); virtual PyObject *py_repr(void) { @@ -237,7 +237,7 @@ public: static PyObject * pyattr_get_name(void * self, const KX_PYATTRIBUTE_DEF * attrdef); virtual PyObject* ConvertKeysToPython( void ); -#endif // DISABLE_PYTHON +#endif // WITH_PYTHON diff --git a/source/gameengine/GameLogic/CMakeLists.txt b/source/gameengine/GameLogic/CMakeLists.txt index 57150a90e99..b346df2b340 100644 --- a/source/gameengine/GameLogic/CMakeLists.txt +++ b/source/gameengine/GameLogic/CMakeLists.txt @@ -87,8 +87,7 @@ ENDIF(WITH_SDL) IF(WITH_PYTHON) LIST(APPEND INC ${PYTHON_INC}) -ELSE(WITH_PYTHON) - ADD_DEFINITIONS(-DDISABLE_PYTHON) + ADD_DEFINITIONS(-DWITH_PYTHON) ENDIF(WITH_PYTHON) BLENDERLIB(bf_logic "${SRC}" "${INC}") diff --git a/source/gameengine/GameLogic/SCA_2DFilterActuator.cpp b/source/gameengine/GameLogic/SCA_2DFilterActuator.cpp index f6d24af0e67..3e9217251b5 100644 --- a/source/gameengine/GameLogic/SCA_2DFilterActuator.cpp +++ b/source/gameengine/GameLogic/SCA_2DFilterActuator.cpp @@ -96,7 +96,7 @@ void SCA_2DFilterActuator::SetShaderText(const char *text) m_shaderText = text; } -#ifndef DISABLE_PYTHON +#ifdef WITH_PYTHON /* ------------------------------------------------------------------------- */ /* Python functions */ diff --git a/source/gameengine/GameLogic/SCA_ANDController.cpp b/source/gameengine/GameLogic/SCA_ANDController.cpp index 53c9be5215e..7e2c5bdb350 100644 --- a/source/gameengine/GameLogic/SCA_ANDController.cpp +++ b/source/gameengine/GameLogic/SCA_ANDController.cpp @@ -87,7 +87,7 @@ CValue* SCA_ANDController::GetReplica() return replica; } -#ifndef DISABLE_PYTHON +#ifdef WITH_PYTHON /* ------------------------------------------------------------------------- */ /* Python functions */ @@ -123,5 +123,5 @@ PyMethodDef SCA_ANDController::Methods[] = { PyAttributeDef SCA_ANDController::Attributes[] = { { NULL } //Sentinel }; -#endif // DISABLE_PYTHON +#endif // WITH_PYTHON /* eof */ diff --git a/source/gameengine/GameLogic/SCA_ActuatorSensor.cpp b/source/gameengine/GameLogic/SCA_ActuatorSensor.cpp index c77e58d2f3b..d6c328cd730 100644 --- a/source/gameengine/GameLogic/SCA_ActuatorSensor.cpp +++ b/source/gameengine/GameLogic/SCA_ActuatorSensor.cpp @@ -110,7 +110,7 @@ void SCA_ActuatorSensor::Update() } } -#ifndef DISABLE_PYTHON +#ifdef WITH_PYTHON /* ------------------------------------------------------------------------- */ /* Python functions */ @@ -160,6 +160,6 @@ int SCA_ActuatorSensor::CheckActuator(void *self, const PyAttributeDef*) return 1; } -#endif // DISABLE_PYTHON +#endif // WITH_PYTHON /* eof */ diff --git a/source/gameengine/GameLogic/SCA_ActuatorSensor.h b/source/gameengine/GameLogic/SCA_ActuatorSensor.h index 323746889bf..eb52d365079 100644 --- a/source/gameengine/GameLogic/SCA_ActuatorSensor.h +++ b/source/gameengine/GameLogic/SCA_ActuatorSensor.h @@ -56,7 +56,7 @@ public: virtual void ReParent(SCA_IObject* parent); void Update(); -#ifndef DISABLE_PYTHON +#ifdef WITH_PYTHON /* --------------------------------------------------------------------- */ /* Python interface ---------------------------------------------------- */ @@ -64,7 +64,7 @@ public: static int CheckActuator(void *self, const PyAttributeDef*); -#endif // DISABLE_PYTHON +#endif // WITH_PYTHON }; #endif diff --git a/source/gameengine/GameLogic/SCA_AlwaysSensor.cpp b/source/gameengine/GameLogic/SCA_AlwaysSensor.cpp index e364225af3d..88f5855b223 100644 --- a/source/gameengine/GameLogic/SCA_AlwaysSensor.cpp +++ b/source/gameengine/GameLogic/SCA_AlwaysSensor.cpp @@ -94,7 +94,7 @@ bool SCA_AlwaysSensor::Evaluate() return result; } -#ifndef DISABLE_PYTHON +#ifdef WITH_PYTHON /* ------------------------------------------------------------------------- */ /* Python functions */ diff --git a/source/gameengine/GameLogic/SCA_DelaySensor.cpp b/source/gameengine/GameLogic/SCA_DelaySensor.cpp index 6cad801e429..abe72fb6757 100644 --- a/source/gameengine/GameLogic/SCA_DelaySensor.cpp +++ b/source/gameengine/GameLogic/SCA_DelaySensor.cpp @@ -120,7 +120,7 @@ bool SCA_DelaySensor::Evaluate() return trigger; } -#ifndef DISABLE_PYTHON +#ifdef WITH_PYTHON /* ------------------------------------------------------------------------- */ /* Python functions */ @@ -160,6 +160,6 @@ PyAttributeDef SCA_DelaySensor::Attributes[] = { { NULL } //Sentinel }; -#endif // DISABLE_PYTHON +#endif // WITH_PYTHON /* eof */ diff --git a/source/gameengine/GameLogic/SCA_IController.cpp b/source/gameengine/GameLogic/SCA_IController.cpp index c291ff091aa..0c6b8350bca 100644 --- a/source/gameengine/GameLogic/SCA_IController.cpp +++ b/source/gameengine/GameLogic/SCA_IController.cpp @@ -194,7 +194,7 @@ void SCA_IController::ApplyState(unsigned int state) } } -#ifndef DISABLE_PYTHON +#ifdef WITH_PYTHON /* Python api */ @@ -247,4 +247,4 @@ PyObject* SCA_IController::pyattr_get_actuators(void *self_v, const KX_PYATTRIBU { return KX_PythonSeq_CreatePyObject((static_cast<SCA_IController*>(self_v))->m_proxy, KX_PYGENSEQ_CONT_TYPE_ACTUATORS); } -#endif // DISABLE_PYTHON +#endif // WITH_PYTHON diff --git a/source/gameengine/GameLogic/SCA_IController.h b/source/gameengine/GameLogic/SCA_IController.h index e23a0d7dc92..2d19770be4a 100644 --- a/source/gameengine/GameLogic/SCA_IController.h +++ b/source/gameengine/GameLogic/SCA_IController.h @@ -99,11 +99,11 @@ public: } -#ifndef DISABLE_PYTHON +#ifdef WITH_PYTHON static PyObject* pyattr_get_state(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef); static PyObject* pyattr_get_sensors(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef); static PyObject* pyattr_get_actuators(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef); -#endif // DISABLE_PYTHON +#endif // WITH_PYTHON }; #endif diff --git a/source/gameengine/GameLogic/SCA_ILogicBrick.cpp b/source/gameengine/GameLogic/SCA_ILogicBrick.cpp index f2e1a8dd151..afda218c99c 100644 --- a/source/gameengine/GameLogic/SCA_ILogicBrick.cpp +++ b/source/gameengine/GameLogic/SCA_ILogicBrick.cpp @@ -169,7 +169,7 @@ CValue* SCA_ILogicBrick::GetEvent() -#ifndef DISABLE_PYTHON +#ifdef WITH_PYTHON /* python stuff */ @@ -253,4 +253,4 @@ PyObject* SCA_ILogicBrick::BoolToPyArg(bool boolarg) return PyLong_FromSsize_t(boolarg? KX_TRUE: KX_FALSE); } -#endif // DISABLE_PYTHON +#endif // WITH_PYTHON diff --git a/source/gameengine/GameLogic/SCA_ILogicBrick.h b/source/gameengine/GameLogic/SCA_ILogicBrick.h index 3225c245550..a444210e8d9 100644 --- a/source/gameengine/GameLogic/SCA_ILogicBrick.h +++ b/source/gameengine/GameLogic/SCA_ILogicBrick.h @@ -133,7 +133,7 @@ public: virtual void Replace_IScene(SCA_IScene *val) {}; virtual void Replace_NetworkScene(NG_NetworkScene *val) {}; -#ifndef DISABLE_PYTHON +#ifdef WITH_PYTHON // python methods static PyObject* pyattr_get_owner(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef); @@ -157,7 +157,7 @@ protected: /** Convert a a c++ value to KX_TRUE, KX_FALSE in Python. */ PyObject* BoolToPyArg(bool); -#endif // DISABLE_PYTHON +#endif // WITH_PYTHON }; diff --git a/source/gameengine/GameLogic/SCA_IObject.cpp b/source/gameengine/GameLogic/SCA_IObject.cpp index 7c0a5b2db15..ff71d1bf96b 100644 --- a/source/gameengine/GameLogic/SCA_IObject.cpp +++ b/source/gameengine/GameLogic/SCA_IObject.cpp @@ -303,7 +303,7 @@ void SCA_IObject::SetState(unsigned int state) } } -#ifndef DISABLE_PYTHON +#ifdef WITH_PYTHON /* ------------------------------------------------------------------------- */ /* Python functions */ @@ -342,4 +342,4 @@ PyAttributeDef SCA_IObject::Attributes[] = { { NULL } //Sentinel }; -#endif // DISABLE_PYTHON +#endif // WITH_PYTHON diff --git a/source/gameengine/GameLogic/SCA_IObject.h b/source/gameengine/GameLogic/SCA_IObject.h index 0178da5f343..591be6fe53b 100644 --- a/source/gameengine/GameLogic/SCA_IObject.h +++ b/source/gameengine/GameLogic/SCA_IObject.h @@ -41,7 +41,7 @@ class SCA_ISensor; class SCA_IController; class SCA_IActuator; -#ifndef DISABLE_PYTHON +#ifdef WITH_PYTHON template<class T> T PyVecTo(PyObject*); #endif diff --git a/source/gameengine/GameLogic/SCA_ISensor.cpp b/source/gameengine/GameLogic/SCA_ISensor.cpp index fada69848b2..c655924aa48 100644 --- a/source/gameengine/GameLogic/SCA_ISensor.cpp +++ b/source/gameengine/GameLogic/SCA_ISensor.cpp @@ -300,7 +300,7 @@ void SCA_ISensor::Activate(class SCA_LogicManager* logicmgr) } } -#ifndef DISABLE_PYTHON +#ifdef WITH_PYTHON /* ----------------------------------------------- */ /* Python Functions */ @@ -427,6 +427,6 @@ int SCA_ISensor::pyattr_check_tap(void *self_v, const KX_PYATTRIBUTE_DEF *attrde self->m_level = false; return 0; } -#endif // DISABLE_PYTHON +#endif // WITH_PYTHON /* eof */ diff --git a/source/gameengine/GameLogic/SCA_ISensor.h b/source/gameengine/GameLogic/SCA_ISensor.h index 2d3a3ef08a0..f31dd83343b 100644 --- a/source/gameengine/GameLogic/SCA_ISensor.h +++ b/source/gameengine/GameLogic/SCA_ISensor.h @@ -190,7 +190,7 @@ public: bool IsNoLink() const { return !m_links; } -#ifndef DISABLE_PYTHON +#ifdef WITH_PYTHON /* Python functions: */ KX_PYMETHOD_DOC_NOARGS(SCA_ISensor,reset); @@ -210,7 +210,7 @@ public: KX_SENSOR_JUST_DEACTIVATED }; -#endif // DISABLE_PYTHON +#endif // WITH_PYTHON }; #endif //__SCA_ISENSOR diff --git a/source/gameengine/GameLogic/SCA_JoystickSensor.cpp b/source/gameengine/GameLogic/SCA_JoystickSensor.cpp index 29a6a73b865..a68938ec834 100644 --- a/source/gameengine/GameLogic/SCA_JoystickSensor.cpp +++ b/source/gameengine/GameLogic/SCA_JoystickSensor.cpp @@ -241,7 +241,7 @@ bool SCA_JoystickSensor::isValid(SCA_JoystickSensor::KX_JOYSENSORMODE m) return res; } -#ifndef DISABLE_PYTHON +#ifdef WITH_PYTHON /* ------------------------------------------------------------------------- */ /* Python functions */ diff --git a/source/gameengine/GameLogic/SCA_JoystickSensor.h b/source/gameengine/GameLogic/SCA_JoystickSensor.h index 90fb16de747..39f826dfe02 100644 --- a/source/gameengine/GameLogic/SCA_JoystickSensor.h +++ b/source/gameengine/GameLogic/SCA_JoystickSensor.h @@ -117,7 +117,7 @@ public: return m_joyindex; } -#ifndef DISABLE_PYTHON +#ifdef WITH_PYTHON /* --------------------------------------------------------------------- */ /* Python interface ---------------------------------------------------- */ @@ -157,7 +157,7 @@ public: return 0; } -#endif // DISABLE_PYTHON +#endif // WITH_PYTHON }; diff --git a/source/gameengine/GameLogic/SCA_KeyboardSensor.cpp b/source/gameengine/GameLogic/SCA_KeyboardSensor.cpp index 1a87528e540..fe4124eb833 100644 --- a/source/gameengine/GameLogic/SCA_KeyboardSensor.cpp +++ b/source/gameengine/GameLogic/SCA_KeyboardSensor.cpp @@ -408,7 +408,7 @@ void SCA_KeyboardSensor::LogKeystrokes(void) } } -#ifndef DISABLE_PYTHON +#ifdef WITH_PYTHON /* ------------------------------------------------------------------------- */ /* Python Functions */ @@ -501,7 +501,7 @@ PyObject* SCA_KeyboardSensor::pyattr_get_events(void *self_v, const KX_PYATTRIBU return resultlist; } -#endif // DISABLE_PYTHON +#endif // WITH_PYTHON /* Accessed from python */ diff --git a/source/gameengine/GameLogic/SCA_KeyboardSensor.h b/source/gameengine/GameLogic/SCA_KeyboardSensor.h index 5ca329b0846..0a3b25ac361 100644 --- a/source/gameengine/GameLogic/SCA_KeyboardSensor.h +++ b/source/gameengine/GameLogic/SCA_KeyboardSensor.h @@ -103,7 +103,7 @@ public: virtual bool IsPositiveTrigger(); bool TriggerOnAllKeys(); -#ifndef DISABLE_PYTHON +#ifdef WITH_PYTHON /* --------------------------------------------------------------------- */ /* Python interface ---------------------------------------------------- */ /* --------------------------------------------------------------------- */ diff --git a/source/gameengine/GameLogic/SCA_LogicManager.cpp b/source/gameengine/GameLogic/SCA_LogicManager.cpp index d003c5618f1..ab06fe7f9ef 100644 --- a/source/gameengine/GameLogic/SCA_LogicManager.cpp +++ b/source/gameengine/GameLogic/SCA_LogicManager.cpp @@ -307,7 +307,7 @@ void SCA_LogicManager::AddTriggeredController(SCA_IController* controller, SCA_I { controller->Activate(m_triggeredControllerSet); -#ifndef DISABLE_PYTHON +#ifdef WITH_PYTHON // so that the controller knows which sensor has activited it // only needed for python controller diff --git a/source/gameengine/GameLogic/SCA_MouseSensor.cpp b/source/gameengine/GameLogic/SCA_MouseSensor.cpp index 9f4b25986b0..af11353c93e 100644 --- a/source/gameengine/GameLogic/SCA_MouseSensor.cpp +++ b/source/gameengine/GameLogic/SCA_MouseSensor.cpp @@ -232,7 +232,7 @@ bool SCA_MouseSensor::isValid(SCA_MouseSensor::KX_MOUSESENSORMODE m) return ((m > KX_MOUSESENSORMODE_NODEF) && (m < KX_MOUSESENSORMODE_MAX)); } -#ifndef DISABLE_PYTHON +#ifdef WITH_PYTHON /* ------------------------------------------------------------------------- */ /* Python functions */ @@ -305,6 +305,6 @@ PyAttributeDef SCA_MouseSensor::Attributes[] = { { NULL } //Sentinel }; -#endif // DISABLE_PYTHON +#endif // WITH_PYTHON /* eof */ diff --git a/source/gameengine/GameLogic/SCA_MouseSensor.h b/source/gameengine/GameLogic/SCA_MouseSensor.h index f52b57a3e11..dc0e9a11d39 100644 --- a/source/gameengine/GameLogic/SCA_MouseSensor.h +++ b/source/gameengine/GameLogic/SCA_MouseSensor.h @@ -104,7 +104,7 @@ class SCA_MouseSensor : public SCA_ISensor static void UpdateHotkey(void *self); -#ifndef DISABLE_PYTHON +#ifdef WITH_PYTHON /* --------------------------------------------------------------------- */ /* Python interface ---------------------------------------------------- */ /* --------------------------------------------------------------------- */ diff --git a/source/gameengine/GameLogic/SCA_NANDController.cpp b/source/gameengine/GameLogic/SCA_NANDController.cpp index c09a53d8ac7..bcb2c84a083 100644 --- a/source/gameengine/GameLogic/SCA_NANDController.cpp +++ b/source/gameengine/GameLogic/SCA_NANDController.cpp @@ -87,7 +87,7 @@ CValue* SCA_NANDController::GetReplica() return replica; } -#ifndef DISABLE_PYTHON +#ifdef WITH_PYTHON /* ------------------------------------------------------------------------- */ /* Python functions */ diff --git a/source/gameengine/GameLogic/SCA_NORController.cpp b/source/gameengine/GameLogic/SCA_NORController.cpp index 8ebd79efcfa..5711fb5751b 100644 --- a/source/gameengine/GameLogic/SCA_NORController.cpp +++ b/source/gameengine/GameLogic/SCA_NORController.cpp @@ -87,7 +87,7 @@ CValue* SCA_NORController::GetReplica() return replica; } -#ifndef DISABLE_PYTHON +#ifdef WITH_PYTHON /* ------------------------------------------------------------------------- */ /* Python functions */ @@ -124,6 +124,6 @@ PyAttributeDef SCA_NORController::Attributes[] = { { NULL } //Sentinel }; -#endif // DISABLE_PYTHON +#endif // WITH_PYTHON /* eof */ diff --git a/source/gameengine/GameLogic/SCA_ORController.cpp b/source/gameengine/GameLogic/SCA_ORController.cpp index a638147e211..72c368d632f 100644 --- a/source/gameengine/GameLogic/SCA_ORController.cpp +++ b/source/gameengine/GameLogic/SCA_ORController.cpp @@ -83,7 +83,7 @@ void SCA_ORController::Trigger(SCA_LogicManager* logicmgr) } } -#ifndef DISABLE_PYTHON +#ifdef WITH_PYTHON /* ------------------------------------------------------------------------- */ /* Python functions */ @@ -120,6 +120,6 @@ PyAttributeDef SCA_ORController::Attributes[] = { { NULL } //Sentinel }; -#endif // DISABLE_PYTHON +#endif // WITH_PYTHON /* eof */ diff --git a/source/gameengine/GameLogic/SCA_PropertyActuator.cpp b/source/gameengine/GameLogic/SCA_PropertyActuator.cpp index c1b49d32712..a5ac5654e21 100644 --- a/source/gameengine/GameLogic/SCA_PropertyActuator.cpp +++ b/source/gameengine/GameLogic/SCA_PropertyActuator.cpp @@ -217,7 +217,7 @@ void SCA_PropertyActuator::Relink(GEN_Map<GEN_HashedPtr, void*> *obj_map) } } -#ifndef DISABLE_PYTHON +#ifdef WITH_PYTHON /* ------------------------------------------------------------------------- */ /* Python functions */ diff --git a/source/gameengine/GameLogic/SCA_PropertySensor.cpp b/source/gameengine/GameLogic/SCA_PropertySensor.cpp index be86b976a70..a32cc50fd63 100644 --- a/source/gameengine/GameLogic/SCA_PropertySensor.cpp +++ b/source/gameengine/GameLogic/SCA_PropertySensor.cpp @@ -304,7 +304,7 @@ CValue* SCA_PropertySensor::FindIdentifier(const STR_String& identifiername) return GetParent()->FindIdentifier(identifiername); } -#ifndef DISABLE_PYTHON +#ifdef WITH_PYTHON /* ------------------------------------------------------------------------- */ /* Python functions */ @@ -378,6 +378,6 @@ PyAttributeDef SCA_PropertySensor::Attributes[] = { { NULL } //Sentinel }; -#endif // DISABLE_PYTHON +#endif // WITH_PYTHON /* eof */ diff --git a/source/gameengine/GameLogic/SCA_PropertySensor.h b/source/gameengine/GameLogic/SCA_PropertySensor.h index 9a5c4762558..5a29c526fc0 100644 --- a/source/gameengine/GameLogic/SCA_PropertySensor.h +++ b/source/gameengine/GameLogic/SCA_PropertySensor.h @@ -84,7 +84,7 @@ public: virtual bool IsPositiveTrigger(); virtual CValue* FindIdentifier(const STR_String& identifiername); -#ifndef DISABLE_PYTHON +#ifdef WITH_PYTHON /* --------------------------------------------------------------------- */ /* Python interface ---------------------------------------------------- */ diff --git a/source/gameengine/GameLogic/SCA_PythonController.cpp b/source/gameengine/GameLogic/SCA_PythonController.cpp index 45f0684c02f..109b199f230 100644 --- a/source/gameengine/GameLogic/SCA_PythonController.cpp +++ b/source/gameengine/GameLogic/SCA_PythonController.cpp @@ -35,10 +35,10 @@ #include "SCA_IActuator.h" #include "PyObjectPlus.h" -#ifndef DISABLE_PYTHON +#ifdef WITH_PYTHON #include "compile.h" #include "eval.h" -#endif // DISABLE_PYTHON +#endif // WITH_PYTHON #include <algorithm> @@ -49,7 +49,7 @@ SCA_PythonController* SCA_PythonController::m_sCurrentController = NULL; SCA_PythonController::SCA_PythonController(SCA_IObject* gameobj, int mode) : SCA_IController(gameobj), -#ifndef DISABLE_PYTHON +#ifdef WITH_PYTHON m_bytecode(NULL), m_function(NULL), #endif @@ -57,7 +57,7 @@ SCA_PythonController::SCA_PythonController(SCA_IObject* gameobj, int mode) m_bModified(true), m_debug(false), m_mode(mode) -#ifndef DISABLE_PYTHON +#ifdef WITH_PYTHON , m_pythondictionary(NULL) #endif @@ -84,7 +84,7 @@ int SCA_PythonController::Release() SCA_PythonController::~SCA_PythonController() { -#ifndef DISABLE_PYTHON +#ifdef WITH_PYTHON //printf("released python byte script\n"); Py_XDECREF(m_bytecode); @@ -104,7 +104,7 @@ CValue* SCA_PythonController::GetReplica() { SCA_PythonController* replica = new SCA_PythonController(*this); -#ifndef DISABLE_PYTHON +#ifdef WITH_PYTHON /* why is this needed at all??? - m_bytecode is NULL'd below so this doesnt make sense * but removing it crashes blender (with YoFrankie). so leave in for now - Campbell */ Py_XINCREF(replica->m_bytecode); @@ -146,7 +146,7 @@ void SCA_PythonController::SetScriptName(const STR_String& name) } -#ifndef DISABLE_PYTHON +#ifdef WITH_PYTHON void SCA_PythonController::SetNamespace(PyObject* pythondictionary) { if (m_pythondictionary) @@ -171,7 +171,7 @@ int SCA_PythonController::IsTriggered(class SCA_ISensor* sensor) return 0; } -#ifndef DISABLE_PYTHON +#ifdef WITH_PYTHON /* warning, self is not the SCA_PythonController, its a PyObjectPlus_Proxy */ PyObject* SCA_PythonController::sPyGetCurrentController(PyObject *self) @@ -527,13 +527,13 @@ int SCA_PythonController::pyattr_set_script(void *self_v, const KX_PYATTRIBUTE_D return PY_SET_ATTR_SUCCESS; } -#else // DISABLE_PYTHON +#else // WITH_PYTHON void SCA_PythonController::Trigger(SCA_LogicManager* logicmgr) { /* intentionally blank */ } -#endif // DISABLE_PYTHON +#endif // WITH_PYTHON /* eof */ diff --git a/source/gameengine/GameLogic/SCA_PythonController.h b/source/gameengine/GameLogic/SCA_PythonController.h index bd78014038c..602b5e27e47 100644 --- a/source/gameengine/GameLogic/SCA_PythonController.h +++ b/source/gameengine/GameLogic/SCA_PythonController.h @@ -42,7 +42,7 @@ class SCA_IObject; class SCA_PythonController : public SCA_IController { Py_Header; -#ifndef DISABLE_PYTHON +#ifdef WITH_PYTHON struct _object * m_bytecode; /* SCA_PYEXEC_SCRIPT only */ PyObject* m_function; /* SCA_PYEXEC_MODULE only */ #endif @@ -55,7 +55,7 @@ class SCA_PythonController : public SCA_IController protected: STR_String m_scriptText; STR_String m_scriptName; -#ifndef DISABLE_PYTHON +#ifdef WITH_PYTHON PyObject* m_pythondictionary; /* for SCA_PYEXEC_SCRIPT only */ PyObject* m_pythonfunction; /* for SCA_PYEXEC_MODULE only */ #endif @@ -83,7 +83,7 @@ class SCA_PythonController : public SCA_IController void SetScriptText(const STR_String& text); void SetScriptName(const STR_String& name); -#ifndef DISABLE_PYTHON +#ifdef WITH_PYTHON void SetNamespace(PyObject* pythondictionary); #endif void SetDebug(bool debug) { m_debug = debug; } @@ -94,7 +94,7 @@ class SCA_PythonController : public SCA_IController bool Import(); void ErrorPrint(const char *error_msg); -#ifndef DISABLE_PYTHON +#ifdef WITH_PYTHON static const char* sPyGetCurrentController__doc__; static PyObject* sPyGetCurrentController(PyObject* self); static const char* sPyAddActiveActuator__doc__; diff --git a/source/gameengine/GameLogic/SCA_PythonKeyboard.cpp b/source/gameengine/GameLogic/SCA_PythonKeyboard.cpp index 3d5d3568335..213446935b6 100644 --- a/source/gameengine/GameLogic/SCA_PythonKeyboard.cpp +++ b/source/gameengine/GameLogic/SCA_PythonKeyboard.cpp @@ -33,20 +33,20 @@ SCA_PythonKeyboard::SCA_PythonKeyboard(SCA_IInputDevice* keyboard) : PyObjectPlus(), m_keyboard(keyboard) { -#ifndef DISABLE_PYTHON +#ifdef WITH_PYTHON m_event_dict = PyDict_New(); #endif } SCA_PythonKeyboard::~SCA_PythonKeyboard() { -#ifndef DISABLE_PYTHON +#ifdef WITH_PYTHON PyDict_Clear(m_event_dict); Py_DECREF(m_event_dict); #endif } -#ifndef DISABLE_PYTHON +#ifdef WITH_PYTHON /* ------------------------------------------------------------------------- */ /* Python functions */ diff --git a/source/gameengine/GameLogic/SCA_PythonKeyboard.h b/source/gameengine/GameLogic/SCA_PythonKeyboard.h index 260835155e6..6a89ba7de76 100644 --- a/source/gameengine/GameLogic/SCA_PythonKeyboard.h +++ b/source/gameengine/GameLogic/SCA_PythonKeyboard.h @@ -32,14 +32,14 @@ class SCA_PythonKeyboard : public PyObjectPlus Py_Header; private: class SCA_IInputDevice *m_keyboard; -#ifndef DISABLE_PYTHON +#ifdef WITH_PYTHON PyObject* m_event_dict; #endif public: SCA_PythonKeyboard(class SCA_IInputDevice* keyboard); virtual ~SCA_PythonKeyboard(); -#ifndef DISABLE_PYTHON +#ifdef WITH_PYTHON static PyObject* pyattr_get_events(void* self_v, const KX_PYATTRIBUTE_DEF *attrdef); #endif }; diff --git a/source/gameengine/GameLogic/SCA_PythonMouse.cpp b/source/gameengine/GameLogic/SCA_PythonMouse.cpp index 936ee2ff5c4..7267eb74594 100644 --- a/source/gameengine/GameLogic/SCA_PythonMouse.cpp +++ b/source/gameengine/GameLogic/SCA_PythonMouse.cpp @@ -35,20 +35,20 @@ SCA_PythonMouse::SCA_PythonMouse(SCA_IInputDevice* mouse, RAS_ICanvas* canvas) m_mouse(mouse), m_canvas(canvas) { -#ifndef DISABLE_PYTHON +#ifdef WITH_PYTHON m_event_dict = PyDict_New(); #endif } SCA_PythonMouse::~SCA_PythonMouse() { -#ifndef DISABLE_PYTHON +#ifdef WITH_PYTHON PyDict_Clear(m_event_dict); Py_DECREF(m_event_dict); #endif } -#ifndef DISABLE_PYTHON +#ifdef WITH_PYTHON /* ------------------------------------------------------------------------- */ /* Python functions */ diff --git a/source/gameengine/GameLogic/SCA_PythonMouse.h b/source/gameengine/GameLogic/SCA_PythonMouse.h index 9e1085e6bec..15a7e19c602 100644 --- a/source/gameengine/GameLogic/SCA_PythonMouse.h +++ b/source/gameengine/GameLogic/SCA_PythonMouse.h @@ -33,7 +33,7 @@ class SCA_PythonMouse : public PyObjectPlus private: class SCA_IInputDevice *m_mouse; class RAS_ICanvas *m_canvas; -#ifndef DISABLE_PYTHON +#ifdef WITH_PYTHON PyObject* m_event_dict; #endif public: @@ -42,7 +42,7 @@ public: void Show(bool visible); -#ifndef DISABLE_PYTHON +#ifdef WITH_PYTHON KX_PYMETHOD_DOC(SCA_PythonMouse, show); static PyObject* pyattr_get_events(void* self_v, const KX_PYATTRIBUTE_DEF *attrdef); diff --git a/source/gameengine/GameLogic/SCA_RandomActuator.cpp b/source/gameengine/GameLogic/SCA_RandomActuator.cpp index 4b90ca7dadf..c3d5988be24 100644 --- a/source/gameengine/GameLogic/SCA_RandomActuator.cpp +++ b/source/gameengine/GameLogic/SCA_RandomActuator.cpp @@ -305,7 +305,7 @@ void SCA_RandomActuator::enforceConstraints() { } } -#ifndef DISABLE_PYTHON +#ifdef WITH_PYTHON /* ------------------------------------------------------------------------- */ /* Python functions */ diff --git a/source/gameengine/GameLogic/SCA_RandomActuator.h b/source/gameengine/GameLogic/SCA_RandomActuator.h index 41d19f5b4c4..1fd2180f32c 100644 --- a/source/gameengine/GameLogic/SCA_RandomActuator.h +++ b/source/gameengine/GameLogic/SCA_RandomActuator.h @@ -92,7 +92,7 @@ class SCA_RandomActuator : public SCA_IActuator virtual CValue* GetReplica(); virtual void ProcessReplica(); -#ifndef DISABLE_PYTHON +#ifdef WITH_PYTHON /* --------------------------------------------------------------------- */ /* Python interface ---------------------------------------------------- */ @@ -112,7 +112,7 @@ class SCA_RandomActuator : public SCA_IActuator KX_PYMETHOD_DOC_VARARGS(SCA_RandomActuator, setFloatNormal); KX_PYMETHOD_DOC_VARARGS(SCA_RandomActuator, setFloatNegativeExponential); -#endif // DISABLE_PYTHON +#endif // WITH_PYTHON }; /* end of class KX_EditObjectActuator : public SCA_PropertyActuator */ diff --git a/source/gameengine/GameLogic/SCA_RandomSensor.cpp b/source/gameengine/GameLogic/SCA_RandomSensor.cpp index a7d18ff40d4..8194f1c97c8 100644 --- a/source/gameengine/GameLogic/SCA_RandomSensor.cpp +++ b/source/gameengine/GameLogic/SCA_RandomSensor.cpp @@ -120,7 +120,7 @@ bool SCA_RandomSensor::Evaluate() return evaluateResult; } -#ifndef DISABLE_PYTHON +#ifdef WITH_PYTHON /* ------------------------------------------------------------------------- */ /* Python functions */ @@ -176,6 +176,6 @@ int SCA_RandomSensor::pyattr_set_seed(void *self_v, const KX_PYATTRIBUTE_DEF *at return PY_SET_ATTR_SUCCESS; } -#endif // DISABLE_PYTHON +#endif // WITH_PYTHON /* eof */ diff --git a/source/gameengine/GameLogic/SCA_RandomSensor.h b/source/gameengine/GameLogic/SCA_RandomSensor.h index 3be17943d84..af5a767c1c1 100644 --- a/source/gameengine/GameLogic/SCA_RandomSensor.h +++ b/source/gameengine/GameLogic/SCA_RandomSensor.h @@ -56,7 +56,7 @@ public: virtual bool IsPositiveTrigger(); virtual void Init(); -#ifndef DISABLE_PYTHON +#ifdef WITH_PYTHON /* --------------------------------------------------------------------- */ /* Python interface ---------------------------------------------------- */ diff --git a/source/gameengine/GameLogic/SCA_XNORController.cpp b/source/gameengine/GameLogic/SCA_XNORController.cpp index 9f54e41d110..f1f76c83718 100644 --- a/source/gameengine/GameLogic/SCA_XNORController.cpp +++ b/source/gameengine/GameLogic/SCA_XNORController.cpp @@ -91,7 +91,7 @@ CValue* SCA_XNORController::GetReplica() return replica; } -#ifndef DISABLE_PYTHON +#ifdef WITH_PYTHON /* ------------------------------------------------------------------------- */ /* Python functions */ @@ -128,6 +128,6 @@ PyAttributeDef SCA_XNORController::Attributes[] = { { NULL } //Sentinel }; -#endif // DISABLE_PYTHON +#endif // WITH_PYTHON /* eof */ diff --git a/source/gameengine/GameLogic/SCA_XORController.cpp b/source/gameengine/GameLogic/SCA_XORController.cpp index a58f30a3bed..ee63b72e455 100644 --- a/source/gameengine/GameLogic/SCA_XORController.cpp +++ b/source/gameengine/GameLogic/SCA_XORController.cpp @@ -91,7 +91,7 @@ CValue* SCA_XORController::GetReplica() return replica; } -#ifndef DISABLE_PYTHON +#ifdef WITH_PYTHON /* ------------------------------------------------------------------------- */ /* Python functions */ @@ -127,6 +127,6 @@ PyMethodDef SCA_XORController::Methods[] = { PyAttributeDef SCA_XORController::Attributes[] = { { NULL } //Sentinel }; -#endif // DISABLE_PYTHON +#endif // WITH_PYTHON /* eof */ diff --git a/source/gameengine/GameLogic/SConscript b/source/gameengine/GameLogic/SConscript index c9d1fed875d..04990e10d06 100644 --- a/source/gameengine/GameLogic/SConscript +++ b/source/gameengine/GameLogic/SConscript @@ -16,8 +16,7 @@ else: if env['WITH_BF_PYTHON']: incs += ' ' + env['BF_PYTHON_INC'] -else: - defs.append('DISABLE_PYTHON') + defs.append('WITH_PYTHON') if env['OURPLATFORM'] in ('win32-vc', 'win64-vc'): if env['BF_DEBUG']: diff --git a/source/gameengine/GamePlayer/common/SConscript b/source/gameengine/GamePlayer/common/SConscript index 7a16e950b36..60cb437b10f 100644 --- a/source/gameengine/GamePlayer/common/SConscript +++ b/source/gameengine/GamePlayer/common/SConscript @@ -62,8 +62,7 @@ defs = [ 'GLEW_STATIC' ] if env['WITH_BF_PYTHON']: incs += Split(env['BF_PYTHON_INC']) -else: - defs.append('DISABLE_PYTHON') + defs.append('WITH_PYTHON') incs += Split(env['BF_PNG_INC']) incs += Split(env['BF_ZLIB_INC']) diff --git a/source/gameengine/GamePlayer/ghost/GPG_Application.cpp b/source/gameengine/GamePlayer/ghost/GPG_Application.cpp index d1b8fb12336..506601f478b 100644 --- a/source/gameengine/GamePlayer/ghost/GPG_Application.cpp +++ b/source/gameengine/GamePlayer/ghost/GPG_Application.cpp @@ -677,11 +677,11 @@ bool GPG_Application::startEngine(void) m_startScene, m_canvas); -#ifndef DISABLE_PYTHON +#ifdef WITH_PYTHON // some python things PyObject *gameLogic, *gameLogic_keys; setupGamePython(m_ketsjiengine, startscene, m_maggie, NULL, &gameLogic, &gameLogic_keys, m_argc, m_argv); -#endif // DISABLE_PYTHON +#endif // WITH_PYTHON //initialize Dome Settings if(m_startScene->gm.stereoflag == STEREO_DOME) diff --git a/source/gameengine/GamePlayer/ghost/SConscript b/source/gameengine/GamePlayer/ghost/SConscript index 41520a06c66..d2224884f7f 100644 --- a/source/gameengine/GamePlayer/ghost/SConscript +++ b/source/gameengine/GamePlayer/ghost/SConscript @@ -44,8 +44,7 @@ defs = [ 'GLEW_STATIC' ] if env['WITH_BF_PYTHON']: incs += Split(env['BF_PYTHON_INC']) -else: - defs.append('DISABLE_PYTHON') + defs.append('WITH_PYTHON') if env['WITH_BF_FFMPEG']: defs.append('WITH_FFMPEG') diff --git a/source/gameengine/Ketsji/BL_Shader.cpp b/source/gameengine/Ketsji/BL_Shader.cpp index 8edefe7ac2d..b00c1b7efb7 100644 --- a/source/gameengine/Ketsji/BL_Shader.cpp +++ b/source/gameengine/Ketsji/BL_Shader.cpp @@ -728,7 +728,7 @@ void BL_Shader::SetUniform(int uniform, const int* val, int len) } } -#ifndef DISABLE_PYTHON +#ifdef WITH_PYTHON PyMethodDef BL_Shader::Methods[] = { @@ -1411,6 +1411,6 @@ KX_PYMETHODDEF_DOC( BL_Shader, setUniformDef, "setUniformDef(name, enum)" ) return NULL; } -#endif // DISABLE_PYTHON +#endif // WITH_PYTHON // eof diff --git a/source/gameengine/Ketsji/BL_Shader.h b/source/gameengine/Ketsji/BL_Shader.h index 5108acea0ff..77c642ecc7b 100644 --- a/source/gameengine/Ketsji/BL_Shader.h +++ b/source/gameengine/Ketsji/BL_Shader.h @@ -222,7 +222,7 @@ public: void SetUniform(int uniform, const int val); // Python interface -#ifndef DISABLE_PYTHON +#ifdef WITH_PYTHON virtual PyObject* py_repr(void) { return PyUnicode_FromFormat("BL_Shader\n\tvertex shader:%s\n\n\tfragment shader%s\n\n", vertProg, fragProg); } // ----------------------------------- diff --git a/source/gameengine/Ketsji/CMakeLists.txt b/source/gameengine/Ketsji/CMakeLists.txt index 2813160fb82..1ca71e678e8 100644 --- a/source/gameengine/Ketsji/CMakeLists.txt +++ b/source/gameengine/Ketsji/CMakeLists.txt @@ -134,8 +134,7 @@ ENDIF(WITH_SDL) IF(WITH_PYTHON) LIST(APPEND INC ${PYTHON_INC}) -ELSE(WITH_PYTHON) - ADD_DEFINITIONS(-DDISABLE_PYTHON) + ADD_DEFINITIONS(-DWITH_PYTHON) ENDIF(WITH_PYTHON) IF(WITH_FFMPEG) diff --git a/source/gameengine/Ketsji/KXNetwork/CMakeLists.txt b/source/gameengine/Ketsji/KXNetwork/CMakeLists.txt index 2b1c1a698f3..5099534c0ad 100644 --- a/source/gameengine/Ketsji/KXNetwork/CMakeLists.txt +++ b/source/gameengine/Ketsji/KXNetwork/CMakeLists.txt @@ -46,8 +46,7 @@ SET(SRC IF(WITH_PYTHON) LIST(APPEND INC ${PYTHON_INC}) -ELSE(WITH_PYTHON) - ADD_DEFINITIONS(-DDISABLE_PYTHON) + ADD_DEFINITIONS(-DWITH_PYTHON) ENDIF(WITH_PYTHON) BLENDERLIB(kx_network "${SRC}" "${INC}") diff --git a/source/gameengine/Ketsji/KXNetwork/KX_NetworkMessageActuator.cpp b/source/gameengine/Ketsji/KXNetwork/KX_NetworkMessageActuator.cpp index e047a9aa273..0f563dc4fe4 100644 --- a/source/gameengine/Ketsji/KXNetwork/KX_NetworkMessageActuator.cpp +++ b/source/gameengine/Ketsji/KXNetwork/KX_NetworkMessageActuator.cpp @@ -91,7 +91,7 @@ CValue* KX_NetworkMessageActuator::GetReplica() return replica; } -#ifndef DISABLE_PYTHON +#ifdef WITH_PYTHON /* -------------------------------------------------------------------- */ /* Python interface --------------------------------------------------- */ @@ -132,4 +132,4 @@ PyAttributeDef KX_NetworkMessageActuator::Attributes[] = { { NULL } //Sentinel }; -#endif // DISABLE_PYTHON +#endif // WITH_PYTHON diff --git a/source/gameengine/Ketsji/KXNetwork/KX_NetworkMessageSensor.cpp b/source/gameengine/Ketsji/KXNetwork/KX_NetworkMessageSensor.cpp index 56ccac9a93e..91b05990ba1 100644 --- a/source/gameengine/Ketsji/KXNetwork/KX_NetworkMessageSensor.cpp +++ b/source/gameengine/Ketsji/KXNetwork/KX_NetworkMessageSensor.cpp @@ -154,7 +154,7 @@ bool KX_NetworkMessageSensor::IsPositiveTrigger() return m_IsUp; } -#ifndef DISABLE_PYTHON +#ifdef WITH_PYTHON /* --------------------------------------------------------------------- */ /* Python interface ---------------------------------------------------- */ @@ -215,4 +215,4 @@ PyObject* KX_NetworkMessageSensor::pyattr_get_subjects(void *self_v, const KX_PY } } -#endif // DISABLE_PYTHON +#endif // WITH_PYTHON diff --git a/source/gameengine/Ketsji/KXNetwork/KX_NetworkMessageSensor.h b/source/gameengine/Ketsji/KXNetwork/KX_NetworkMessageSensor.h index 1efd25dd65f..8f5a11426a7 100644 --- a/source/gameengine/Ketsji/KXNetwork/KX_NetworkMessageSensor.h +++ b/source/gameengine/Ketsji/KXNetwork/KX_NetworkMessageSensor.h @@ -71,7 +71,7 @@ public: m_NetworkScene= val; }; -#ifndef DISABLE_PYTHON +#ifdef WITH_PYTHON /* ------------------------------------------------------------- */ /* Python interface -------------------------------------------- */ @@ -81,7 +81,7 @@ public: static PyObject* pyattr_get_bodies(void* self_v, const KX_PYATTRIBUTE_DEF *attrdef); static PyObject* pyattr_get_subjects(void* self_v, const KX_PYATTRIBUTE_DEF *attrdef); -#endif // DISABLE_PYTHON +#endif // WITH_PYTHON }; diff --git a/source/gameengine/Ketsji/KXNetwork/SConscript b/source/gameengine/Ketsji/KXNetwork/SConscript index e7f98ff5850..78cdc8df9af 100644 --- a/source/gameengine/Ketsji/KXNetwork/SConscript +++ b/source/gameengine/Ketsji/KXNetwork/SConscript @@ -11,7 +11,6 @@ defs = [] if env['WITH_BF_PYTHON']: incs += ' ' + env['BF_PYTHON_INC'] -else: - defs.append('DISABLE_PYTHON') + defs.append('WITH_PYTHON') env.BlenderLib ( 'bf_network', Split(sources), Split(incs), defines=defs,libtype=['core','player'], priority=[400,125], cxx_compileflags=env['BGE_CXXFLAGS']) diff --git a/source/gameengine/Ketsji/KX_ArmatureSensor.cpp b/source/gameengine/Ketsji/KX_ArmatureSensor.cpp index a47a1972beb..732c0b910df 100644 --- a/source/gameengine/Ketsji/KX_ArmatureSensor.cpp +++ b/source/gameengine/Ketsji/KX_ArmatureSensor.cpp @@ -149,7 +149,7 @@ bool KX_ArmatureSensor::Evaluate() return (reset) ? true : false; } -#ifndef DISABLE_PYTHON +#ifdef WITH_PYTHON /* ------------------------------------------------------------------------- */ /* Python functions */ @@ -201,4 +201,4 @@ PyObject* KX_ArmatureSensor::pyattr_get_constraint(void *self, const struct KX_P Py_RETURN_NONE; } -#endif // DISABLE_PYTHON +#endif // WITH_PYTHON diff --git a/source/gameengine/Ketsji/KX_ArmatureSensor.h b/source/gameengine/Ketsji/KX_ArmatureSensor.h index 636309f5bdf..b007899c4ff 100644 --- a/source/gameengine/Ketsji/KX_ArmatureSensor.h +++ b/source/gameengine/Ketsji/KX_ArmatureSensor.h @@ -66,14 +66,14 @@ public: // identify the constraint that this actuator controls void FindConstraint(); -#ifndef DISABLE_PYTHON +#ifdef WITH_PYTHON /* --------------------------------------------------------------------- */ /* Python interface ---------------------------------------------------- */ /* --------------------------------------------------------------------- */ static PyObject* pyattr_get_constraint(void *self, const struct KX_PYATTRIBUTE_DEF *attrdef); -#endif // DISABLE_PYTHON +#endif // WITH_PYTHON private: struct bConstraint* m_constraint; diff --git a/source/gameengine/Ketsji/KX_BlenderMaterial.cpp b/source/gameengine/Ketsji/KX_BlenderMaterial.cpp index d88997e2128..a4dc68b92e5 100644 --- a/source/gameengine/Ketsji/KX_BlenderMaterial.cpp +++ b/source/gameengine/Ketsji/KX_BlenderMaterial.cpp @@ -783,7 +783,7 @@ void KX_BlenderMaterial::SetBlenderGLSLShader(int layer) } } -#ifndef DISABLE_PYTHON +#ifdef WITH_PYTHON PyMethodDef KX_BlenderMaterial::Methods[] = { @@ -967,4 +967,4 @@ KX_PYMETHODDEF_DOC( KX_BlenderMaterial, setBlending , "setBlending( bge.logic.sr return NULL; } -#endif // DISABLE_PYTHON +#endif // WITH_PYTHON diff --git a/source/gameengine/Ketsji/KX_BlenderMaterial.h b/source/gameengine/Ketsji/KX_BlenderMaterial.h index 239e334f68a..745045ff784 100644 --- a/source/gameengine/Ketsji/KX_BlenderMaterial.h +++ b/source/gameengine/Ketsji/KX_BlenderMaterial.h @@ -98,7 +98,7 @@ public: } }; -#ifndef DISABLE_PYTHON +#ifdef WITH_PYTHON // -------------------------------- virtual PyObject* py_repr(void) { return PyUnicode_FromString(mMaterial->matname.ReadPtr()); } @@ -113,7 +113,7 @@ public: KX_PYMETHOD_DOC( KX_BlenderMaterial, setTexture ); KX_PYMETHOD_DOC( KX_BlenderMaterial, setBlending ); -#endif // DISABLE_PYTHON +#endif // WITH_PYTHON // -------------------------------- // pre calculate to avoid pops/lag at startup diff --git a/source/gameengine/Ketsji/KX_Camera.cpp b/source/gameengine/Ketsji/KX_Camera.cpp index 2402baf92ac..46a92365302 100644 --- a/source/gameengine/Ketsji/KX_Camera.cpp +++ b/source/gameengine/Ketsji/KX_Camera.cpp @@ -474,7 +474,7 @@ int KX_Camera::GetViewportTop() const return m_camdata.m_viewporttop; } -#ifndef DISABLE_PYTHON +#ifdef WITH_PYTHON //---------------------------------------------------------------------------- //Python diff --git a/source/gameengine/Ketsji/KX_Camera.h b/source/gameengine/Ketsji/KX_Camera.h index ad2460d34ef..130dfd4067d 100644 --- a/source/gameengine/Ketsji/KX_Camera.h +++ b/source/gameengine/Ketsji/KX_Camera.h @@ -41,7 +41,7 @@ #include "IntValue.h" #include "RAS_CameraData.h" -#ifndef DISABLE_PYTHON +#ifdef WITH_PYTHON /* utility conversion function */ bool ConvertPythonToCamera(PyObject * value, KX_Camera **object, bool py_none_ok, const char *error_prefix); #endif @@ -269,7 +269,7 @@ public: virtual int GetGameObjectType() { return OBJ_CAMERA; } -#ifndef DISABLE_PYTHON +#ifdef WITH_PYTHON KX_PYMETHOD_DOC_VARARGS(KX_Camera, sphereInsideFrustum); KX_PYMETHOD_DOC_O(KX_Camera, boxInsideFrustum); KX_PYMETHOD_DOC_O(KX_Camera, pointInsideFrustum); diff --git a/source/gameengine/Ketsji/KX_CameraActuator.cpp b/source/gameengine/Ketsji/KX_CameraActuator.cpp index bc67ecbe1a5..18d3e046577 100644 --- a/source/gameengine/Ketsji/KX_CameraActuator.cpp +++ b/source/gameengine/Ketsji/KX_CameraActuator.cpp @@ -346,7 +346,7 @@ CValue *KX_CameraActuator::findObject(char *obName) return NULL; } -#ifndef DISABLE_PYTHON +#ifdef WITH_PYTHON /* ------------------------------------------------------------------------- */ /* Python functions */ @@ -414,6 +414,6 @@ int KX_CameraActuator::pyattr_set_object(void *self_v, const KX_PYATTRIBUTE_DEF return PY_SET_ATTR_SUCCESS; } -#endif // DISABLE_PYTHON +#endif // WITH_PYTHON /* eof */ diff --git a/source/gameengine/Ketsji/KX_CameraActuator.h b/source/gameengine/Ketsji/KX_CameraActuator.h index 2bc0ee18593..0a0a47f1ce2 100644 --- a/source/gameengine/Ketsji/KX_CameraActuator.h +++ b/source/gameengine/Ketsji/KX_CameraActuator.h @@ -114,7 +114,7 @@ private : /** Methods inherited from SCA_ILogicBrick */ virtual void Relink(GEN_Map<GEN_HashedPtr, void*> *obj_map); -#ifndef DISABLE_PYTHON +#ifdef WITH_PYTHON /* --------------------------------------------------------------------- */ /* Python interface ---------------------------------------------------- */ @@ -124,7 +124,7 @@ private : static PyObject* pyattr_get_object(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef); static int pyattr_set_object(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef, PyObject *value); -#endif // DISABLE_PYTHON +#endif // WITH_PYTHON }; diff --git a/source/gameengine/Ketsji/KX_ConstraintActuator.cpp b/source/gameengine/Ketsji/KX_ConstraintActuator.cpp index 9380f4b5d2f..15a4a4680bb 100644 --- a/source/gameengine/Ketsji/KX_ConstraintActuator.cpp +++ b/source/gameengine/Ketsji/KX_ConstraintActuator.cpp @@ -557,7 +557,7 @@ bool KX_ConstraintActuator::IsValidMode(KX_ConstraintActuator::KX_CONSTRAINTTYPE return res; } -#ifndef DISABLE_PYTHON +#ifdef WITH_PYTHON /* ------------------------------------------------------------------------- */ /* Python functions */ diff --git a/source/gameengine/Ketsji/KX_ConstraintWrapper.cpp b/source/gameengine/Ketsji/KX_ConstraintWrapper.cpp index b1baa5fe9e1..2882ca5a371 100644 --- a/source/gameengine/Ketsji/KX_ConstraintWrapper.cpp +++ b/source/gameengine/Ketsji/KX_ConstraintWrapper.cpp @@ -45,7 +45,7 @@ KX_ConstraintWrapper::~KX_ConstraintWrapper() { } -#ifndef DISABLE_PYTHON +#ifdef WITH_PYTHON PyObject* KX_ConstraintWrapper::PyGetConstraintId() { @@ -120,4 +120,4 @@ PyObject* KX_ConstraintWrapper::pyattr_get_constraintId(void *self_v, const KX_P return self->PyGetConstraintId(); } -#endif // DISABLE_PYTHON +#endif // WITH_PYTHON diff --git a/source/gameengine/Ketsji/KX_ConstraintWrapper.h b/source/gameengine/Ketsji/KX_ConstraintWrapper.h index db9543c23ae..58c204d5da0 100644 --- a/source/gameengine/Ketsji/KX_ConstraintWrapper.h +++ b/source/gameengine/Ketsji/KX_ConstraintWrapper.h @@ -40,7 +40,7 @@ public: virtual ~KX_ConstraintWrapper (); int getConstraintId() { return m_constraintId;}; -#ifndef DISABLE_PYTHON +#ifdef WITH_PYTHON KX_PYMETHOD_NOARGS(KX_ConstraintWrapper,GetConstraintId); KX_PYMETHOD(KX_ConstraintWrapper,SetParam); KX_PYMETHOD(KX_ConstraintWrapper,GetParam); diff --git a/source/gameengine/Ketsji/KX_Dome.cpp b/source/gameengine/Ketsji/KX_Dome.cpp index 64ef06a4e09..36fc02ab833 100644 --- a/source/gameengine/Ketsji/KX_Dome.cpp +++ b/source/gameengine/Ketsji/KX_Dome.cpp @@ -24,7 +24,7 @@ Developed as part of a Research and Development project for SAT - La Société d #include "KX_Dome.h" -#ifndef DISABLE_PYTHON +#ifdef WITH_PYTHON #include <structmember.h> #endif diff --git a/source/gameengine/Ketsji/KX_GameActuator.cpp b/source/gameengine/Ketsji/KX_GameActuator.cpp index 208c526398a..1a195913e4a 100644 --- a/source/gameengine/Ketsji/KX_GameActuator.cpp +++ b/source/gameengine/Ketsji/KX_GameActuator.cpp @@ -124,7 +124,7 @@ bool KX_GameActuator::Update() } case KX_GAME_SAVECFG: { -#ifndef DISABLE_PYTHON +#ifdef WITH_PYTHON if (m_ketsjiengine) { char mashal_path[512]; @@ -152,11 +152,11 @@ bool KX_GameActuator::Update() delete [] marshal_buffer; } break; -#endif // DISABLE_PYTHON +#endif // WITH_PYTHON } case KX_GAME_LOADCFG: { -#ifndef DISABLE_PYTHON +#ifdef WITH_PYTHON if (m_ketsjiengine) { char mashal_path[512]; @@ -191,7 +191,7 @@ bool KX_GameActuator::Update() } } break; -#endif // DISABLE_PYTHON +#endif // WITH_PYTHON } default: ; /* do nothing? this is an internal error !!! */ @@ -201,7 +201,7 @@ bool KX_GameActuator::Update() } -#ifndef DISABLE_PYTHON +#ifdef WITH_PYTHON /* ------------------------------------------------------------------------- */ /* Python functions */ @@ -241,4 +241,4 @@ PyAttributeDef KX_GameActuator::Attributes[] = { { NULL } //Sentinel }; -#endif // DISABLE_PYTHON +#endif // WITH_PYTHON diff --git a/source/gameengine/Ketsji/KX_GameObject.cpp b/source/gameengine/Ketsji/KX_GameObject.cpp index bbb17cd1df9..6b1c36a1589 100644 --- a/source/gameengine/Ketsji/KX_GameObject.cpp +++ b/source/gameengine/Ketsji/KX_GameObject.cpp @@ -102,7 +102,7 @@ KX_GameObject::KX_GameObject( m_xray(false), m_pHitObject(NULL), m_isDeformable(false) -#ifndef DISABLE_PYTHON +#ifdef WITH_PYTHON , m_attr_dict(NULL) #endif { @@ -148,12 +148,12 @@ KX_GameObject::~KX_GameObject() { delete m_pGraphicController; } -#ifndef DISABLE_PYTHON +#ifdef WITH_PYTHON if (m_attr_dict) { PyDict_Clear(m_attr_dict); /* incase of circular refs or other weired cases */ Py_DECREF(m_attr_dict); } -#endif // DISABLE_PYTHON +#endif // WITH_PYTHON } KX_GameObject* KX_GameObject::GetClientObject(KX_ClientObjectInfo* info) @@ -348,7 +348,7 @@ void KX_GameObject::ProcessReplica() m_pClient_info->m_gameobject = this; m_state = 0; -#ifndef DISABLE_PYTHON +#ifdef WITH_PYTHON if(m_attr_dict) m_attr_dict= PyDict_Copy(m_attr_dict); #endif @@ -1448,7 +1448,7 @@ void KX_GameObject_Mathutils_Callback_Init(void) #endif // USE_MATHUTILS -#ifndef DISABLE_PYTHON +#ifdef WITH_PYTHON /* ------- python stuff ---------------------------------------------------*/ PyMethodDef KX_GameObject::Methods[] = { {"applyForce", (PyCFunction) KX_GameObject::sPyApplyForce, METH_VARARGS}, @@ -3053,4 +3053,4 @@ bool ConvertPythonToGameObject(PyObject * value, KX_GameObject **object, bool py return false; } -#endif // DISABLE_PYTHON +#endif // WITH_PYTHON diff --git a/source/gameengine/Ketsji/KX_GameObject.h b/source/gameengine/Ketsji/KX_GameObject.h index 14587d25c7f..640816e19ca 100644 --- a/source/gameengine/Ketsji/KX_GameObject.h +++ b/source/gameengine/Ketsji/KX_GameObject.h @@ -60,7 +60,7 @@ class PHY_IGraphicController; class PHY_IPhysicsEnvironment; struct Object; -#ifndef DISABLE_PYTHON +#ifdef WITH_PYTHON /* utility conversion function */ bool ConvertPythonToGameObject(PyObject * value, KX_GameObject **object, bool py_none_ok, const char *error_prefix); #endif @@ -116,7 +116,7 @@ public: */ static KX_GameObject* GetClientObject(KX_ClientObjectInfo* info); -#ifndef DISABLE_PYTHON +#ifdef WITH_PYTHON // Python attributes that wont convert into CValue // // there are 2 places attributes can be stored, in the CValue, @@ -796,7 +796,7 @@ public: CListValue* GetChildren(); CListValue* GetChildrenRecursive(); -#ifndef DISABLE_PYTHON +#ifdef WITH_PYTHON /** * @section Python interface functions. */ diff --git a/source/gameengine/Ketsji/KX_IpoActuator.cpp b/source/gameengine/Ketsji/KX_IpoActuator.cpp index eca40cafb0e..605aea5f592 100644 --- a/source/gameengine/Ketsji/KX_IpoActuator.cpp +++ b/source/gameengine/Ketsji/KX_IpoActuator.cpp @@ -400,7 +400,7 @@ int KX_IpoActuator::string2mode(char* modename) { return res; } -#ifndef DISABLE_PYTHON +#ifdef WITH_PYTHON /* ------------------------------------------------------------------------- */ /* Python functions */ @@ -448,6 +448,6 @@ PyAttributeDef KX_IpoActuator::Attributes[] = { { NULL } //Sentinel }; -#endif // DISABLE_PYTHON +#endif // WITH_PYTHON /* eof */ diff --git a/source/gameengine/Ketsji/KX_KetsjiEngine.cpp b/source/gameengine/Ketsji/KX_KetsjiEngine.cpp index 4f3b6e5bb96..a1c7957dc72 100644 --- a/source/gameengine/Ketsji/KX_KetsjiEngine.cpp +++ b/source/gameengine/Ketsji/KX_KetsjiEngine.cpp @@ -112,7 +112,7 @@ KX_KetsjiEngine::KX_KetsjiEngine(KX_ISystem* system) m_rendertools(NULL), m_sceneconverter(NULL), m_networkdevice(NULL), -#ifndef DISABLE_PYTHON +#ifdef WITH_PYTHON m_pythondictionary(NULL), #endif m_keyboarddevice(NULL), @@ -233,7 +233,7 @@ void KX_KetsjiEngine::SetRasterizer(RAS_IRasterizer* rasterizer) m_rasterizer = rasterizer; } -#ifndef DISABLE_PYTHON +#ifdef WITH_PYTHON /* * At the moment the bge.logic module is imported into 'pythondictionary' after this function is called. * if this function ever changes to assign a copy, make sure the game logic module is imported into this dictionary before hand. @@ -370,7 +370,7 @@ void KX_KetsjiEngine::RenderDome() } m_dome->Draw(); // Draw Callback for the last scene -#ifndef DISABLE_PYTHON +#ifdef WITH_PYTHON scene->RunDrawingCallbacks(scene->GetPostDrawCB()); #endif EndFrame(); @@ -612,7 +612,7 @@ else m_logger->StartLog(tc_physics, m_kxsystem->GetTimeInSeconds(), true); SG_SetActiveStage(SG_STAGE_PHYSICS1); // set Python hooks for each scene -#ifndef DISABLE_PYTHON +#ifdef WITH_PYTHON PHY_SetActiveEnvironment(scene->GetPhysicsEnvironment()); #endif KX_SetActiveScene(scene); @@ -716,7 +716,7 @@ else m_suspendeddelta = scene->getSuspendedDelta(); // set Python hooks for each scene -#ifndef DISABLE_PYTHON +#ifdef WITH_PYTHON PHY_SetActiveEnvironment(scene->GetPhysicsEnvironment()); #endif KX_SetActiveScene(scene); @@ -1287,7 +1287,7 @@ void KX_KetsjiEngine::RenderFrame(KX_Scene* scene, KX_Camera* cam) m_logger->StartLog(tc_rasterizer, m_kxsystem->GetTimeInSeconds(), true); SG_SetActiveStage(SG_STAGE_RENDER); -#ifndef DISABLE_PYTHON +#ifdef WITH_PYTHON // Run any pre-drawing python callbacks scene->RunDrawingCallbacks(scene->GetPreDrawCB()); #endif @@ -1304,7 +1304,7 @@ void KX_KetsjiEngine::PostRenderScene(KX_Scene* scene) { m_rendertools->MotionBlur(m_rasterizer); scene->Render2DFilters(m_canvas); -#ifndef DISABLE_PYTHON +#ifdef WITH_PYTHON scene->RunDrawingCallbacks(scene->GetPostDrawCB()); #endif m_rasterizer->FlushDebugLines(); diff --git a/source/gameengine/Ketsji/KX_KetsjiEngine.h b/source/gameengine/Ketsji/KX_KetsjiEngine.h index f52ec8192cc..4ce14e100cc 100644 --- a/source/gameengine/Ketsji/KX_KetsjiEngine.h +++ b/source/gameengine/Ketsji/KX_KetsjiEngine.h @@ -70,7 +70,7 @@ private: class RAS_IRenderTools* m_rendertools; class KX_ISceneConverter* m_sceneconverter; class NG_NetworkDeviceInterface* m_networkdevice; -#ifndef DISABLE_PYTHON +#ifdef WITH_PYTHON /* borrowed from sys.modules["__main__"], dont manage ref's */ PyObject* m_pythondictionary; #endif @@ -204,7 +204,7 @@ public: void SetCanvas(RAS_ICanvas* canvas); void SetRenderTools(RAS_IRenderTools* rendertools); void SetRasterizer(RAS_IRasterizer* rasterizer); -#ifndef DISABLE_PYTHON +#ifdef WITH_PYTHON void SetPyNamespace(PyObject* pythondictionary); PyObject* GetPyNamespace(){return m_pythondictionary;}; #endif diff --git a/source/gameengine/Ketsji/KX_Light.cpp b/source/gameengine/Ketsji/KX_Light.cpp index fdd325c46a1..b608be4c89f 100644 --- a/source/gameengine/Ketsji/KX_Light.cpp +++ b/source/gameengine/Ketsji/KX_Light.cpp @@ -259,7 +259,7 @@ void KX_LightObject::UnbindShadowBuffer(RAS_IRasterizer *ras) GPU_lamp_shadow_buffer_unbind(lamp); } -#ifndef DISABLE_PYTHON +#ifdef WITH_PYTHON /* ------------------------------------------------------------------------- */ /* Python Integration Hooks */ /* ------------------------------------------------------------------------- */ @@ -385,4 +385,4 @@ int KX_LightObject::pyattr_set_type(void* self_v, const KX_PYATTRIBUTE_DEF *attr return PY_SET_ATTR_SUCCESS; } -#endif // DISABLE_PYTHON +#endif // WITH_PYTHON diff --git a/source/gameengine/Ketsji/KX_Light.h b/source/gameengine/Ketsji/KX_Light.h index 334aed1995d..f7b40d24293 100644 --- a/source/gameengine/Ketsji/KX_Light.h +++ b/source/gameengine/Ketsji/KX_Light.h @@ -69,7 +69,7 @@ public: virtual int GetGameObjectType() { return OBJ_LIGHT; } -#ifndef DISABLE_PYTHON +#ifdef WITH_PYTHON /* attributes */ static PyObject* pyattr_get_color(void* self_v, const KX_PYATTRIBUTE_DEF *attrdef); static int pyattr_set_color(void* self_v, const KX_PYATTRIBUTE_DEF *attrdef, PyObject* value); diff --git a/source/gameengine/Ketsji/KX_MeshProxy.cpp b/source/gameengine/Ketsji/KX_MeshProxy.cpp index a5ff7ebcbc1..3cedda38201 100644 --- a/source/gameengine/Ketsji/KX_MeshProxy.cpp +++ b/source/gameengine/Ketsji/KX_MeshProxy.cpp @@ -26,7 +26,7 @@ * ***** END GPL LICENSE BLOCK ***** */ -#ifndef DISABLE_PYTHON +#ifdef WITH_PYTHON #include "KX_MeshProxy.h" #include "RAS_IPolygonMaterial.h" @@ -308,4 +308,4 @@ bool ConvertPythonToMesh(PyObject * value, RAS_MeshObject **object, bool py_none return false; } -#endif // DISABLE_PYTHON +#endif // WITH_PYTHON diff --git a/source/gameengine/Ketsji/KX_MeshProxy.h b/source/gameengine/Ketsji/KX_MeshProxy.h index 7b627040b4c..29231498163 100644 --- a/source/gameengine/Ketsji/KX_MeshProxy.h +++ b/source/gameengine/Ketsji/KX_MeshProxy.h @@ -29,7 +29,7 @@ #ifndef __KX_MESHPROXY #define __KX_MESHPROXY -#ifndef DISABLE_PYTHON +#ifdef WITH_PYTHON #include "SCA_IObject.h" @@ -74,7 +74,7 @@ public: static PyObject * pyattr_get_numPolygons(void * self, const KX_PYATTRIBUTE_DEF * attrdef); }; -#endif // DISABLE_PYTHON +#endif // WITH_PYTHON #endif //__KX_MESHPROXY diff --git a/source/gameengine/Ketsji/KX_MouseFocusSensor.cpp b/source/gameengine/Ketsji/KX_MouseFocusSensor.cpp index 19114c86c98..637210525f8 100644 --- a/source/gameengine/Ketsji/KX_MouseFocusSensor.cpp +++ b/source/gameengine/Ketsji/KX_MouseFocusSensor.cpp @@ -347,7 +347,7 @@ const MT_Vector2& KX_MouseFocusSensor::HitUV() const return m_hitUV; } -#ifndef DISABLE_PYTHON +#ifdef WITH_PYTHON /* ------------------------------------------------------------------------- */ /* Python functions */ @@ -442,7 +442,7 @@ PyObject* KX_MouseFocusSensor::pyattr_get_hit_uv(void *self_v, const KX_PYATTRIB return PyObjectFrom(self->HitUV()); } -#endif // DISABLE_PYTHON +#endif // WITH_PYTHON /* eof */ diff --git a/source/gameengine/Ketsji/KX_MouseFocusSensor.h b/source/gameengine/Ketsji/KX_MouseFocusSensor.h index c969aa3ec74..3ea0f932314 100644 --- a/source/gameengine/Ketsji/KX_MouseFocusSensor.h +++ b/source/gameengine/Ketsji/KX_MouseFocusSensor.h @@ -94,7 +94,7 @@ class KX_MouseFocusSensor : public SCA_MouseSensor const MT_Vector3& HitNormal() const; const MT_Vector2& HitUV() const; -#ifndef DISABLE_PYTHON +#ifdef WITH_PYTHON /* --------------------------------------------------------------------- */ /* Python interface ---------------------------------------------------- */ @@ -109,7 +109,7 @@ class KX_MouseFocusSensor : public SCA_MouseSensor static PyObject* pyattr_get_hit_normal(void* self_v, const KX_PYATTRIBUTE_DEF *attrdef); static PyObject* pyattr_get_hit_uv(void* self_v, const KX_PYATTRIBUTE_DEF *attrdef); -#endif // DISABLE_PYTHON +#endif // WITH_PYTHON /* --------------------------------------------------------------------- */ SCA_IObject* m_hitObject; diff --git a/source/gameengine/Ketsji/KX_NearSensor.cpp b/source/gameengine/Ketsji/KX_NearSensor.cpp index 36c1b0f5bd1..c9af5d8d2a5 100644 --- a/source/gameengine/Ketsji/KX_NearSensor.cpp +++ b/source/gameengine/Ketsji/KX_NearSensor.cpp @@ -242,7 +242,7 @@ bool KX_NearSensor::NewHandleCollision(void* obj1,void* obj2,const PHY_CollData return false; // was DT_CONTINUE; but this was defined in Sumo as false } -#ifndef DISABLE_PYTHON +#ifdef WITH_PYTHON /* ------------------------------------------------------------------------- */ /* Python Functions */ @@ -285,4 +285,4 @@ PyAttributeDef KX_NearSensor::Attributes[] = { {NULL} //Sentinel }; -#endif // DISABLE_PYTHON +#endif // WITH_PYTHON diff --git a/source/gameengine/Ketsji/KX_NearSensor.h b/source/gameengine/Ketsji/KX_NearSensor.h index 10dba22c4e9..67f235ceae2 100644 --- a/source/gameengine/Ketsji/KX_NearSensor.h +++ b/source/gameengine/Ketsji/KX_NearSensor.h @@ -78,7 +78,7 @@ public: virtual bool BroadPhaseSensorFilterCollision(void*obj1,void*obj2) { return false; }; virtual sensortype GetSensorType() { return ST_NEAR; } -#ifndef DISABLE_PYTHON +#ifdef WITH_PYTHON /* --------------------------------------------------------------------- */ /* Python interface ---------------------------------------------------- */ @@ -99,7 +99,7 @@ public: return 0; } -#endif // DISABLE_PYTHON +#endif // WITH_PYTHON }; diff --git a/source/gameengine/Ketsji/KX_ObjectActuator.cpp b/source/gameengine/Ketsji/KX_ObjectActuator.cpp index 0d0cac3c084..9f1df329005 100644 --- a/source/gameengine/Ketsji/KX_ObjectActuator.cpp +++ b/source/gameengine/Ketsji/KX_ObjectActuator.cpp @@ -313,7 +313,7 @@ bool KX_ObjectActuator::isValid(KX_ObjectActuator::KX_OBJECT_ACT_VEC_TYPE type) return res; } -#ifndef DISABLE_PYTHON +#ifdef WITH_PYTHON /* ------------------------------------------------------------------------- */ /* Python functions */ @@ -636,6 +636,6 @@ int KX_ObjectActuator::pyattr_set_reference(void *self, const struct KX_PYATTRIB return PY_SET_ATTR_SUCCESS; } -#endif // DISABLE_PYTHON +#endif // WITH_PYTHON /* eof */ diff --git a/source/gameengine/Ketsji/KX_ObjectActuator.h b/source/gameengine/Ketsji/KX_ObjectActuator.h index b12cf77d3e1..9dab1e39cba 100644 --- a/source/gameengine/Ketsji/KX_ObjectActuator.h +++ b/source/gameengine/Ketsji/KX_ObjectActuator.h @@ -157,7 +157,7 @@ public: } virtual bool Update(); -#ifndef DISABLE_PYTHON +#ifdef WITH_PYTHON /* --------------------------------------------------------------------- */ /* Python interface ---------------------------------------------------- */ @@ -217,7 +217,7 @@ public: return 0; } -#endif // DISABLE_PYTHON +#endif // WITH_PYTHON }; diff --git a/source/gameengine/Ketsji/KX_ParentActuator.cpp b/source/gameengine/Ketsji/KX_ParentActuator.cpp index 62740585831..b41d48f5cf3 100644 --- a/source/gameengine/Ketsji/KX_ParentActuator.cpp +++ b/source/gameengine/Ketsji/KX_ParentActuator.cpp @@ -130,7 +130,7 @@ bool KX_ParentActuator::Update() return false; } -#ifndef DISABLE_PYTHON +#ifdef WITH_PYTHON /* ------------------------------------------------------------------------- */ /* Python functions */ @@ -199,6 +199,6 @@ int KX_ParentActuator::pyattr_set_object(void *self, const struct KX_PYATTRIBUTE return PY_SET_ATTR_SUCCESS; } -#endif // DISABLE_PYTHON +#endif // WITH_PYTHON /* eof */ diff --git a/source/gameengine/Ketsji/KX_ParentActuator.h b/source/gameengine/Ketsji/KX_ParentActuator.h index 884b1829ae3..28745c6d0f5 100644 --- a/source/gameengine/Ketsji/KX_ParentActuator.h +++ b/source/gameengine/Ketsji/KX_ParentActuator.h @@ -77,7 +77,7 @@ class KX_ParentActuator : public SCA_IActuator virtual void Relink(GEN_Map<GEN_HashedPtr, void*> *obj_map); virtual bool UnlinkObject(SCA_IObject* clientobj); -#ifndef DISABLE_PYTHON +#ifdef WITH_PYTHON /* --------------------------------------------------------------------- */ /* Python interface ---------------------------------------------------- */ @@ -87,7 +87,7 @@ class KX_ParentActuator : public SCA_IActuator static PyObject* pyattr_get_object(void *self, const struct KX_PYATTRIBUTE_DEF *attrdef); static int pyattr_set_object(void *self, const struct KX_PYATTRIBUTE_DEF *attrdef, PyObject *value); -#endif // DISABLE_PYTHON +#endif // WITH_PYTHON }; /* end of class KX_ParentActuator : public SCA_PropertyActuator */ diff --git a/source/gameengine/Ketsji/KX_PhysicsObjectWrapper.cpp b/source/gameengine/Ketsji/KX_PhysicsObjectWrapper.cpp index 15fc3e5c471..471774866ac 100644 --- a/source/gameengine/Ketsji/KX_PhysicsObjectWrapper.cpp +++ b/source/gameengine/Ketsji/KX_PhysicsObjectWrapper.cpp @@ -46,7 +46,7 @@ KX_PhysicsObjectWrapper::~KX_PhysicsObjectWrapper() { } -#ifndef DISABLE_PYTHON +#ifdef WITH_PYTHON PyObject* KX_PhysicsObjectWrapper::PySetPosition(PyObject* args) { diff --git a/source/gameengine/Ketsji/KX_PhysicsObjectWrapper.h b/source/gameengine/Ketsji/KX_PhysicsObjectWrapper.h index 01980c0f644..ca7e99350c4 100644 --- a/source/gameengine/Ketsji/KX_PhysicsObjectWrapper.h +++ b/source/gameengine/Ketsji/KX_PhysicsObjectWrapper.h @@ -39,14 +39,14 @@ public: KX_PhysicsObjectWrapper(class PHY_IPhysicsController* ctrl,class PHY_IPhysicsEnvironment* physenv); virtual ~KX_PhysicsObjectWrapper(); -#ifndef DISABLE_PYTHON +#ifdef WITH_PYTHON KX_PYMETHOD_VARARGS(KX_PhysicsObjectWrapper,SetPosition); KX_PYMETHOD_VARARGS(KX_PhysicsObjectWrapper,SetLinearVelocity); KX_PYMETHOD_VARARGS(KX_PhysicsObjectWrapper,SetAngularVelocity); KX_PYMETHOD_VARARGS(KX_PhysicsObjectWrapper,SetActive); -#endif // DISABLE_PYTHON +#endif // WITH_PYTHON private: class PHY_IPhysicsController* m_ctrl; diff --git a/source/gameengine/Ketsji/KX_PolyProxy.cpp b/source/gameengine/Ketsji/KX_PolyProxy.cpp index 9395e57e68b..9843d93c506 100644 --- a/source/gameengine/Ketsji/KX_PolyProxy.cpp +++ b/source/gameengine/Ketsji/KX_PolyProxy.cpp @@ -26,7 +26,7 @@ * ***** END GPL LICENSE BLOCK ***** */ -#ifndef DISABLE_PYTHON +#ifdef WITH_PYTHON #include "KX_PolyProxy.h" #include "KX_MeshProxy.h" @@ -267,4 +267,4 @@ KX_PYMETHODDEF_DOC_NOARGS(KX_PolyProxy, getMaterial, } } -#endif // DISABLE_PYTHON +#endif // WITH_PYTHON diff --git a/source/gameengine/Ketsji/KX_PolyProxy.h b/source/gameengine/Ketsji/KX_PolyProxy.h index 3e669630e30..179fb67f85f 100644 --- a/source/gameengine/Ketsji/KX_PolyProxy.h +++ b/source/gameengine/Ketsji/KX_PolyProxy.h @@ -29,7 +29,7 @@ #ifndef __KX_POLYROXY #define __KX_POLYPROXY -#ifndef DISABLE_PYTHON +#ifdef WITH_PYTHON #include "SCA_IObject.h" @@ -77,7 +77,7 @@ public: }; -#endif // DISABLE_PYTHON +#endif // WITH_PYTHON #endif //__KX_POLYPROXY diff --git a/source/gameengine/Ketsji/KX_PolygonMaterial.cpp b/source/gameengine/Ketsji/KX_PolygonMaterial.cpp index 63204b16e8b..89889845125 100644 --- a/source/gameengine/Ketsji/KX_PolygonMaterial.cpp +++ b/source/gameengine/Ketsji/KX_PolygonMaterial.cpp @@ -54,7 +54,7 @@ KX_PolygonMaterial::KX_PolygonMaterial() m_tface(NULL), m_mcol(NULL), m_material(NULL), -#ifndef DISABLE_PYTHON +#ifdef WITH_PYTHON m_pymaterial(NULL), #endif m_pass(0) @@ -90,7 +90,7 @@ void KX_PolygonMaterial::Initialize( m_tface = tface; m_mcol = mcol; m_material = ma; -#ifndef DISABLE_PYTHON +#ifdef WITH_PYTHON m_pymaterial = 0; #endif m_pass = 0; @@ -98,19 +98,19 @@ void KX_PolygonMaterial::Initialize( KX_PolygonMaterial::~KX_PolygonMaterial() { -#ifndef DISABLE_PYTHON +#ifdef WITH_PYTHON if (m_pymaterial) { Py_DECREF(m_pymaterial); } -#endif // DISABLE_PYTHON +#endif // WITH_PYTHON } bool KX_PolygonMaterial::Activate(RAS_IRasterizer* rasty, TCachingInfo& cachingInfo) const { bool dopass = false; -#ifndef DISABLE_PYTHON +#ifdef WITH_PYTHON if (m_pymaterial) { PyObject *pyRasty = PyCObject_FromVoidPtr((void*)rasty, NULL); /* new reference */ @@ -130,7 +130,7 @@ bool KX_PolygonMaterial::Activate(RAS_IRasterizer* rasty, TCachingInfo& cachingI } } else -#endif // DISABLE_PYTHON +#endif // WITH_PYTHON { switch (m_pass++) { @@ -201,7 +201,7 @@ void KX_PolygonMaterial::GetMaterialRGBAColor(unsigned char *rgba) const RAS_IPolyMaterial::GetMaterialRGBAColor(rgba); } -#ifndef DISABLE_PYTHON +#ifdef WITH_PYTHON //---------------------------------------------------------------------------- //Python @@ -393,4 +393,4 @@ int KX_PolygonMaterial::pyattr_set_specular(void *self_v, const KX_PYATTRIBUTE_D return PY_SET_ATTR_SUCCESS; } -#endif // DISABLE_PYTHON +#endif // WITH_PYTHON diff --git a/source/gameengine/Ketsji/KX_PolygonMaterial.h b/source/gameengine/Ketsji/KX_PolygonMaterial.h index 03b4bf11a18..17adbac79c0 100644 --- a/source/gameengine/Ketsji/KX_PolygonMaterial.h +++ b/source/gameengine/Ketsji/KX_PolygonMaterial.h @@ -58,7 +58,7 @@ private: unsigned int* m_mcol; Material* m_material; -#ifndef DISABLE_PYTHON +#ifdef WITH_PYTHON PyObject* m_pymaterial; #endif @@ -122,7 +122,7 @@ public: } virtual void GetMaterialRGBAColor(unsigned char *rgba) const; -#ifndef DISABLE_PYTHON +#ifdef WITH_PYTHON KX_PYMETHOD_DOC(KX_PolygonMaterial, updateTexture); KX_PYMETHOD_DOC(KX_PolygonMaterial, setTexture); KX_PYMETHOD_DOC(KX_PolygonMaterial, activate); diff --git a/source/gameengine/Ketsji/KX_PyConstraintBinding.cpp b/source/gameengine/Ketsji/KX_PyConstraintBinding.cpp index bbf8152bd68..d2cb9aef985 100644 --- a/source/gameengine/Ketsji/KX_PyConstraintBinding.cpp +++ b/source/gameengine/Ketsji/KX_PyConstraintBinding.cpp @@ -37,7 +37,7 @@ #include "PyObjectPlus.h" -#ifndef DISABLE_PYTHON +#ifdef WITH_PYTHON // nasty glob variable to connect scripting language // if there is a better way (without global), please do so! @@ -659,5 +659,5 @@ PHY_IPhysicsEnvironment* PHY_GetActiveEnvironment() return g_CurrentActivePhysicsEnvironment; } -#endif // DISABLE_PYTHON +#endif // WITH_PYTHON diff --git a/source/gameengine/Ketsji/KX_PyConstraintBinding.h b/source/gameengine/Ketsji/KX_PyConstraintBinding.h index a1b3c3d6da3..6da60794eb0 100644 --- a/source/gameengine/Ketsji/KX_PyConstraintBinding.h +++ b/source/gameengine/Ketsji/KX_PyConstraintBinding.h @@ -29,7 +29,7 @@ #ifndef PHY_PYTHON_CONSTRAINTBINDING #define PHY_PYTHON_CONSTRAINTBINDING -#ifndef DISABLE_PYTHON +#ifdef WITH_PYTHON #include <Python.h> @@ -37,7 +37,7 @@ PyObject* initPythonConstraintBinding(); void PHY_RemovePythonConstraintBinding(); void PHY_SetActiveEnvironment(class PHY_IPhysicsEnvironment* env); PHY_IPhysicsEnvironment* PHY_GetActiveEnvironment(); -#endif // DISABLE_PYTHON +#endif // WITH_PYTHON #endif //PHY_PYTHON_CONSTRAINTBINDING diff --git a/source/gameengine/Ketsji/KX_PyMath.cpp b/source/gameengine/Ketsji/KX_PyMath.cpp index 12f88331d15..45957ca1911 100644 --- a/source/gameengine/Ketsji/KX_PyMath.cpp +++ b/source/gameengine/Ketsji/KX_PyMath.cpp @@ -32,7 +32,7 @@ #pragma warning (disable : 4786) #endif //WIN32 -#ifndef DISABLE_PYTHON +#ifdef WITH_PYTHON #include "MT_Vector3.h" #include "MT_Vector4.h" @@ -190,4 +190,4 @@ PyObject* PyObjectFrom(const MT_Tuple2 &vec) #endif } -#endif // DISABLE_PYTHON +#endif // WITH_PYTHON diff --git a/source/gameengine/Ketsji/KX_PyMath.h b/source/gameengine/Ketsji/KX_PyMath.h index 9c9688f79cd..589bd72c760 100644 --- a/source/gameengine/Ketsji/KX_PyMath.h +++ b/source/gameengine/Ketsji/KX_PyMath.h @@ -42,7 +42,7 @@ #include "KX_Python.h" #include "PyObjectPlus.h" -#ifndef DISABLE_PYTHON +#ifdef WITH_PYTHON #ifdef USE_MATHUTILS extern "C" { #include "../../blender/python/generic/mathutils.h" /* so we can have mathutils callbacks */ @@ -239,4 +239,4 @@ PyObject* PyObjectFrom(const MT_Tuple4 &pos); #endif -#endif // DISABLE_PYTHON +#endif // WITH_PYTHON diff --git a/source/gameengine/Ketsji/KX_PythonInit.cpp b/source/gameengine/Ketsji/KX_PythonInit.cpp index 42c3771ba94..99870c42018 100644 --- a/source/gameengine/Ketsji/KX_PythonInit.cpp +++ b/source/gameengine/Ketsji/KX_PythonInit.cpp @@ -34,7 +34,7 @@ #pragma warning (disable : 4786) #endif //WIN32 -#ifndef DISABLE_PYTHON +#ifdef WITH_PYTHON #ifdef _POSIX_C_SOURCE #undef _POSIX_C_SOURCE @@ -56,7 +56,6 @@ extern "C" { #include "marshal.h" /* python header for loading/saving dicts */ } -#define WITH_PYTHON #include "AUD_PyInit.h" #endif @@ -139,7 +138,7 @@ extern "C" { // 'local' copy of canvas ptr, for window height/width python scripts -#ifndef DISABLE_PYTHON +#ifdef WITH_PYTHON static RAS_ICanvas* gp_Canvas = NULL; static char gp_GamePythonPath[FILE_MAXDIR + FILE_MAXFILE] = ""; @@ -147,7 +146,7 @@ static char gp_GamePythonPathOrig[FILE_MAXDIR + FILE_MAXFILE] = ""; // not super static SCA_PythonKeyboard* gp_PythonKeyboard = NULL; static SCA_PythonMouse* gp_PythonMouse = NULL; -#endif // DISABLE_PYTHON +#endif // WITH_PYTHON static KX_Scene* gp_KetsjiScene = NULL; static KX_KetsjiEngine* gp_KetsjiEngine = NULL; @@ -176,7 +175,7 @@ void KX_RasterizerDrawDebugLine(const MT_Vector3& from,const MT_Vector3& to,cons gp_Rasterizer->DrawDebugLine(from,to,color); } -#ifndef DISABLE_PYTHON +#ifdef WITH_PYTHON static PyObject *gp_OrigPythonSysPath= NULL; static PyObject *gp_OrigPythonSysModules= NULL; @@ -2452,4 +2451,4 @@ void resetGamePythonPath() gp_GamePythonPathOrig[0] = '\0'; } -#endif // DISABLE_PYTHON +#endif // WITH_PYTHON diff --git a/source/gameengine/Ketsji/KX_PythonInit.h b/source/gameengine/Ketsji/KX_PythonInit.h index fb59a2f21eb..7b0ed08c6bb 100644 --- a/source/gameengine/Ketsji/KX_PythonInit.h +++ b/source/gameengine/Ketsji/KX_PythonInit.h @@ -39,7 +39,7 @@ typedef enum { extern bool gUseVisibilityTemp; -#ifndef DISABLE_PYTHON +#ifdef WITH_PYTHON PyObject* initGameLogic(class KX_KetsjiEngine *engine, class KX_Scene* ketsjiscene); PyObject* initGameKeys(); PyObject* initRasterizer(class RAS_IRasterizer* rasty,class RAS_ICanvas* canvas); diff --git a/source/gameengine/Ketsji/KX_PythonInitTypes.cpp b/source/gameengine/Ketsji/KX_PythonInitTypes.cpp index 6b9d7a2cccf..3cca4f39f85 100644 --- a/source/gameengine/Ketsji/KX_PythonInitTypes.cpp +++ b/source/gameengine/Ketsji/KX_PythonInitTypes.cpp @@ -32,7 +32,7 @@ #ifndef _adr_py_init_types_h_ // only process once, #define _adr_py_init_types_h_ // even if multiply included -#ifndef DISABLE_PYTHON +#ifdef WITH_PYTHON /* Only for Class::Parents */ #include "BL_BlenderShader.h" @@ -256,6 +256,6 @@ void initPyTypes(void) #endif } -#endif // DISABLE_PYTHON +#endif // WITH_PYTHON #endif diff --git a/source/gameengine/Ketsji/KX_PythonInitTypes.h b/source/gameengine/Ketsji/KX_PythonInitTypes.h index c16fafedf93..1053f320e5e 100644 --- a/source/gameengine/Ketsji/KX_PythonInitTypes.h +++ b/source/gameengine/Ketsji/KX_PythonInitTypes.h @@ -30,7 +30,7 @@ #ifndef _adr_py_init_types_h_ // only process once, #define _adr_py_init_types_h_ // even if multiply included -#ifndef DISABLE_PYTHON +#ifdef WITH_PYTHON void initPyTypes(void); #endif diff --git a/source/gameengine/Ketsji/KX_PythonSeq.cpp b/source/gameengine/Ketsji/KX_PythonSeq.cpp index 5c87fe2e757..bed3f33ab77 100644 --- a/source/gameengine/Ketsji/KX_PythonSeq.cpp +++ b/source/gameengine/Ketsji/KX_PythonSeq.cpp @@ -28,7 +28,7 @@ * Readonly sequence wrapper for lookups on logic bricks */ -#ifndef DISABLE_PYTHON +#ifdef WITH_PYTHON #include "KX_PythonSeq.h" #include "KX_GameObject.h" @@ -512,4 +512,4 @@ PyTypeObject KX_PythonSeq_Type = { NULL }; -#endif // DISABLE_PYTHON +#endif // WITH_PYTHON diff --git a/source/gameengine/Ketsji/KX_PythonSeq.h b/source/gameengine/Ketsji/KX_PythonSeq.h index ca8f667852a..7ca36cc19f4 100644 --- a/source/gameengine/Ketsji/KX_PythonSeq.h +++ b/source/gameengine/Ketsji/KX_PythonSeq.h @@ -31,7 +31,7 @@ #ifndef _adr_py_seq_h_ // only process once, #define _adr_py_seq_h_ // even if multiply included -#ifndef DISABLE_PYTHON +#ifdef WITH_PYTHON #include "PyObjectPlus.h" @@ -61,6 +61,6 @@ typedef struct { PyObject *KX_PythonSeq_CreatePyObject(PyObject *base, short type); -#endif // DISABLE_PYTHON +#endif // WITH_PYTHON #endif // _adr_py_seq_h_ diff --git a/source/gameengine/Ketsji/KX_RadarSensor.cpp b/source/gameengine/Ketsji/KX_RadarSensor.cpp index 041559158dd..60dc3be7d6e 100644 --- a/source/gameengine/Ketsji/KX_RadarSensor.cpp +++ b/source/gameengine/Ketsji/KX_RadarSensor.cpp @@ -172,7 +172,7 @@ void KX_RadarSensor::SynchronizeTransform() /* Python Functions */ /* ------------------------------------------------------------------------- */ -#ifndef DISABLE_PYTHON +#ifdef WITH_PYTHON /* ------------------------------------------------------------------------- */ /* Python Integration Hooks */ @@ -212,4 +212,4 @@ PyAttributeDef KX_RadarSensor::Attributes[] = { {NULL} //Sentinel }; -#endif // DISABLE_PYTHON +#endif // WITH_PYTHON diff --git a/source/gameengine/Ketsji/KX_RaySensor.cpp b/source/gameengine/Ketsji/KX_RaySensor.cpp index e745d1f0334..001c7a290d7 100644 --- a/source/gameengine/Ketsji/KX_RaySensor.cpp +++ b/source/gameengine/Ketsji/KX_RaySensor.cpp @@ -309,7 +309,7 @@ bool KX_RaySensor::Evaluate() return result; } -#ifndef DISABLE_PYTHON +#ifdef WITH_PYTHON /* ------------------------------------------------------------------------- */ /* Python functions */ @@ -365,4 +365,4 @@ PyObject* KX_RaySensor::pyattr_get_hitobject(void *self_v, const KX_PYATTRIBUTE_ Py_RETURN_NONE; } -#endif // DISABLE_PYTHON +#endif // WITH_PYTHON diff --git a/source/gameengine/Ketsji/KX_RaySensor.h b/source/gameengine/Ketsji/KX_RaySensor.h index 34f7d8a7b1d..ac0b5eba26b 100644 --- a/source/gameengine/Ketsji/KX_RaySensor.h +++ b/source/gameengine/Ketsji/KX_RaySensor.h @@ -90,12 +90,12 @@ public: KX_RAY_AXIS_NEG_Z }; -#ifndef DISABLE_PYTHON +#ifdef WITH_PYTHON /* Attributes */ static PyObject* pyattr_get_hitobject(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef); -#endif // DISABLE_PYTHON +#endif // WITH_PYTHON }; diff --git a/source/gameengine/Ketsji/KX_SCA_AddObjectActuator.cpp b/source/gameengine/Ketsji/KX_SCA_AddObjectActuator.cpp index eee6146f6ed..34b49045337 100644 --- a/source/gameengine/Ketsji/KX_SCA_AddObjectActuator.cpp +++ b/source/gameengine/Ketsji/KX_SCA_AddObjectActuator.cpp @@ -159,7 +159,7 @@ void KX_SCA_AddObjectActuator::Relink(GEN_Map<GEN_HashedPtr, void*> *obj_map) } } -#ifndef DISABLE_PYTHON +#ifdef WITH_PYTHON /* ------------------------------------------------------------------------- */ /* Python functions */ @@ -246,7 +246,7 @@ PyObject* KX_SCA_AddObjectActuator::PyInstantAddObject() Py_RETURN_NONE; } -#endif // DISABLE_PYTHON +#endif // WITH_PYTHON void KX_SCA_AddObjectActuator::InstantAddObject() { diff --git a/source/gameengine/Ketsji/KX_SCA_AddObjectActuator.h b/source/gameengine/Ketsji/KX_SCA_AddObjectActuator.h index c2068d157ee..16612f9a743 100644 --- a/source/gameengine/Ketsji/KX_SCA_AddObjectActuator.h +++ b/source/gameengine/Ketsji/KX_SCA_AddObjectActuator.h @@ -122,7 +122,7 @@ public: void InstantAddObject(); -#ifndef DISABLE_PYTHON +#ifdef WITH_PYTHON KX_PYMETHOD_DOC_NOARGS(KX_SCA_AddObjectActuator,InstantAddObject); @@ -130,7 +130,7 @@ public: static int pyattr_set_object(void *self, const struct KX_PYATTRIBUTE_DEF *attrdef, PyObject *value); static PyObject* pyattr_get_objectLastCreated(void *self, const struct KX_PYATTRIBUTE_DEF *attrdef); -#endif // DISABLE_PYTHON +#endif // WITH_PYTHON }; /* end of class KX_SCA_AddObjectActuator : public KX_EditObjectActuator */ diff --git a/source/gameengine/Ketsji/KX_SCA_DynamicActuator.cpp b/source/gameengine/Ketsji/KX_SCA_DynamicActuator.cpp index bc59c63dc69..6e36bde59ec 100644 --- a/source/gameengine/Ketsji/KX_SCA_DynamicActuator.cpp +++ b/source/gameengine/Ketsji/KX_SCA_DynamicActuator.cpp @@ -37,7 +37,7 @@ #include "KX_SCA_DynamicActuator.h" -#ifndef DISABLE_PYTHON +#ifdef WITH_PYTHON /* ------------------------------------------------------------------------- */ /* Python functions */ @@ -77,7 +77,7 @@ PyAttributeDef KX_SCA_DynamicActuator::Attributes[] = { { NULL } //Sentinel }; -#endif // DISABLE_PYTHON +#endif // WITH_PYTHON /* ------------------------------------------------------------------------- */ /* Native functions */ diff --git a/source/gameengine/Ketsji/KX_SCA_EndObjectActuator.cpp b/source/gameengine/Ketsji/KX_SCA_EndObjectActuator.cpp index c9ead726905..f50dc9fc46a 100644 --- a/source/gameengine/Ketsji/KX_SCA_EndObjectActuator.cpp +++ b/source/gameengine/Ketsji/KX_SCA_EndObjectActuator.cpp @@ -80,7 +80,7 @@ CValue* KX_SCA_EndObjectActuator::GetReplica() return replica; }; -#ifndef DISABLE_PYTHON +#ifdef WITH_PYTHON /* ------------------------------------------------------------------------- */ /* Python functions : integration hooks */ @@ -116,6 +116,6 @@ PyAttributeDef KX_SCA_EndObjectActuator::Attributes[] = { { NULL } //Sentinel }; -#endif // DISABLE_PYTHON +#endif // WITH_PYTHON /* eof */ diff --git a/source/gameengine/Ketsji/KX_SCA_ReplaceMeshActuator.cpp b/source/gameengine/Ketsji/KX_SCA_ReplaceMeshActuator.cpp index 20c3168d7ba..51a3979830d 100644 --- a/source/gameengine/Ketsji/KX_SCA_ReplaceMeshActuator.cpp +++ b/source/gameengine/Ketsji/KX_SCA_ReplaceMeshActuator.cpp @@ -40,7 +40,7 @@ #include "PyObjectPlus.h" -#ifndef DISABLE_PYTHON +#ifdef WITH_PYTHON /* ------------------------------------------------------------------------- */ /* Python functions */ @@ -110,7 +110,7 @@ KX_PYMETHODDEF_DOC(KX_SCA_ReplaceMeshActuator, instantReplaceMesh, Py_RETURN_NONE; } -#endif // DISABLE_PYTHON +#endif // WITH_PYTHON /* ------------------------------------------------------------------------- */ /* Native functions */ diff --git a/source/gameengine/Ketsji/KX_SCA_ReplaceMeshActuator.h b/source/gameengine/Ketsji/KX_SCA_ReplaceMeshActuator.h index 4a6ae9f8fce..573ec76782c 100644 --- a/source/gameengine/Ketsji/KX_SCA_ReplaceMeshActuator.h +++ b/source/gameengine/Ketsji/KX_SCA_ReplaceMeshActuator.h @@ -74,7 +74,7 @@ class KX_SCA_ReplaceMeshActuator : public SCA_IActuator void InstantReplaceMesh(); -#ifndef DISABLE_PYTHON +#ifdef WITH_PYTHON /* --------------------------------------------------------------------- */ /* Python interface ---------------------------------------------------- */ @@ -90,7 +90,7 @@ class KX_SCA_ReplaceMeshActuator : public SCA_IActuator KX_PYMETHOD_DOC(KX_SCA_ReplaceMeshActuator,instantReplaceMesh); -#endif // DISABLE_PYTHON +#endif // WITH_PYTHON }; diff --git a/source/gameengine/Ketsji/KX_Scene.cpp b/source/gameengine/Ketsji/KX_Scene.cpp index 3753f3d6bd6..c48112dbcb7 100644 --- a/source/gameengine/Ketsji/KX_Scene.cpp +++ b/source/gameengine/Ketsji/KX_Scene.cpp @@ -208,7 +208,7 @@ KX_Scene::KX_Scene(class SCA_IInputDevice* keyboarddevice, m_bucketmanager=new RAS_BucketManager(); -#ifndef DISABLE_PYTHON +#ifdef WITH_PYTHON m_attr_dict = PyDict_New(); /* new ref */ m_draw_call_pre = NULL; m_draw_call_post = NULL; @@ -262,7 +262,7 @@ KX_Scene::~KX_Scene() delete m_bucketmanager; } -#ifndef DISABLE_PYTHON +#ifdef WITH_PYTHON PyDict_Clear(m_attr_dict); Py_DECREF(m_attr_dict); @@ -1839,7 +1839,7 @@ void KX_Scene::Render2DFilters(RAS_ICanvas* canvas) m_filtermanager.RenderFilters(canvas); } -#ifndef DISABLE_PYTHON +#ifdef WITH_PYTHON void KX_Scene::RunDrawingCallbacks(PyObject* cb_list) { @@ -2249,4 +2249,4 @@ KX_PYMETHODDEF_DOC(KX_Scene, get, "") return def; } -#endif // DISABLE_PYTHON +#endif // WITH_PYTHON diff --git a/source/gameengine/Ketsji/KX_Scene.h b/source/gameengine/Ketsji/KX_Scene.h index cd8277ec39f..9b4a6ec5ec6 100644 --- a/source/gameengine/Ketsji/KX_Scene.h +++ b/source/gameengine/Ketsji/KX_Scene.h @@ -99,7 +99,7 @@ class KX_Scene : public PyObjectPlus, public SCA_IScene { Py_Header; -#ifndef DISABLE_PYTHON +#ifdef WITH_PYTHON PyObject* m_attr_dict; PyObject* m_draw_call_pre; PyObject* m_draw_call_post; @@ -544,7 +544,7 @@ public: void Update2DFilter(vector<STR_String>& propNames, void* gameObj, RAS_2DFilterManager::RAS_2DFILTER_MODE filtermode, int pass, STR_String& text); void Render2DFilters(RAS_ICanvas* canvas); -#ifndef DISABLE_PYTHON +#ifdef WITH_PYTHON /* --------------------------------------------------------------------- */ /* Python interface ---------------------------------------------------- */ /* --------------------------------------------------------------------- */ diff --git a/source/gameengine/Ketsji/KX_SceneActuator.cpp b/source/gameengine/Ketsji/KX_SceneActuator.cpp index 8f6000ebc3d..f991b843c99 100644 --- a/source/gameengine/Ketsji/KX_SceneActuator.cpp +++ b/source/gameengine/Ketsji/KX_SceneActuator.cpp @@ -210,7 +210,7 @@ KX_Scene* KX_SceneActuator::FindScene(char * sceneName) } -#ifndef DISABLE_PYTHON +#ifdef WITH_PYTHON /* ------------------------------------------------------------------------- */ /* Python functions */ @@ -283,6 +283,6 @@ int KX_SceneActuator::pyattr_set_camera(void *self, const struct KX_PYATTRIBUTE_ return PY_SET_ATTR_SUCCESS; } -#endif // DISABLE_PYTHON +#endif // WITH_PYTHON /* eof */ diff --git a/source/gameengine/Ketsji/KX_SceneActuator.h b/source/gameengine/Ketsji/KX_SceneActuator.h index 360488f9f74..b49357b21ca 100644 --- a/source/gameengine/Ketsji/KX_SceneActuator.h +++ b/source/gameengine/Ketsji/KX_SceneActuator.h @@ -89,7 +89,7 @@ class KX_SceneActuator : public SCA_IActuator virtual bool Update(); -#ifndef DISABLE_PYTHON +#ifdef WITH_PYTHON virtual void Replace_IScene(SCA_IScene *val) { @@ -103,7 +103,7 @@ class KX_SceneActuator : public SCA_IActuator static PyObject* pyattr_get_camera(void *self, const struct KX_PYATTRIBUTE_DEF *attrdef); static int pyattr_set_camera(void *self, const struct KX_PYATTRIBUTE_DEF *attrdef, PyObject *value); -#endif // DISABLE_PYTHON +#endif // WITH_PYTHON }; /* end of class KXSceneActuator */ diff --git a/source/gameengine/Ketsji/KX_SoundActuator.cpp b/source/gameengine/Ketsji/KX_SoundActuator.cpp index 9ebb36578c4..d5f8aa74880 100644 --- a/source/gameengine/Ketsji/KX_SoundActuator.cpp +++ b/source/gameengine/Ketsji/KX_SoundActuator.cpp @@ -233,7 +233,7 @@ bool KX_SoundActuator::Update(double curtime, bool frame) } -#ifndef DISABLE_PYTHON +#ifdef WITH_PYTHON /* ------------------------------------------------------------------------- */ /* Python functions */ @@ -496,4 +496,4 @@ int KX_SoundActuator::pyattr_set_pitch(void *self, const struct KX_PYATTRIBUTE_D return PY_SET_ATTR_SUCCESS; } -#endif // DISABLE_PYTHON +#endif // WITH_PYTHON diff --git a/source/gameengine/Ketsji/KX_SoundActuator.h b/source/gameengine/Ketsji/KX_SoundActuator.h index c175a184a15..7c1108ea8fb 100644 --- a/source/gameengine/Ketsji/KX_SoundActuator.h +++ b/source/gameengine/Ketsji/KX_SoundActuator.h @@ -93,7 +93,7 @@ public: CValue* GetReplica(); void ProcessReplica(); -#ifndef DISABLE_PYTHON +#ifdef WITH_PYTHON /* -------------------------------------------------------------------- */ /* Python interface --------------------------------------------------- */ @@ -115,7 +115,7 @@ public: static PyObject* pyattr_get_pitch(void *self, const struct KX_PYATTRIBUTE_DEF *attrdef); static PyObject* pyattr_get_type(void *self, const struct KX_PYATTRIBUTE_DEF *attrdef); -#endif // DISABLE_PYTHON +#endif // WITH_PYTHON }; diff --git a/source/gameengine/Ketsji/KX_StateActuator.cpp b/source/gameengine/Ketsji/KX_StateActuator.cpp index 33f21f49810..ff4c3985a04 100644 --- a/source/gameengine/Ketsji/KX_StateActuator.cpp +++ b/source/gameengine/Ketsji/KX_StateActuator.cpp @@ -124,7 +124,7 @@ void KX_StateActuator::Activate(SG_DList& head) } } -#ifndef DISABLE_PYTHON +#ifdef WITH_PYTHON /* ------------------------------------------------------------------------- */ /* Python functions */ @@ -165,4 +165,4 @@ PyAttributeDef KX_StateActuator::Attributes[] = { { NULL } //Sentinel }; -#endif // DISABLE_PYTHON +#endif // WITH_PYTHON diff --git a/source/gameengine/Ketsji/KX_TouchSensor.cpp b/source/gameengine/Ketsji/KX_TouchSensor.cpp index 9b44f487682..b590624e6c7 100644 --- a/source/gameengine/Ketsji/KX_TouchSensor.cpp +++ b/source/gameengine/Ketsji/KX_TouchSensor.cpp @@ -283,7 +283,7 @@ bool KX_TouchSensor::NewHandleCollision(void*object1,void*object2,const PHY_Coll return false; // was DT_CONTINUE but this was defined in sumo as false. } -#ifndef DISABLE_PYTHON +#ifdef WITH_PYTHON /* ------------------------------------------------------------------------- */ /* Python functions */ diff --git a/source/gameengine/Ketsji/KX_TouchSensor.h b/source/gameengine/Ketsji/KX_TouchSensor.h index c9448897936..80e5a0f938e 100644 --- a/source/gameengine/Ketsji/KX_TouchSensor.h +++ b/source/gameengine/Ketsji/KX_TouchSensor.h @@ -118,7 +118,7 @@ public: // todo: put some info for collision maybe -#ifndef DISABLE_PYTHON +#ifdef WITH_PYTHON /* --------------------------------------------------------------------- */ /* Python interface ---------------------------------------------------- */ diff --git a/source/gameengine/Ketsji/KX_TrackToActuator.cpp b/source/gameengine/Ketsji/KX_TrackToActuator.cpp index ae8d2f6459b..cae183ac4a2 100644 --- a/source/gameengine/Ketsji/KX_TrackToActuator.cpp +++ b/source/gameengine/Ketsji/KX_TrackToActuator.cpp @@ -417,7 +417,7 @@ bool KX_TrackToActuator::Update(double curtime, bool frame) return result; } -#ifndef DISABLE_PYTHON +#ifdef WITH_PYTHON /* ------------------------------------------------------------------------- */ /* Python functions */ @@ -486,6 +486,6 @@ int KX_TrackToActuator::pyattr_set_object(void *self, const struct KX_PYATTRIBUT return PY_SET_ATTR_SUCCESS; } -#endif // DISABLE_PYTHON +#endif // WITH_PYTHON /* eof */ diff --git a/source/gameengine/Ketsji/KX_TrackToActuator.h b/source/gameengine/Ketsji/KX_TrackToActuator.h index 2b44994f103..33b2ecb1aa5 100644 --- a/source/gameengine/Ketsji/KX_TrackToActuator.h +++ b/source/gameengine/Ketsji/KX_TrackToActuator.h @@ -69,7 +69,7 @@ class KX_TrackToActuator : public SCA_IActuator virtual void Relink(GEN_Map<GEN_HashedPtr, void*> *obj_map); virtual bool Update(double curtime, bool frame); -#ifndef DISABLE_PYTHON +#ifdef WITH_PYTHON /* Python part */ @@ -77,7 +77,7 @@ class KX_TrackToActuator : public SCA_IActuator static PyObject* pyattr_get_object(void *self, const struct KX_PYATTRIBUTE_DEF *attrdef); static int pyattr_set_object(void *self, const struct KX_PYATTRIBUTE_DEF *attrdef, PyObject *value); -#endif // DISABLE_PYTHON +#endif // WITH_PYTHON }; /* end of class KX_TrackToActuator : public KX_EditObjectActuator */ diff --git a/source/gameengine/Ketsji/KX_VehicleWrapper.cpp b/source/gameengine/Ketsji/KX_VehicleWrapper.cpp index 4ee80c64570..17368357cc4 100644 --- a/source/gameengine/Ketsji/KX_VehicleWrapper.cpp +++ b/source/gameengine/Ketsji/KX_VehicleWrapper.cpp @@ -29,7 +29,7 @@ KX_VehicleWrapper::~KX_VehicleWrapper() m_motionStates.clear(); } -#ifndef DISABLE_PYTHON +#ifdef WITH_PYTHON PyObject* KX_VehicleWrapper::PyAddWheel(PyObject* args) { @@ -319,4 +319,4 @@ PyAttributeDef KX_VehicleWrapper::Attributes[] = { { NULL } //Sentinel }; -#endif // DISABLE_PYTHON +#endif // WITH_PYTHON diff --git a/source/gameengine/Ketsji/KX_VehicleWrapper.h b/source/gameengine/Ketsji/KX_VehicleWrapper.h index 2ca06da18fc..4cde50b0932 100644 --- a/source/gameengine/Ketsji/KX_VehicleWrapper.h +++ b/source/gameengine/Ketsji/KX_VehicleWrapper.h @@ -20,7 +20,7 @@ public: virtual ~KX_VehicleWrapper (); int getConstraintId(); -#ifndef DISABLE_PYTHON +#ifdef WITH_PYTHON KX_PYMETHOD_VARARGS(KX_VehicleWrapper,AddWheel); KX_PYMETHOD_VARARGS(KX_VehicleWrapper,GetNumWheels); @@ -47,7 +47,7 @@ public: KX_PYMETHOD_VARARGS(KX_VehicleWrapper,SetSuspensionCompression); KX_PYMETHOD_VARARGS(KX_VehicleWrapper,SetRollInfluence); -#endif // DISABLE_PYTHON +#endif // WITH_PYTHON private: PHY_IVehicle* m_vehicle; diff --git a/source/gameengine/Ketsji/KX_VertexProxy.cpp b/source/gameengine/Ketsji/KX_VertexProxy.cpp index 09630ad2851..f66d11394fd 100644 --- a/source/gameengine/Ketsji/KX_VertexProxy.cpp +++ b/source/gameengine/Ketsji/KX_VertexProxy.cpp @@ -26,7 +26,7 @@ * ***** END GPL LICENSE BLOCK ***** */ -#ifndef DISABLE_PYTHON +#ifdef WITH_PYTHON #include "KX_VertexProxy.h" #include "KX_MeshProxy.h" @@ -553,4 +553,4 @@ PyObject* KX_VertexProxy::PySetUV2(PyObject* args) Py_RETURN_NONE; } -#endif // DISABLE_PYTHON +#endif // WITH_PYTHON diff --git a/source/gameengine/Ketsji/KX_VertexProxy.h b/source/gameengine/Ketsji/KX_VertexProxy.h index b39d3ecb7d4..a5f2e5a08e0 100644 --- a/source/gameengine/Ketsji/KX_VertexProxy.h +++ b/source/gameengine/Ketsji/KX_VertexProxy.h @@ -29,7 +29,7 @@ #ifndef __KX_VERTEXPROXY #define __KX_VERTEXPROXY -#ifndef DISABLE_PYTHON +#ifdef WITH_PYTHON #include "SCA_IObject.h" @@ -102,7 +102,7 @@ public: }; -#endif // DISABLE_PYTHON +#endif // WITH_PYTHON #endif //__KX_VERTEXPROXY diff --git a/source/gameengine/Ketsji/KX_VisibilityActuator.cpp b/source/gameengine/Ketsji/KX_VisibilityActuator.cpp index e2f2badf051..464dbd14721 100644 --- a/source/gameengine/Ketsji/KX_VisibilityActuator.cpp +++ b/source/gameengine/Ketsji/KX_VisibilityActuator.cpp @@ -79,7 +79,7 @@ KX_VisibilityActuator::Update() return false; } -#ifndef DISABLE_PYTHON +#ifdef WITH_PYTHON /* ------------------------------------------------------------------------- */ /* Python functions */ @@ -121,4 +121,4 @@ PyAttributeDef KX_VisibilityActuator::Attributes[] = { { NULL } //Sentinel }; -#endif // DISABLE_PYTHON +#endif // WITH_PYTHON diff --git a/source/gameengine/Ketsji/SConscript b/source/gameengine/Ketsji/SConscript index 6f06d0ff19c..5f7cf9edcd8 100644 --- a/source/gameengine/Ketsji/SConscript +++ b/source/gameengine/Ketsji/SConscript @@ -30,8 +30,7 @@ else: if env['WITH_BF_PYTHON']: incs += ' ' + env['BF_PYTHON_INC'] -else: - defs.append('DISABLE_PYTHON') + defs.append('WITH_PYTHON') if env['WITH_BF_FFMPEG']: defs.append('WITH_FFMPEG') diff --git a/source/gameengine/Physics/Bullet/SConscript b/source/gameengine/Physics/Bullet/SConscript index 6cebe0638b0..272d0003c1a 100644 --- a/source/gameengine/Physics/Bullet/SConscript +++ b/source/gameengine/Physics/Bullet/SConscript @@ -24,8 +24,7 @@ defs = [] if env['WITH_BF_PYTHON']: incs += ' ' + env['BF_PYTHON_INC'] -else: - defs.append('DISABLE_PYTHON') + defs.append('WITH_PYTHON') if env['WITH_BF_CXX_GUARDEDALLOC']: defs.append('WITH_CXX_GUARDEDALLOC') diff --git a/source/gameengine/Rasterizer/SConscript b/source/gameengine/Rasterizer/SConscript index dc189c54a40..045714e80ac 100644 --- a/source/gameengine/Rasterizer/SConscript +++ b/source/gameengine/Rasterizer/SConscript @@ -10,8 +10,7 @@ defs = [ 'GLEW_STATIC' ] if env['WITH_BF_PYTHON']: incs += ' ' + env['BF_PYTHON_INC'] -else: - defs.append('DISABLE_PYTHON') + defs.append('WITH_PYTHON') if env['WITH_BF_CXX_GUARDEDALLOC']: defs.append('WITH_CXX_GUARDEDALLOC') diff --git a/source/gameengine/VideoTexture/CMakeLists.txt b/source/gameengine/VideoTexture/CMakeLists.txt index eb623065a75..1bde0bc8a40 100644 --- a/source/gameengine/VideoTexture/CMakeLists.txt +++ b/source/gameengine/VideoTexture/CMakeLists.txt @@ -75,8 +75,7 @@ ENDIF(WITH_FFMPEG) IF(WITH_PYTHON) LIST(APPEND INC ${PYTHON_INC}) -ELSE(WITH_PYTHON) - ADD_DEFINITIONS(-DDISABLE_PYTHON) + ADD_DEFINITIONS(-DWITH_PYTHON) ENDIF(WITH_PYTHON) BLENDERLIB(bf_videotex "${SRC}" "${INC}") diff --git a/source/gameengine/VideoTexture/SConscript b/source/gameengine/VideoTexture/SConscript index 21a5f8ce3fe..8a5e3726aa7 100644 --- a/source/gameengine/VideoTexture/SConscript +++ b/source/gameengine/VideoTexture/SConscript @@ -21,8 +21,7 @@ if env['OURPLATFORM'] in ('win32-vc', 'win64-vc','win32-mingw'): if env['WITH_BF_PYTHON']: incs += ' ' + env['BF_PYTHON_INC'] -else: - defs.append('DISABLE_PYTHON') + defs.append('WITH_PYTHON') if env['WITH_BF_FFMPEG']: defs.append('WITH_FFMPEG') |