Particles: Prevent crash when copying to an object with subsurf modifier

Probably something will be remapped wrongly, but better than crash.
This commit is contained in:
2016-09-23 15:39:33 +02:00
parent 1925b9b2fa
commit 06b51c64ad

View File

@@ -697,6 +697,9 @@ static bool remap_hair_emitter(Scene *scene, Object *ob, ParticleSystem *psys,
dm = target_psmd->dm_deformed; dm = target_psmd->dm_deformed;
} }
target_dm = target_psmd->dm_final; target_dm = target_psmd->dm_final;
if (dm == NULL) {
return false;
}
/* don't modify the original vertices */ /* don't modify the original vertices */
dm = CDDM_copy(dm); dm = CDDM_copy(dm);
@@ -1078,7 +1081,7 @@ static bool copy_particle_systems_to_object(Main *bmain,
copy_particle_edit(scene, ob_to, psys, psys_from); copy_particle_edit(scene, ob_to, psys, psys_from);
if (duplicate_settings) { if (duplicate_settings) {
id_us_min(psys->part); id_us_min(&psys->part->id);
psys->part = BKE_particlesettings_copy(bmain, psys->part); psys->part = BKE_particlesettings_copy(bmain, psys->part);
} }
} }