Bugfix: particle settings didn't automatically link in associated
objects or groups.
This commit is contained in:
@@ -2223,6 +2223,9 @@ void object_handle_update(Object *ob)
|
|||||||
* since object_duplilist does dupliparticles before that */
|
* since object_duplilist does dupliparticles before that */
|
||||||
dm = mesh_create_derived_render(ob, CD_MASK_BAREMESH|CD_MASK_MTFACE|CD_MASK_MCOL);
|
dm = mesh_create_derived_render(ob, CD_MASK_BAREMESH|CD_MASK_MTFACE|CD_MASK_MCOL);
|
||||||
dm->release(dm);
|
dm->release(dm);
|
||||||
|
|
||||||
|
for(psys=ob->particlesystem.first; psys; psys=psys->next)
|
||||||
|
psys_get_modifier(ob, psys)->flag &= ~eParticleSystemFlag_psys_updated;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -7529,6 +7529,14 @@ static void expand_doit(FileData *fd, Main *mainvar, void *old)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void expand_particlesettings(FileData *fd, Main *mainvar, ParticleSettings *part)
|
||||||
|
{
|
||||||
|
expand_doit(fd, mainvar, part->dup_ob);
|
||||||
|
expand_doit(fd, mainvar, part->dup_group);
|
||||||
|
expand_doit(fd, mainvar, part->eff_group);
|
||||||
|
expand_doit(fd, mainvar, part->bb_ob);
|
||||||
|
}
|
||||||
|
|
||||||
static void expand_ipo(FileData *fd, Main *mainvar, Ipo *ipo)
|
static void expand_ipo(FileData *fd, Main *mainvar, Ipo *ipo)
|
||||||
{
|
{
|
||||||
IpoCurve *icu;
|
IpoCurve *icu;
|
||||||
@@ -8121,6 +8129,8 @@ static void expand_main(FileData *fd, Main *mainvar)
|
|||||||
case ID_IP:
|
case ID_IP:
|
||||||
expand_ipo(fd, mainvar, (Ipo *)id);
|
expand_ipo(fd, mainvar, (Ipo *)id);
|
||||||
break;
|
break;
|
||||||
|
case ID_PA:
|
||||||
|
expand_particlesettings(fd, mainvar, (ParticleSettings *)id);
|
||||||
}
|
}
|
||||||
|
|
||||||
doit= 1;
|
doit= 1;
|
||||||
|
@@ -4147,16 +4147,31 @@ static void dupli_render_particle_set(Render *re, Object *ob, int level, int ena
|
|||||||
Group *group;
|
Group *group;
|
||||||
GroupObject *go;
|
GroupObject *go;
|
||||||
ParticleSystem *psys;
|
ParticleSystem *psys;
|
||||||
|
DerivedMesh *dm;
|
||||||
|
|
||||||
if(level >= MAX_DUPLI_RECUR)
|
if(level >= MAX_DUPLI_RECUR)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if(ob->transflag & OB_DUPLIPARTS) {
|
if(ob->transflag & OB_DUPLIPARTS) {
|
||||||
for(psys=ob->particlesystem.first; psys; psys=psys->next)
|
for(psys=ob->particlesystem.first; psys; psys=psys->next) {
|
||||||
if(enable)
|
if(ELEM(psys->part->draw_as, PART_DRAW_OB, PART_DRAW_GR)) {
|
||||||
psys_render_set(ob, psys, re->viewmat, re->winmat, re->winx, re->winy);
|
if(enable)
|
||||||
else
|
psys_render_set(ob, psys, re->viewmat, re->winmat, re->winx, re->winy);
|
||||||
psys_render_restore(ob, psys);
|
else
|
||||||
|
psys_render_restore(ob, psys);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if(level == 0 && enable) {
|
||||||
|
/* this is to make sure we get render level duplis in groups:
|
||||||
|
* the derivedmesh must be created before init_render_mesh,
|
||||||
|
* since object_duplilist does dupliparticles before that */
|
||||||
|
dm = mesh_create_derived_render(ob, CD_MASK_BAREMESH|CD_MASK_MTFACE|CD_MASK_MCOL);
|
||||||
|
dm->release(dm);
|
||||||
|
|
||||||
|
for(psys=ob->particlesystem.first; psys; psys=psys->next)
|
||||||
|
psys_get_modifier(ob, psys)->flag &= ~eParticleSystemFlag_psys_updated;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(ob->dup_group==NULL) return;
|
if(ob->dup_group==NULL) return;
|
||||||
@@ -4186,7 +4201,7 @@ static void database_init_objects(Render *re, unsigned int lay, int nolamps, int
|
|||||||
|
|
||||||
for(SETLOOPER(re->scene, base)) {
|
for(SETLOOPER(re->scene, base)) {
|
||||||
ob= base->object;
|
ob= base->object;
|
||||||
|
|
||||||
/* if the object has been restricted from rendering in the outliner, ignore it */
|
/* if the object has been restricted from rendering in the outliner, ignore it */
|
||||||
if(ob->restrictflag & OB_RESTRICT_RENDER) continue;
|
if(ob->restrictflag & OB_RESTRICT_RENDER) continue;
|
||||||
|
|
||||||
@@ -4216,7 +4231,7 @@ static void database_init_objects(Render *re, unsigned int lay, int nolamps, int
|
|||||||
|
|
||||||
if(obd->restrictflag & OB_RESTRICT_RENDER)
|
if(obd->restrictflag & OB_RESTRICT_RENDER)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
if(obd->type==OB_MBALL)
|
if(obd->type==OB_MBALL)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user