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:
authorDalai Felinto <dfelinto@gmail.com>2011-07-31 15:12:38 +0400
committerDalai Felinto <dfelinto@gmail.com>2011-07-31 15:12:38 +0400
commit432bd158fbdb9d56f9499dcc0e465f4e148abbf3 (patch)
tree3147ff78468de6abea93493eff1fc320b0c65ef3 /source/blender/blenkernel/intern/mesh.c
parentf4a1dc4c8dd353aa614bc7c00846e5076ddc2dc2 (diff)
bugfix [#28111] material.pop breaks mt->mat_nr
create a new parameter for materials.pop() to not remove material slot. this way the mat_nr is still the old one. for the default behaviour we now have material remapping (i.e. data_delete_material_index_id(id, index)). This new function is brought from the material_slot remove function.
Diffstat (limited to 'source/blender/blenkernel/intern/mesh.c')
-rw-r--r--source/blender/blenkernel/intern/mesh.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/source/blender/blenkernel/intern/mesh.c b/source/blender/blenkernel/intern/mesh.c
index 45a60b842a7..32819226361 100644
--- a/source/blender/blenkernel/intern/mesh.c
+++ b/source/blender/blenkernel/intern/mesh.c
@@ -1254,10 +1254,10 @@ void mesh_to_curve(Scene *scene, Object *ob)
void mesh_delete_material_index(Mesh *me, int index)
{
+ MFace *mf;
int i;
- for (i=0; i<me->totface; i++) {
- MFace *mf = &((MFace*) me->mface)[i];
+ for (i=0, mf=me->mface; i<me->totface; i++, mf++) {
if (mf->mat_nr && mf->mat_nr>=index)
mf->mat_nr--;
}