Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Want <cwant@ualberta.ca>2006-01-28 19:35:18 +0300
committerChris Want <cwant@ualberta.ca>2006-01-28 19:35:18 +0300
commitc8b48e70e626a351dc3d02122ea413d0046e98b7 (patch)
tree0b4777ce258d751f501ec7ce16c129f01f3d3307 /source/blender/python/api2_2x/Armature.c
parent45c7b2c5c2bc20296a581e1b6a1cb3908f11732f (diff)
parentdb5f7bd8da580d05c31f6fa65bfea8042deac10e (diff)
Final merge of HEAD (bf-blender) into the orange branch.
Here are my notes on things to look out for as potential problem spots: source/blender/blenkernel/intern/displist.c: + is initfastshade(void) supposed to be empty? I had to make it empty to get the merged tree to compile. source/blender/python/api2_2x/Armature.c: + went with the version that had Armature_getLayers() source/blender/python/api2_2x/Object.c + went with the version of Object_getPose() from bf-blender. (#ifdef 0-ed the other version) source/blender/python/api2_2x/Pose.[ch] + had problems linking due to no Pose_Init() ... copied these two files straight from bf-blender. source/blender/src/drawview.c: + view3d_panel_properties() had things shifted a few things shifted a few pixels, otherwise, things were painless source/blender/src/splash.jpg.c: + went with bf-blender version (orange is dead) source/gameengine: + went with bf-blender version -- does not compile due to IMB_rect* stuff, Ton should look into this.
Diffstat (limited to 'source/blender/python/api2_2x/Armature.c')
-rw-r--r--source/blender/python/api2_2x/Armature.c25
1 files changed, 17 insertions, 8 deletions
diff --git a/source/blender/python/api2_2x/Armature.c b/source/blender/python/api2_2x/Armature.c
index 743956a1f61..28ae3eadcc7 100644
--- a/source/blender/python/api2_2x/Armature.c
+++ b/source/blender/python/api2_2x/Armature.c
@@ -44,8 +44,7 @@
#include "DNA_object_types.h" //This must come before BIF_editarmature.h...
#include "BIF_editarmature.h"
-//------------------UNDECLARED EXTERNAL PROTOTYPES--------------------
-//These are evil 'extern' declarations for functions with no anywhere
+//------------------EXTERNAL PROTOTYPES--------------------
extern void free_editArmature(void);
extern void make_boneList(ListBase* list, ListBase *bones, EditBone *parent);
extern void editbones_to_armature (ListBase *list, Object *ob);
@@ -112,7 +111,7 @@ static PyMethodDef BPy_BonesDict_methods[] = {
"() - Returns the keys the dictionary"},
{"values", (PyCFunction) BonesDict_values, METH_NOARGS,
"() - Returns the values from the dictionary"},
- {NULL}
+ {NULL, NULL, 0, NULL}
};
//-----------------(internal)
static int BoneMapping_Init(PyObject *dictionary, ListBase *bones){
@@ -225,8 +224,18 @@ PyObject *BonesDict_GetItem(BPy_BonesDict *self, PyObject* key)
}else{
value = PyDict_GetItem(self->bonesMap, key);
}
- if(value == NULL){
- return EXPP_incr_ret(Py_None);
+ if(value == NULL){ /* item not found in dict. throw exception */
+ char buffer[128];
+ char* key_str;
+ key_str = PyString_AsString( key );
+ if( !key_str ){ /* key not a py string */
+ key_str = ""; /* use empty string for printing */
+ }
+
+ PyOS_snprintf( buffer, sizeof(buffer),
+ "bone %s not found", key_str);
+
+ return EXPP_ReturnPyObjError(PyExc_KeyError, buffer );
}
return EXPP_incr_ret(value);
}
@@ -335,7 +344,7 @@ AttributeError3:
return EXPP_intError(PyExc_AttributeError, "%s%s",
sBoneDictBadArgs, "The 'connected' flag is set but the bone has no parent!");
}
-//------------------TYPE_OBECT DEFINITION--------------------------
+//------------------TYPE_OBJECT DEFINITION--------------------------
//Mapping Protocol
static PyMappingMethods BonesDict_MapMethods = {
(inquiry) BonesDict_len, //mp_length
@@ -929,7 +938,7 @@ static PyMethodDef BPy_Armature_methods[] = {
"() - Unlocks the ability to modify armature bones"},
{"update", (PyCFunction) Armature_update, METH_NOARGS,
"() - Rebuilds the armature based on changes to bones since the last call to makeEditable"},
- {NULL}
+ {NULL, NULL, 0, NULL}
};
//------------------------tp_getset
//This contains methods for attributes that require checking
@@ -1218,7 +1227,7 @@ static char M_Armature_Get_doc[] = "(name) - return the armature with the name '
struct PyMethodDef M_Armature_methods[] = {
{"Get", M_Armature_Get, METH_VARARGS, M_Armature_Get_doc},
- {NULL}
+ {NULL, NULL, 0, NULL}
};
//------------------VISIBLE PROTOTYPE IMPLEMENTATION-----------------------
//-----------------(internal)