diff options
author | Willian Padovani Germano <wpgermano@gmail.com> | 2008-02-11 00:12:44 +0300 |
---|---|---|
committer | Willian Padovani Germano <wpgermano@gmail.com> | 2008-02-11 00:12:44 +0300 |
commit | 9615532ccb8290492bf076cdc7ad7a6ecb9d9311 (patch) | |
tree | 9cc147a4d455cc3730f927c84ff0df5f5dbb42d6 | |
parent | a7702e3d946db1c2f01e116a04710ecf3ba32847 (diff) |
== Pynodes ==
1) Trying to bring back compatibility with Python2.3.
2) Adding some stubs to compile blender player again on linux.
Please tell me if Blender still doesn't compile with py 2.3 or if the player isn't compiling. There was a binreloc related stub I needed to add, so probably the player wasn't compiling before the pynodes commit.
Thanks PanzerMKZ for reporting and testing part of the fix to py 2.3.
-rw-r--r-- | source/blender/blenkernel/BKE_bad_level_calls.h | 21 | ||||
-rw-r--r-- | source/blender/blenkernel/BKE_node.h | 1 | ||||
-rw-r--r-- | source/blender/blenkernel/bad_level_call_stubs/stubs.c | 22 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/node.c | 8 | ||||
-rw-r--r-- | source/blender/nodes/intern/SHD_nodes/SHD_dynamic.c | 3 | ||||
-rw-r--r-- | source/blender/python/api2_2x/Node.c | 10 | ||||
-rw-r--r-- | source/blender/python/api2_2x/Node.h | 1 |
7 files changed, 51 insertions, 15 deletions
diff --git a/source/blender/blenkernel/BKE_bad_level_calls.h b/source/blender/blenkernel/BKE_bad_level_calls.h index 94eafbf9f71..ca1ac00a33f 100644 --- a/source/blender/blenkernel/BKE_bad_level_calls.h +++ b/source/blender/blenkernel/BKE_bad_level_calls.h @@ -63,6 +63,12 @@ struct Script; struct Text; struct IpoDriver; /* DNA_curve_types.h */ struct Object; +struct PyObject; +struct Node_Type; +struct BPy_Node; +struct bNode; +struct bNodeStack; +struct ShadeInput; struct bPythonConstraint; struct bConstraintOb; struct bConstraintTarget; @@ -78,8 +84,14 @@ int BPY_button_eval(char *expr, double *value); /* pyconstraints */ void BPY_pyconstraint_eval(struct bPythonConstraint *con, struct bConstraintOb *cob, struct ListBase *targets); void BPY_pyconstraint_targets(struct bPythonConstraint *con, struct bConstraintTarget *ct); - - +/* pynodes */ +int EXPP_dict_set_item_str(struct PyObject *dict, char *key, struct PyObject *value); +void Node_SetStack(struct BPy_Node *self, struct bNodeStack **stack, int type); +void InitNode(struct BPy_Node *self, struct bNode *node); +void InitNode(struct BPy_Node *self, struct bNode *node); +void Node_SetShi(struct BPy_Node *self, struct ShadeInput *shi); +struct BPy_NodeSockets *Node_CreateSockets(struct bNode *node); +int pytype_is_pynode(struct PyObject *pyob); /* writefile.c */ struct Oops; void free_oops(struct Oops *oops); @@ -226,5 +238,10 @@ void PE_free_particle_edit(struct ParticleSystem *psys); void PE_get_colors(char sel[4], char nosel[4]); void PE_recalc_world_cos(struct Object *ob, struct ParticleSystem *psys); +/* only for linux binreloc */ +#ifdef __linux__ +char *zLhm65070058860608_br_find_exe(const char *default_exe); +#endif + #endif diff --git a/source/blender/blenkernel/BKE_node.h b/source/blender/blenkernel/BKE_node.h index bad7f0e90be..6f6d7fa7850 100644 --- a/source/blender/blenkernel/BKE_node.h +++ b/source/blender/blenkernel/BKE_node.h @@ -367,6 +367,5 @@ void free_compbuf(struct CompBuf *cbuf); /* internal...*/ void init_nodesystem(void); void free_nodesystem(void); -void reinit_nodesystem(void); #endif diff --git a/source/blender/blenkernel/bad_level_call_stubs/stubs.c b/source/blender/blenkernel/bad_level_call_stubs/stubs.c index 1bcbed1efb1..1bec1775234 100644 --- a/source/blender/blenkernel/bad_level_call_stubs/stubs.c +++ b/source/blender/blenkernel/bad_level_call_stubs/stubs.c @@ -119,6 +119,21 @@ float BPY_pydriver_eval(struct IpoDriver *driver) { return 0; } +int EXPP_dict_set_item_str(struct PyObject *dict, char *key, struct PyObject *value) +{ + return 0; +} +void Node_SetStack(struct BPy_Node *self, struct bNodeStack **stack, int type){} +void InitNode(struct BPy_Node *self, struct bNode *node){} +void Node_SetShi(struct BPy_Node *self, struct ShadeInput *shi){} +struct BPy_NodeSockets *Node_CreateSockets(struct bNode *node) +{ + return 0; +} +int pytype_is_pynode(struct PyObject *pyob) +{ + return 0; +} /* depsgraph.c: */ struct Object **BPY_pydriver_get_objects(struct IpoDriver *driver) { @@ -337,3 +352,10 @@ void PE_free_particle_edit(struct ParticleSystem *psys) {} void PE_get_colors(char sel[4], char nosel[4]) {} void PE_recalc_world_cos(struct Object *ob, struct ParticleSystem *psys) {} +/* binreloc */ +#ifdef __linux__ +char *zLhm65070058860608_br_find_exe(const char *default_exe) +{ + return 0; +} +#endif diff --git a/source/blender/blenkernel/intern/node.c b/source/blender/blenkernel/intern/node.c index f30ad81bf0c..e888338bc9b 100644 --- a/source/blender/blenkernel/intern/node.c +++ b/source/blender/blenkernel/intern/node.c @@ -893,7 +893,6 @@ void nodeMakeDynamicType(bNode *node) } } - void nodeUpdateType(bNodeTree *ntree, bNode* node, bNodeType *ntype) { verify_socket_list(ntree, &node->inputs, ntype->inputs); @@ -2576,10 +2575,3 @@ void free_nodesystem(void) remove_dynamic_typeinfos(&node_all_shaders); BLI_freelistN(&node_all_shaders); } - -void reinit_nodesystem(void) -{ - /*remove_dynamic_typeinfos(&node_all_composit);*/ /* unused for now */ - /*remove_dynamic_typeinfos(&node_all_shaders);*//*crash on undo/redo*/ -} - diff --git a/source/blender/nodes/intern/SHD_nodes/SHD_dynamic.c b/source/blender/nodes/intern/SHD_nodes/SHD_dynamic.c index 3b9ef5ceb55..4c4044f6bce 100644 --- a/source/blender/nodes/intern/SHD_nodes/SHD_dynamic.c +++ b/source/blender/nodes/intern/SHD_nodes/SHD_dynamic.c @@ -28,6 +28,7 @@ */ #include <Python.h> +#include <compile.h> #include <eval.h> #include "DNA_text_types.h" @@ -352,7 +353,7 @@ static int node_dynamic_parse(struct bNode *node) Py_DECREF(sockets); Py_DECREF(args); - if (!PyErr_Occurred() && pynode && PyObject_TypeCheck(pynode, &Node_Type)==1) { + if (!PyErr_Occurred() && pynode && pytype_is_pynode(pynode)) { InitNode((BPy_Node *)(pynode), node); nsd->node = pynode; node->typeinfo->execfunc = node_dynamic_exec_cb; diff --git a/source/blender/python/api2_2x/Node.c b/source/blender/python/api2_2x/Node.c index d336cfecde7..0a68509d287 100644 --- a/source/blender/python/api2_2x/Node.c +++ b/source/blender/python/api2_2x/Node.c @@ -535,7 +535,7 @@ static int sockoutmap_has_key( BPy_SockMap *self, PyObject *key) { static int sockoutmap_assign_subscript(BPy_SockMap *self, PyObject *pyidx, PyObject *value) { int i, idx, len, wanted_len = 0, ret = -1; PyObject *val; - PyObject **items; + PyObject *items[4]; if (!self->node) return EXPP_ReturnIntError(PyExc_RuntimeError, "no access to Blender node data!"); @@ -567,9 +567,8 @@ static int sockoutmap_assign_subscript(BPy_SockMap *self, PyObject *pyidx, PyObj return EXPP_ReturnIntError(PyExc_AttributeError, "expected a non-empty numeric tuple or list"); } - items = PySequence_Fast_ITEMS(val); - for (i = 0; i < len; i++) { + items[i] = PySequence_Fast_GET_ITEM(val, i); /* borrowed */ if (!PyNumber_Check(items[i])) { Py_DECREF(val); return EXPP_ReturnIntError(PyExc_AttributeError, "expected a *numeric* tuple or list"); @@ -1208,6 +1207,11 @@ BPy_Node *Node_CreatePyObject(bNode *node) return pynode; } +int pytype_is_pynode(PyObject *pyob) +{ + return PyObject_TypeCheck(pyob, &Node_Type); +} + void InitNode(BPy_Node *self, bNode *node) { self->node = node; } diff --git a/source/blender/python/api2_2x/Node.h b/source/blender/python/api2_2x/Node.h index 04b54f86872..e229e678fe9 100644 --- a/source/blender/python/api2_2x/Node.h +++ b/source/blender/python/api2_2x/Node.h @@ -80,6 +80,7 @@ extern BPy_Node *Node_CreatePyObject(bNode *node); extern BPy_NodeSockets *Node_CreateSockets(bNode *node); extern void Node_SetStack(BPy_Node *self, bNodeStack **stack, int type); extern void Node_SetShi(BPy_Node *self, ShadeInput *shi); +extern int pytype_is_pynode(PyObject *pyob); #define NODE_INPUTSTACK 0 #define NODE_OUTPUTSTACK 1 |