== 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.
This commit is contained in:
Willian Padovani Germano 2008-02-10 21:12:44 +00:00
parent a7702e3d94
commit 9615532ccb
7 changed files with 51 additions and 15 deletions

@ -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

@ -367,6 +367,5 @@ void free_compbuf(struct CompBuf *cbuf); /* internal...*/
void init_nodesystem(void);
void free_nodesystem(void);
void reinit_nodesystem(void);
#endif

@ -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

@ -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*/
}

@ -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;

@ -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;
}

@ -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