Fix for [#20023] Renderer aborts in some cases when rendering only meta-objects with volume materials.

When metaballs were added to the render, if they weren't the basis ball, they'd be skipped, leaving a render object with no geometry. Now it doesn't add an object in the first place.
This commit is contained in:
Matt Ebb
2009-11-26 05:01:28 +00:00
parent 1fcffd1aa0
commit a9dff1ef57

View File

@@ -4492,7 +4492,7 @@ void RE_Database_Free(Render *re)
}
}
static int allow_render_object(Object *ob, int nolamps, int onlyselected, Object *actob)
static int allow_render_object(Render *re, Object *ob, int nolamps, int onlyselected, Object *actob)
{
/* override not showing object when duplis are used with particles */
if(ob->transflag & OB_DUPLIPARTS)
@@ -4500,6 +4500,10 @@ static int allow_render_object(Object *ob, int nolamps, int onlyselected, Object
else if((ob->transflag & OB_DUPLI) && !(ob->transflag & OB_DUPLIFRAMES))
return 0;
/* don't add non-basic meta objects, ends up having renderobjects with no geometry */
//if (ob!=find_basis_mball(re->scene, ob))
// return 0;
if(nolamps && (ob->type==OB_LAMP))
return 0;
@@ -4605,7 +4609,7 @@ static void add_group_render_dupli_obs(Render *re, Group *group, int nolamps, in
if(ob->flag & OB_DONE) {
if(ob->transflag & OB_RENDER_DUPLI) {
if(allow_render_object(ob, nolamps, onlyselected, actob)) {
if(allow_render_object(re, ob, nolamps, onlyselected, actob)) {
init_render_object(re, ob, NULL, 0, timeoffset, vectorlay);
ob->transflag &= ~OB_RENDER_DUPLI;
@@ -4659,7 +4663,7 @@ static void database_init_objects(Render *re, unsigned int renderlay, int nolamp
/* OB_RENDER_DUPLI means instances for it were already created, now
* it still needs to create the ObjectRen containing the data */
if(ob->transflag & OB_RENDER_DUPLI) {
if(allow_render_object(ob, nolamps, onlyselected, actob)) {
if(allow_render_object(re, ob, nolamps, onlyselected, actob)) {
init_render_object(re, ob, NULL, 0, timeoffset, vectorlay);
ob->transflag &= ~OB_RENDER_DUPLI;
}
@@ -4693,7 +4697,7 @@ static void database_init_objects(Render *re, unsigned int renderlay, int nolamp
if(obd->type==OB_MBALL)
continue;
if(!allow_render_object(obd, nolamps, onlyselected, actob))
if(!allow_render_object(re, obd, nolamps, onlyselected, actob))
continue;
if(allow_render_dupli_instance(re, dob, obd)) {
@@ -4763,10 +4767,10 @@ static void database_init_objects(Render *re, unsigned int renderlay, int nolamp
}
free_object_duplilist(lb);
if(allow_render_object(ob, nolamps, onlyselected, actob))
if(allow_render_object(re, ob, nolamps, onlyselected, actob))
init_render_object(re, ob, NULL, 0, timeoffset, vectorlay);
}
else if(allow_render_object(ob, nolamps, onlyselected, actob))
else if(allow_render_object(re, ob, nolamps, onlyselected, actob))
init_render_object(re, ob, NULL, 0, timeoffset, vectorlay);
}