From 26ef6da24b3324fb6f8ab6cfe12f101f0d7dedb4 Mon Sep 17 00:00:00 2001 From: Brecht Van Lommel Date: Mon, 13 Jul 2009 00:40:20 +0000 Subject: 2.5 * Objects now support up to 32767 material slots. It's easy to increase this further, but I prefer not to increase the memory usage of mesh faces, it seems unlikely that someone would create 32767 distinct materials? * Forward compatibility: the only thing you can potentially lose reading a 2.5 file in 2.4 is object linking (instead of default data), though usually that will go fine too. Reading files with > 32 material slots in 2.4 can start giving issues. * The ob->colbits variable is deprecated by the array ob->matbits but I didn't remove the ob->colbits updates in very few places it is set. * I hope I changed all the relevant things, various places just hardcoded the number 16 instead of using the MAXMAT define. * Join Objects operator back. This is using the version from the animsys2 branch coded by Joshua, which means it now supports joining of shape keys. * Fix for crash reading file saved during render. --- source/blender/editors/mesh/editmesh.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'source/blender/editors/mesh/editmesh.c') diff --git a/source/blender/editors/mesh/editmesh.c b/source/blender/editors/mesh/editmesh.c index cdd51a72f4f..6c66ae468fa 100644 --- a/source/blender/editors/mesh/editmesh.c +++ b/source/blender/editors/mesh/editmesh.c @@ -1132,7 +1132,7 @@ void load_editMesh(Scene *scene, Object *ob) else VECCOPY(mvert->co, eve->co); - mvert->mat_nr= 255; /* what was this for, halos? */ + mvert->mat_nr= 32767; /* what was this for, halos? */ /* vertex normal */ VECCOPY(nor, eve->no); @@ -1218,14 +1218,14 @@ void load_editMesh(Scene *scene, Object *ob) /* mat_nr in vertex */ if(me->totcol>1) { mvert= me->mvert+mface->v1; - if(mvert->mat_nr == (char)255) mvert->mat_nr= mface->mat_nr; + if(mvert->mat_nr == (char)32767) mvert->mat_nr= mface->mat_nr; mvert= me->mvert+mface->v2; - if(mvert->mat_nr == (char)255) mvert->mat_nr= mface->mat_nr; + if(mvert->mat_nr == (char)32767) mvert->mat_nr= mface->mat_nr; mvert= me->mvert+mface->v3; - if(mvert->mat_nr == (char)255) mvert->mat_nr= mface->mat_nr; + if(mvert->mat_nr == (char)32767) mvert->mat_nr= mface->mat_nr; if(mface->v4) { mvert= me->mvert+mface->v4; - if(mvert->mat_nr == (char)255) mvert->mat_nr= mface->mat_nr; + if(mvert->mat_nr == (char)32767) mvert->mat_nr= mface->mat_nr; } } @@ -1669,8 +1669,8 @@ typedef struct EditEdgeC typedef struct EditFaceC { int v1, v2, v3, v4; - unsigned char mat_nr, flag, f, h, fgonf; - short pad1; + unsigned char flag, f, h, fgonf, pad1; + short mat_nr; } EditFaceC; typedef struct EditSelectionC{ -- cgit v1.2.3