diff options
author | Ton Roosendaal <ton@blender.org> | 2003-07-11 16:45:04 +0400 |
---|---|---|
committer | Ton Roosendaal <ton@blender.org> | 2003-07-11 16:45:04 +0400 |
commit | a31693cca4d2352a15074deffd7b0feda923d573 (patch) | |
tree | 60256d03ed6976b30550907796c8dd7a66528ce0 /source/blender/radiosity | |
parent | 6c03e374fa98525f64fac7ae6991ce4e156f6a1b (diff) |
* fixed code that tried to restore material links, after radiosity, and
when you want a new Mesh.
Problem happened when over 16 materials are used for 'collect meshes'.
Blender does not support (yet) more than 16. For clarity, I added a
warning for the user when this occurs
(was bug 370)
Diffstat (limited to 'source/blender/radiosity')
-rw-r--r-- | source/blender/radiosity/intern/source/radpostprocess.c | 3 | ||||
-rw-r--r-- | source/blender/radiosity/intern/source/radpreprocess.c | 10 |
2 files changed, 6 insertions, 7 deletions
diff --git a/source/blender/radiosity/intern/source/radpostprocess.c b/source/blender/radiosity/intern/source/radpostprocess.c index 7b362b0e508..a598b4de497 100644 --- a/source/blender/radiosity/intern/source/radpostprocess.c +++ b/source/blender/radiosity/intern/source/radpostprocess.c @@ -55,6 +55,7 @@ #include "BLI_blenlib.h" #include "BLI_arithb.h" +#include "BIF_toolbox.h" // notice() #include "DNA_material_types.h" #include "DNA_mesh_types.h" @@ -702,6 +703,8 @@ void rad_addmesh(void) if(RG.totface==0) return; + if(RG.totmat==MAXMAT) notice("warning: cannot assign more than 16 materials to 1 mesh"); + /* make sure there's alpha in the color, to distinguish */ for(a=0; a<RG.totface; a++) { RAD_NEXTFACE(a); diff --git a/source/blender/radiosity/intern/source/radpreprocess.c b/source/blender/radiosity/intern/source/radpreprocess.c index a1fb90abecc..88b5afae359 100644 --- a/source/blender/radiosity/intern/source/radpreprocess.c +++ b/source/blender/radiosity/intern/source/radpreprocess.c @@ -364,13 +364,9 @@ void rad_collect_meshes() } else { for(a=0; a<base->object->totcol; a++) { - if(a+RG.totmat>MAXMAT-1) break; - RG.matar[a+RG.totmat]= give_current_material(base->object, a+1); - } - - RG.totmat+= base->object->totcol; - if (RG.totmat >= MAXMAT) { - RG.totmat = MAXMAT - 1; + if(RG.totmat >= MAXMAT) break; + RG.matar[RG.totmat]= give_current_material(base->object, a+1); + RG.totmat++; } } } |