[Bf-blender-cvs] [4b248c16589] master: Fix T82729: Crash in rna_EffectorWeight_path when object has fluid and dynamic paint modifiers

Philipp Oeser noreply at git.blender.org
Thu Nov 26 17:12:59 CET 2020


Commit: 4b248c16589b1cdf12b82f74a4ac32e29b6b10f4
Author: Philipp Oeser
Date:   Wed Nov 25 09:38:54 2020 +0100
Branches: master
https://developer.blender.org/rB4b248c16589b1cdf12b82f74a4ac32e29b6b10f4

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

===================================================================

M	source/blender/makesrna/intern/rna_object_force.c

===================================================================

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



More information about the Bf-blender-cvs mailing list