[Bf-blender-cvs] [a08a08cb4c2] blender-v2.83-release: Fix T82729: Crash in rna_EffectorWeight_path when object has fluid and dynamic paint modifiers

Philipp Oeser noreply at git.blender.org
Wed Dec 2 08:50:18 CET 2020


Commit: a08a08cb4c26627c05ad6089030223e8313a0073
Author: Philipp Oeser
Date:   Wed Nov 25 09:38:54 2020 +0100
Branches: blender-v2.83-release
https://developer.blender.org/rBa08a08cb4c26627c05ad6089030223e8313a0073

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 6e1ca7741a7..b0a53a7f168 100644
--- a/source/blender/makesrna/intern/rna_object_force.c
+++ b/source/blender/makesrna/intern/rna_object_force.c
@@ -801,11 +801,12 @@ static char *rna_EffectorWeight_path(PointerRNA *ptr)
       }
     }
 
-    /* check smoke modifier */
+    /* check fluid modifier */
     md = (ModifierData *)modifiers_findByType(ob, eModifierType_Fluid);
     if (md) {
-      FluidModifierData *mmd = (FluidModifierData *)md;
-      if (mmd->domain->effector_weights == ew) {
+      FluidModifierData *fmd = (FluidModifierData *)md;
+      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