Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLukas Toenne <lukas.toenne@googlemail.com>2012-07-11 20:08:04 +0400
committerLukas Toenne <lukas.toenne@googlemail.com>2012-07-11 20:08:04 +0400
commit2070cd5d4929b969046492e55da34736a9d6304c (patch)
treee946cd7c09c211ce8df51ea77ec1ea0c17055daa
parenta87051bd8ee06166ba3878a92ba63ec4d1f1ff27 (diff)
Fix #32058, Crash when using ParticleInstance with an hidden particle system.
The instance modifier needs to access the derived mesh data of the particle parent object to create stuff on the hairs, however the dm does not exist when the particle modifier is hidden. This is a general design problem: Objects accessing another object's derived mesh data is unsafe. For now it just checks valid dm pointer and uses identity transform if NULL.
-rw-r--r--source/blender/blenkernel/intern/particle.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/source/blender/blenkernel/intern/particle.c b/source/blender/blenkernel/intern/particle.c
index dcd1a797a7a..c8b07e2ec11 100644
--- a/source/blender/blenkernel/intern/particle.c
+++ b/source/blender/blenkernel/intern/particle.c
@@ -3400,6 +3400,12 @@ void psys_mat_hair_to_object(Object *UNUSED(ob), DerivedMesh *dm, short from, Pa
{
float vec[3];
+ /* can happen when called from a different object's modifier */
+ if (!dm) {
+ unit_m4(hairmat);
+ return;
+ }
+
psys_face_mat(0, dm, pa, hairmat, 0);
psys_particle_on_dm(dm, from, pa->num, pa->num_dmcache, pa->fuv, pa->foffset, vec, 0, 0, 0, 0, 0);
copy_v3_v3(hairmat[3], vec);