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 /source/blender/editors | |
parent | 50dab4fc37d33352c2f1c6181da9d54799e36a12 (diff) |
rename and negate DISABLE_PYTHON --> WITH_PYTHON
Diffstat (limited to 'source/blender/editors')
20 files changed, 43 insertions, 45 deletions
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) |