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:
authorCampbell Barton <ideasman42@gmail.com>2011-01-05 17:49:08 +0300
committerCampbell Barton <ideasman42@gmail.com>2011-01-05 17:49:08 +0300
commit978bc0d8ace0ea10339afb25b50ef396e9cc1c8d (patch)
tree439e1df1c4af7367eda88f326416cd622043e703 /source/blender/makesrna/intern/rna_pose.c
parent26024445ac8a4af76d6399fbb896772d26a65ddf (diff)
fix for py/rna mesh.materials[:] where empty materials exist, would raise a runtime exception.
problem was there was no way to tell the difference between getting an empty item from a collection or the item not being found.
Diffstat (limited to 'source/blender/makesrna/intern/rna_pose.c')
-rw-r--r--source/blender/makesrna/intern/rna_pose.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/source/blender/makesrna/intern/rna_pose.c b/source/blender/makesrna/intern/rna_pose.c
index 51a44c027e4..7b1a46dd6e2 100644
--- a/source/blender/makesrna/intern/rna_pose.c
+++ b/source/blender/makesrna/intern/rna_pose.c
@@ -547,13 +547,17 @@ static int rna_PoseChannel_rotation_4d_editable(PointerRNA *ptr, int index)
}
/* not essential, but much faster then the default lookup function */
-PointerRNA rna_PoseBones_lookup_string(PointerRNA *ptr, const char *key)
+int rna_PoseBones_lookup_string(PointerRNA *ptr, const char *key, PointerRNA *r_ptr)
{
- PointerRNA rptr;
bPose *pose= (bPose*)ptr->data;
bPoseChannel *pchan= get_pose_channel(pose, key);
- RNA_pointer_create(ptr->id.data, &RNA_PoseBone, pchan, &rptr);
- return rptr;
+ if(pchan) {
+ RNA_pointer_create(ptr->id.data, &RNA_PoseBone, pchan, r_ptr);
+ return TRUE;
+ }
+ else {
+ return FALSE;
+ }
}
static void rna_PoseChannel_matrix_basis_get(PointerRNA *ptr, float *values)