diff options
author | Philipp Oeser <info@graphics-engineer.com> | 2020-11-25 11:38:54 +0300 |
---|---|---|
committer | Philipp Oeser <info@graphics-engineer.com> | 2020-11-26 18:57:02 +0300 |
commit | 4b248c16589b1cdf12b82f74a4ac32e29b6b10f4 (patch) | |
tree | 24f48870e9c8cb25c1c48713ca32ef63fc3741d7 /source/blender/makesrna/intern/rna_object_force.c | |
parent | 87030d8be5e9dd6a9c6d95882949d1a18575b90c (diff) |
Fix T82729: Crash in rna_EffectorWeight_path when object has fluid and
dynamic paint modifiers
Looks like prior to the introduction of mantaflow, the former
SmokeModifierData always had a domain initialized (even if its type was
set to None). Since mataflow, the FluidModifierData type needs to be set
to MOD_FLUID_TYPE_DOMAIN (otherwise domain is invalid)
Maniphest Tasks: T82729
Differential Revision: https://developer.blender.org/D9644
Diffstat (limited to 'source/blender/makesrna/intern/rna_object_force.c')
-rw-r--r-- | source/blender/makesrna/intern/rna_object_force.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/source/blender/makesrna/intern/rna_object_force.c b/source/blender/makesrna/intern/rna_object_force.c index c4dcda71984..39783f9e31f 100644 --- a/source/blender/makesrna/intern/rna_object_force.c +++ b/source/blender/makesrna/intern/rna_object_force.c @@ -813,11 +813,12 @@ static char *rna_EffectorWeight_path(PointerRNA *ptr) } } - /* check smoke modifier */ + /* check fluid modifier */ md = (ModifierData *)BKE_modifiers_findby_type(ob, eModifierType_Fluid); if (md) { FluidModifierData *fmd = (FluidModifierData *)md; - if (fmd->domain->effector_weights == ew) { + if (fmd->type == MOD_FLUID_TYPE_DOMAIN && fmd->domain && + fmd->domain->effector_weights == ew) { char name_esc[sizeof(md->name) * 2]; BLI_strescape(name_esc, md->name, sizeof(name_esc)); return BLI_sprintfN("modifiers[\"%s\"].domain_settings.effector_weights", name_esc); |