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:
authorTamito Kajiyama <rd6t-kjym@asahi-net.or.jp>2011-10-19 03:36:43 +0400
committerTamito Kajiyama <rd6t-kjym@asahi-net.or.jp>2011-10-19 03:36:43 +0400
commitb4e7451cb0547ede96922ae97ee440f17e452332 (patch)
tree1a7611802576089e5c47a4062d386156499d63ce /source/blender/makesrna/intern/rna_ID.c
parentb53505f5e11771b2e500fb9f812a4cd649a5d715 (diff)
parentdc907ef876b128c9767394d00dfc719d55ba077e (diff)
Merged changes in the trunk up to revision 41099.
Diffstat (limited to 'source/blender/makesrna/intern/rna_ID.c')
-rw-r--r--source/blender/makesrna/intern/rna_ID.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/source/blender/makesrna/intern/rna_ID.c b/source/blender/makesrna/intern/rna_ID.c
index cb1137fbe57..420fe319d08 100644
--- a/source/blender/makesrna/intern/rna_ID.c
+++ b/source/blender/makesrna/intern/rna_ID.c
@@ -320,9 +320,15 @@ static int rna_IDPArray_length(PointerRNA *ptr)
int rna_IDMaterials_assign_int(PointerRNA *ptr, int key, const PointerRNA *assign_ptr)
{
ID *id= ptr->id.data;
+ short *totcol= give_totcolp_id(id);
Material *mat_id= assign_ptr->id.data;
- assign_material_id(id, mat_id, key + 1);
- return 1;
+ if(totcol && (key >= 0 && key < *totcol)) {
+ assign_material_id(id, mat_id, key + 1);
+ return 1;
+ }
+ else {
+ return 0;
+ }
}
#else