support for compiling blender without python working again (with cmake at least)

This commit is contained in:
Campbell Barton 2010-01-23 20:43:55 +00:00
parent 9d96399eeb
commit 22f7c8b1cd
4 changed files with 19 additions and 4 deletions

@ -46,7 +46,9 @@
#include "BKE_screen.h" #include "BKE_screen.h"
#include "BKE_global.h" #include "BKE_global.h"
#ifndef DISABLE_PYTHON
#include "BPY_extern.h" #include "BPY_extern.h"
#endif
#include <string.h> #include <string.h>
@ -413,13 +415,13 @@ static int ctx_data_get(bContext *C, const char *member, bContextDataResult *res
int ret= 0; int ret= 0;
memset(result, 0, sizeof(bContextDataResult)); memset(result, 0, sizeof(bContextDataResult));
#ifndef DISABLE_PYTHON
if(CTX_py_dict_get(C)) { if(CTX_py_dict_get(C)) {
return BPY_context_get(C, member, result); return BPY_context_get(C, member, result);
// if (BPY_context_get(C, member, result)) // if (BPY_context_get(C, member, result))
// return 1; // return 1;
} }
#endif
/* we check recursion to ensure that we do not get infinite /* we check recursion to ensure that we do not get infinite
* loops requesting data from ourselfs in a context callback */ * loops requesting data from ourselfs in a context callback */

@ -42,6 +42,12 @@ SET(SRC
INCLUDE_DIRECTORIES(../../../../intern/guardedalloc .. ../../makesdna ../../blenkernel ../../blenlib ../../ikplugin ../../windowmanager ../../editors/include ../../imbuf ../../render/extern/include .) INCLUDE_DIRECTORIES(../../../../intern/guardedalloc .. ../../makesdna ../../blenkernel ../../blenlib ../../ikplugin ../../windowmanager ../../editors/include ../../imbuf ../../render/extern/include .)
FILE(GLOB INC_FILES ../*.h ../../makesdna/*.h) FILE(GLOB INC_FILES ../*.h ../../makesdna/*.h)
IF(WITH_PYTHON)
ELSE(WITH_PYTHON)
ADD_DEFINITIONS(-DDISABLE_PYTHON)
ENDIF(WITH_PYTHON)
IF(WIN32) IF(WIN32)
SET(INC ${INC} ${PTHREADS_INC}) SET(INC ${INC} ${PTHREADS_INC})
ENDIF(WIN32) ENDIF(WIN32)

@ -698,6 +698,7 @@ static void operator_draw(bContext *C, wmOperator *op)
RNA_parameter_list_free(&list); RNA_parameter_list_free(&list);
} }
#ifndef DISABLE_PYTHON
void operator_wrapper(wmOperatorType *ot, void *userdata); void operator_wrapper(wmOperatorType *ot, void *userdata);
void macro_wrapper(wmOperatorType *ot, void *userdata); void macro_wrapper(wmOperatorType *ot, void *userdata);
@ -836,6 +837,7 @@ static StructRNA *rna_MacroOperator_register(const bContext *C, ReportList *repo
return dummyot.ext.srna; return dummyot.ext.srna;
} }
#endif
static StructRNA* rna_Operator_refine(PointerRNA *opr) static StructRNA* rna_Operator_refine(PointerRNA *opr)
{ {
@ -860,7 +862,9 @@ 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_ui_text(srna, "Operator", "Storage of an operator being executed, or registered after execution.");
RNA_def_struct_sdna(srna, "wmOperator"); RNA_def_struct_sdna(srna, "wmOperator");
RNA_def_struct_refine_func(srna, "rna_Operator_refine"); RNA_def_struct_refine_func(srna, "rna_Operator_refine");
#ifndef DISABLE_PYTHON
RNA_def_struct_register_funcs(srna, "rna_Operator_register", "rna_Operator_unregister"); RNA_def_struct_register_funcs(srna, "rna_Operator_register", "rna_Operator_unregister");
#endif
prop= RNA_def_property(srna, "name", PROP_STRING, PROP_NONE); prop= RNA_def_property(srna, "name", PROP_STRING, PROP_NONE);
RNA_def_property_clear_flag(prop, PROP_EDITABLE); RNA_def_property_clear_flag(prop, PROP_EDITABLE);
@ -918,8 +922,10 @@ 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_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_sdna(srna, "wmOperator");
RNA_def_struct_refine_func(srna, "rna_MacroOperator_refine"); RNA_def_struct_refine_func(srna, "rna_MacroOperator_refine");
#ifndef DISABLE_PYTHON
RNA_def_struct_register_funcs(srna, "rna_MacroOperator_register", "rna_Operator_unregister"); RNA_def_struct_register_funcs(srna, "rna_MacroOperator_register", "rna_Operator_unregister");
#endif
prop= RNA_def_property(srna, "name", PROP_STRING, PROP_NONE); prop= RNA_def_property(srna, "name", PROP_STRING, PROP_NONE);
RNA_def_property_clear_flag(prop, PROP_EDITABLE); RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_string_funcs(prop, "rna_Operator_name_get", "rna_Operator_name_length", NULL); RNA_def_property_string_funcs(prop, "rna_Operator_name_get", "rna_Operator_name_length", NULL);

@ -284,9 +284,10 @@ void WM_read_file(bContext *C, char *name, ReportList *reports)
// refresh_interface_font(); // refresh_interface_font();
CTX_wm_window_set(C, NULL); /* exits queues */ CTX_wm_window_set(C, NULL); /* exits queues */
#ifndef DISABLE_PYTHON
/* run any texts that were loaded in and flagged as modules */ /* run any texts that were loaded in and flagged as modules */
BPY_load_user_modules(C); BPY_load_user_modules(C);
#endif
} }
else if(retval==1) else if(retval==1)
BKE_write_undo(C, "Import file"); BKE_write_undo(C, "Import file");