[Bf-blender-cvs] [39f005eae8e] master: Fix crash when opening files with missing armature libaries

Sebastian Parborg noreply at git.blender.org
Tue Aug 6 14:34:33 CEST 2019


Commit: 39f005eae8eed8b939579aff8c9a05a4f50e5e38
Author: Sebastian Parborg
Date:   Tue Aug 6 14:32:29 2019 +0200
Branches: master
https://developer.blender.org/rB39f005eae8eed8b939579aff8c9a05a4f50e5e38

Fix crash when opening files with missing armature libaries

In the case where the library is missing, the armature object is
replaced with an empty. This would crash the armature modifier.

Now we check if the armature object really is an armature or not.

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

M	source/blender/modifiers/intern/MOD_armature.c

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

diff --git a/source/blender/modifiers/intern/MOD_armature.c b/source/blender/modifiers/intern/MOD_armature.c
index 72215659915..7ae5fda7111 100644
--- a/source/blender/modifiers/intern/MOD_armature.c
+++ b/source/blender/modifiers/intern/MOD_armature.c
@@ -79,7 +79,12 @@ static bool isDisabled(const struct Scene *UNUSED(scene),
 {
   ArmatureModifierData *amd = (ArmatureModifierData *)md;
 
-  return !amd->object;
+  /* The object type check is only needed here in case we have a placeholder
+   * object assigned (because the library containing the armature is missing).
+   *
+   * In other cases it should be impossible.
+   */
+  return !amd->object || amd->object->type != OB_ARMATURE;
 }
 
 static void foreachObjectLink(ModifierData *md, Object *ob, ObjectWalkFunc walk, void *userData)



More information about the Bf-blender-cvs mailing list