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/nodes/intern/SHD_nodes | |
parent | 50dab4fc37d33352c2f1c6181da9d54799e36a12 (diff) |
rename and negate DISABLE_PYTHON --> WITH_PYTHON
Diffstat (limited to 'source/blender/nodes/intern/SHD_nodes')
-rw-r--r-- | source/blender/nodes/intern/SHD_nodes/SHD_dynamic.c | 32 |
1 files changed, 16 insertions, 16 deletions
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; |