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>2012-09-14 10:17:14 +0400
committerCampbell Barton <ideasman42@gmail.com>2012-09-14 10:17:14 +0400
commit7a71f58af3b5f70e8982d827d1fef7e8bc4e4ec8 (patch)
treeae5ee3e8c3a1d029e54531bbfd5ac8db42d9f7d9 /source/blender/editors/mesh
parent3957efdd38d0d5136f8d106de3a79e07b7b0b15f (diff)
fixes for NULL checks, remove some redundant checks and add some in that have been removed by accident as code has been updated.
Diffstat (limited to 'source/blender/editors/mesh')
-rw-r--r--source/blender/editors/mesh/meshtools.c18
1 files changed, 10 insertions, 8 deletions
diff --git a/source/blender/editors/mesh/meshtools.c b/source/blender/editors/mesh/meshtools.c
index 06dcac0505a..a7467ee4c79 100644
--- a/source/blender/editors/mesh/meshtools.c
+++ b/source/blender/editors/mesh/meshtools.c
@@ -442,18 +442,20 @@ int join_mesh_exec(bContext *C, wmOperator *op)
}
if (me->totpoly) {
- /* make mapping for materials */
- for (a = 1; a <= base->object->totcol; a++) {
- ma = give_current_material(base->object, a);
+ if (totmat) {
+ /* make mapping for materials */
+ for (a = 1; a <= base->object->totcol; a++) {
+ ma = give_current_material(base->object, a);
- for (b = 0; b < totcol; b++) {
- if (ma == matar[b]) {
- matmap[a - 1] = b;
- break;
+ for (b = 0; b < totcol; b++) {
+ if (ma == matar[b]) {
+ matmap[a - 1] = b;
+ break;
+ }
}
}
}
-
+
CustomData_merge(&me->pdata, &pdata, CD_MASK_MESH, CD_DEFAULT, totpoly);
CustomData_copy_data(&me->pdata, &pdata, 0, polyofs, me->totpoly);