rename and negate DISABLE_PYTHON --> WITH_PYTHON
This commit is contained in:
@@ -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)
|
||||
|
||||
@@ -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})
|
||||
|
||||
@@ -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']
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
#ifndef AUD_PYINIT
|
||||
#define AUD_PYINIT
|
||||
|
||||
#ifndef DISABLE_PYTHON
|
||||
#ifdef WITH_PYTHON
|
||||
#include "Python.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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')
|
||||
|
||||
|
||||
@@ -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 = {
|
||||
|
||||
@@ -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))
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
@@ -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 = {
|
||||
|
||||
@@ -27,7 +27,7 @@
|
||||
* ***** END GPL LICENSE BLOCK *****
|
||||
*/
|
||||
|
||||
#ifndef DISABLE_PYTHON
|
||||
#ifdef WITH_PYTHON
|
||||
#include <Python.h>
|
||||
#endif
|
||||
|
||||
|
||||
@@ -96,7 +96,7 @@
|
||||
|
||||
#include "LBM_fluidsim.h"
|
||||
|
||||
#ifndef DISABLE_PYTHON
|
||||
#ifdef WITH_PYTHON
|
||||
#include "BPY_extern.h"
|
||||
#endif
|
||||
|
||||
|
||||
@@ -36,7 +36,7 @@
|
||||
|
||||
/*
|
||||
|
||||
#ifndef DISABLE_PYTHON
|
||||
#ifdef WITH_PYTHON
|
||||
#include "BPY_extern.h" // Blender Python library
|
||||
#endif
|
||||
*/
|
||||
|
||||
@@ -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
|
||||
}
|
||||
|
||||
@@ -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}")
|
||||
|
||||
@@ -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] )
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -52,7 +52,7 @@
|
||||
#include "BIF_gl.h"
|
||||
|
||||
|
||||
#ifndef DISABLE_PYTHON
|
||||
#ifdef WITH_PYTHON
|
||||
//#include "BPY_extern.h"
|
||||
//#include "BPY_menus.h"
|
||||
#endif
|
||||
|
||||
@@ -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}")
|
||||
|
||||
@@ -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] )
|
||||
|
||||
@@ -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 */
|
||||
|
||||
@@ -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}")
|
||||
|
||||
@@ -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] )
|
||||
|
||||
@@ -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);
|
||||
|
||||
|
||||
@@ -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}")
|
||||
|
||||
@@ -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] )
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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}")
|
||||
|
||||
@@ -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] )
|
||||
|
||||
@@ -57,7 +57,7 @@
|
||||
|
||||
|
||||
|
||||
#ifndef DISABLE_PYTHON
|
||||
#ifdef WITH_PYTHON
|
||||
// XXX #include "BPY_menus.h"
|
||||
#endif
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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)) {
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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'
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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'
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -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}")
|
||||
|
||||
@@ -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'
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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')
|
||||
|
||||
@@ -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 */
|
||||
|
||||
@@ -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()");
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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')
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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}")
|
||||
|
||||
@@ -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')
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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:
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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 */
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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:
|
||||
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -906,7 +906,7 @@ void KX_BlenderSceneConverter::TestHandlesPhysicsObjectToAnimationIpo()
|
||||
|
||||
}
|
||||
|
||||
#ifndef DISABLE_PYTHON
|
||||
#ifdef WITH_PYTHON
|
||||
PyObject *KX_BlenderSceneConverter::GetPyNamespace()
|
||||
{
|
||||
return m_ketsjiEngine->GetPyNamespace();
|
||||
|
||||
@@ -174,7 +174,7 @@ public:
|
||||
|
||||
|
||||
|
||||
#ifndef DISABLE_PYTHON
|
||||
#ifdef WITH_PYTHON
|
||||
PyObject *GetPyNamespace();
|
||||
#endif
|
||||
|
||||
|
||||
@@ -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();
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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')
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -45,7 +45,7 @@ public:
|
||||
|
||||
void Configure(CValue* menuvalue);
|
||||
virtual CValue* GetReplica();
|
||||
#ifndef DISABLE_PYTHON
|
||||
#ifdef WITH_PYTHON
|
||||
virtual PyObject* ConvertValueToPython();
|
||||
#endif
|
||||
|
||||
|
||||
@@ -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}")
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -48,7 +48,7 @@ public:
|
||||
void AddConfigurationData(CValue* menuvalue);
|
||||
virtual CValue* GetReplica();
|
||||
|
||||
#ifndef DISABLE_PYTHON
|
||||
#ifdef WITH_PYTHON
|
||||
virtual PyObject* ConvertValueToPython();
|
||||
#endif
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -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')
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -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}")
|
||||
|
||||
@@ -96,7 +96,7 @@ void SCA_2DFilterActuator::SetShaderText(const char *text)
|
||||
m_shaderText = text;
|
||||
}
|
||||
|
||||
#ifndef DISABLE_PYTHON
|
||||
#ifdef WITH_PYTHON
|
||||
|
||||
/* ------------------------------------------------------------------------- */
|
||||
/* Python functions */
|
||||
|
||||
@@ -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 */
|
||||
|
||||
@@ -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 */
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -94,7 +94,7 @@ bool SCA_AlwaysSensor::Evaluate()
|
||||
return result;
|
||||
}
|
||||
|
||||
#ifndef DISABLE_PYTHON
|
||||
#ifdef WITH_PYTHON
|
||||
|
||||
/* ------------------------------------------------------------------------- */
|
||||
/* Python functions */
|
||||
|
||||
@@ -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 */
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
};
|
||||
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user