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
This commit is contained in:
Philipp Oeser 2020-11-25 09:38:54 +01:00
parent 87030d8be5
commit 4b248c1658
Notes: blender-bot 2023-02-14 09:03:55 +01:00
Referenced by issue #82729, Crash in rna_EffectorWeight_path when object has fluid and dynamic paint modifiers
Referenced by issue #77348, Blender LTS: Maintenance Task 2.83
1 changed files with 3 additions and 2 deletions

View File

@ -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);