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:
authorCampbell Barton <ideasman42@gmail.com>2015-11-02 14:59:46 +0300
committerCampbell Barton <ideasman42@gmail.com>2015-11-02 15:08:44 +0300
commitba5d6f5b6b3251a56b924f3b1c448068110a72f2 (patch)
tree6a3ba5f44f7f00203649e7f0bc32d32bca09812f
parent7b7aba31f24d51c904c76a17ee50608b770e1bc9 (diff)
Fix/workaround T46622: crash w/ metas & particles
Metas are scanning all scenes duplis, which can go into particle systems without an initialized derived-mesh. For now just do NULL check, its not correct but real fix is not fitting well with current design.
-rw-r--r--source/blender/blenkernel/intern/particle.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/source/blender/blenkernel/intern/particle.c b/source/blender/blenkernel/intern/particle.c
index 9aacba8d02e..deb6c8df4d4 100644
--- a/source/blender/blenkernel/intern/particle.c
+++ b/source/blender/blenkernel/intern/particle.c
@@ -4013,10 +4013,18 @@ void psys_get_dupli_texture(ParticleSystem *psys, ParticleSettings *part,
float loc[3];
int num;
+ /* XXX: on checking '(psmd->dm != NULL)'
+ * This is incorrect but needed for metaball evaluation.
+ * Ideally this would be calcualted via the depsgraph, however with metaballs,
+ * the entire scenes dupli's are scanned, which also looks into uncalculated data.
+ *
+ * For now just include this workaround as an alternative to crashing,
+ * but longer term metaballs should behave in a more manageable way, see: T46622. */
+
uv[0] = uv[1] = 0.f;
if (cpa) {
- if (part->childtype == PART_CHILD_FACES) {
+ if ((part->childtype == PART_CHILD_FACES) && (psmd->dm != NULL)) {
mtface = CustomData_get_layer(&psmd->dm->faceData, CD_MTFACE);
if (mtface) {
mface = psmd->dm->getTessFaceData(psmd->dm, cpa->num, CD_MFACE);
@@ -4032,7 +4040,7 @@ void psys_get_dupli_texture(ParticleSystem *psys, ParticleSettings *part,
}
}
- if (part->from == PART_FROM_FACE) {
+ if ((part->from == PART_FROM_FACE) && (psmd->dm != NULL)) {
mtface = CustomData_get_layer(&psmd->dm->faceData, CD_MTFACE);
num = pa->num_dmcache;