diff options
author | Campbell Barton <ideasman42@gmail.com> | 2007-04-25 04:37:19 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2007-04-25 04:37:19 +0400 |
commit | 0c7e145dcedaf3e22abaead61c1b1cb431a7da0a (patch) | |
tree | e5a63e7207912ba5e03b124834e52c4e7b2239f2 /source/blender/python/api2_2x/gen_library.c | |
parent | 77f08ddc12870b90064273fa314d462ccdd473ba (diff) |
Object.c - made object action writable
gen_library - fixed bug, wasnt adjusting user counts properly.
bpy_data.c - added default new names for new data
Diffstat (limited to 'source/blender/python/api2_2x/gen_library.c')
-rw-r--r-- | source/blender/python/api2_2x/gen_library.c | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/source/blender/python/api2_2x/gen_library.c b/source/blender/python/api2_2x/gen_library.c index a637bb509b4..1e9470f8dcf 100644 --- a/source/blender/python/api2_2x/gen_library.c +++ b/source/blender/python/api2_2x/gen_library.c @@ -181,7 +181,7 @@ short GenericLib_getType(PyObject * pydata) //~ if (BPy_Sound_Check(pydata)) return ID_SO; if (BPy_Group_Check(pydata)) return ID_GR; //~ if (BPy_Armature_Check(pydata)) return ID_AR; - //~ if (BPy_Action_Check(pydata)) return ID_AC; + if (BPy_Action_Check(pydata)) return ID_AC; return -1; } @@ -211,14 +211,17 @@ short GenericLib_getType(PyObject * pydata) */ int GenericLib_assignData(PyObject *value, void **data, void **ndata, short refcount, short type, short subtype) { - ID *id=NULL; + ID *id= NULL; - if (*data && ndata && *data == *ndata) { - return EXPP_ReturnIntError( PyExc_TypeError, - "Cannot set this data to its self" ); - + if (*data) { id = ((ID*)*data); + + if (ndata && *data == *ndata) { + return EXPP_ReturnIntError( PyExc_TypeError, + "Cannot set this data to its self" ); + } } + if (value == Py_None) { *data = NULL; if (refcount && id) id->us--; |