forked from bartvdbraak/blender
[#18277] Segfault crash by editing mesh with subsurf+ParticleInstance modifiers
particleInstanceModifier_applyModifier uses getVertCo,which is not implemented by ccgDM. getVertCo was used to simply perform a min/max, so it was fixed to use the apropriate min/max dm->getMinMax(dm, min_r, max_r); Maybe the fact ccgDM doesn't implements getVertCo/getVertNo is a bug, since it implements every other DM function and its strange those are left out.
This commit is contained in:
parent
f87a399978
commit
a3b684d698
@ -6380,20 +6380,11 @@ static DerivedMesh * particleInstanceModifier_applyModifier(
|
||||
psys->lattice=psys_get_lattice(ob, psys);
|
||||
|
||||
if(psys->flag & (PSYS_HAIR_DONE|PSYS_KEYED)){
|
||||
float co[3];
|
||||
for(i=0; i< totvert; i++){
|
||||
dm->getVertCo(dm,i,co);
|
||||
if(i==0){
|
||||
min_co=max_co=co[track];
|
||||
}
|
||||
else{
|
||||
if(co[track]<min_co)
|
||||
min_co=co[track];
|
||||
|
||||
if(co[track]>max_co)
|
||||
max_co=co[track];
|
||||
}
|
||||
}
|
||||
float min_r[3], max_r[3];
|
||||
dm->getMinMax(dm, min_r, max_r);
|
||||
min_co=min_r[track];
|
||||
max_co=max_r[track];
|
||||
}
|
||||
|
||||
result = CDDM_from_template(dm, maxvert,dm->getNumEdges(dm)*totpart,maxface);
|
||||
|
Loading…
Reference in New Issue
Block a user