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>2009-07-28 05:06:56 +0400
committerCampbell Barton <ideasman42@gmail.com>2009-07-28 05:06:56 +0400
commitfe881aa7ad0ba77052d0c637a5a4056f8ef427f8 (patch)
tree41bac228ce3afc29ac1aa6f601fc289cd80e155a /source/blender/makesrna/intern/rna_object_api.c
parent396ebf0c91b1527e6ea1ab923a314a164007b8e9 (diff)
- lamp UI was missing y samples for rectangle area lamps
- returned ID types from RNA funcs didnt get their ID's assigned which crashed in some cases (still not working for members of ID types). - ob.create_remder_mesh() wasnt assigning any materials.
Diffstat (limited to 'source/blender/makesrna/intern/rna_object_api.c')
-rw-r--r--source/blender/makesrna/intern/rna_object_api.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/source/blender/makesrna/intern/rna_object_api.c b/source/blender/makesrna/intern/rna_object_api.c
index 053ab115b3b..3541bc2b1b0 100644
--- a/source/blender/makesrna/intern/rna_object_api.c
+++ b/source/blender/makesrna/intern/rna_object_api.c
@@ -34,6 +34,8 @@
#ifdef RNA_RUNTIME
+#include "MEM_guardedalloc.h"
+
#include "BKE_customdata.h"
#include "BKE_DerivedMesh.h"
@@ -61,6 +63,25 @@ Mesh *rna_Object_create_render_mesh(Object *ob, Scene *scene)
DM_to_mesh(dm, me);
dm->release(dm);
+
+ { /* update the material */
+ short i, *totcol =give_totcolp(ob);
+
+ /* free the current material list */
+ if(me->mat)
+ MEM_freeN((void *)me->mat);
+
+ me->mat= (Material **)MEM_callocN(sizeof(void *)*(*totcol), "matarray");
+
+ for(i=0; i<*totcol; i++) {
+ Material *mat= give_current_material(ob, i+1);
+ if(mat) {
+ me->mat[i]= mat;
+ mat->id.us++;
+ }
+ }
+ }
+
return me;
}