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
path: root/source
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2009-10-07 19:16:08 +0400
committerCampbell Barton <ideasman42@gmail.com>2009-10-07 19:16:08 +0400
commit93b5375ca17a44fbe225f7af135dc0d647d32dd4 (patch)
tree8532a6a0264c281c003f2499f99e84698667e627 /source
parentcf4f00b2fa6dfecc400519a635c41798bf45ca88 (diff)
Making new faces (fkey, scanfill etc) didnt create faces with the active material.
Keep the editmesh material and active material in sync
Diffstat (limited to 'source')
-rw-r--r--source/blender/editors/mesh/editmesh.c2
-rw-r--r--source/blender/makesrna/intern/rna_object.c9
2 files changed, 11 insertions, 0 deletions
diff --git a/source/blender/editors/mesh/editmesh.c b/source/blender/editors/mesh/editmesh.c
index 980d699dda5..d540151337d 100644
--- a/source/blender/editors/mesh/editmesh.c
+++ b/source/blender/editors/mesh/editmesh.c
@@ -986,6 +986,8 @@ void load_editMesh(Scene *scene, Object *ob)
CustomData_add_layer(&me->fdata, CD_MFACE, CD_ASSIGN, mface, me->totface);
mesh_update_customdata_pointers(me);
+ em->mat_nr= ob->actcol-1;
+
/* the vertices, use ->tmp.l as counter */
eve= em->verts.first;
a= 0;
diff --git a/source/blender/makesrna/intern/rna_object.c b/source/blender/makesrna/intern/rna_object.c
index 3a3842adbf1..4fb2db42b8b 100644
--- a/source/blender/makesrna/intern/rna_object.c
+++ b/source/blender/makesrna/intern/rna_object.c
@@ -99,6 +99,8 @@ EnumPropertyItem object_type_items[] = {
#include "BKE_particle.h"
#include "BKE_scene.h"
+#include "BLI_editVert.h" /* for EditMesh->mat_nr */
+
#include "ED_object.h"
void rna_Object_update(bContext *C, PointerRNA *ptr)
@@ -404,6 +406,13 @@ static void rna_Object_active_material_index_set(PointerRNA *ptr, int value)
{
Object *ob= (Object*)ptr->id.data;
ob->actcol= value+1;
+
+ if(ob->mode==OB_MODE_EDIT && ob->type==OB_MESH) {
+ Mesh *me= ob->data;
+
+ if(me->edit_mesh)
+ me->edit_mesh->mat_nr= value;
+ }
}
static void rna_Object_active_material_index_range(PointerRNA *ptr, int *min, int *max)