[Bf-blender-cvs] [fb29231e451] blenloader-api: update armature modifier

Jacques Lucke noreply at git.blender.org
Sat Mar 7 19:09:30 CET 2020


Commit: fb29231e45114e2a4d58eaa9efdbc1156c7090e5
Author: Jacques Lucke
Date:   Sat Mar 7 19:06:17 2020 +0100
Branches: blenloader-api
https://developer.blender.org/rBfb29231e45114e2a4d58eaa9efdbc1156c7090e5

update armature modifier

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

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

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

diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c
index 5fb076eb840..becd57c63d6 100644
--- a/source/blender/blenloader/intern/readfile.c
+++ b/source/blender/blenloader/intern/readfile.c
@@ -5282,11 +5282,6 @@ static void direct_link_modifiers(FileData *fd, ListBase *lb, Object *ob)
     else if (mdi && mdi->bloRead) {
       mdi->bloRead(wrap_reader(fd), md);
     }
-    else if (md->type == eModifierType_Armature) {
-      ArmatureModifierData *amd = (ArmatureModifierData *)md;
-
-      amd->prevCos = NULL;
-    }
     else if (md->type == eModifierType_Fluid) {
 
       FluidModifierData *mmd = (FluidModifierData *)md;
diff --git a/source/blender/modifiers/intern/MOD_armature.c b/source/blender/modifiers/intern/MOD_armature.c
index 3aef3f4a4b8..423f0866373 100644
--- a/source/blender/modifiers/intern/MOD_armature.c
+++ b/source/blender/modifiers/intern/MOD_armature.c
@@ -45,6 +45,8 @@
 
 #include "MEM_guardedalloc.h"
 
+#include "BLO_callback_api.h"
+
 #include "MOD_util.h"
 
 static void initData(ModifierData *md)
@@ -124,6 +126,12 @@ static void updateDepsgraph(ModifierData *md, const ModifierUpdateDepsgraphConte
   DEG_add_modifier_to_transform_relation(ctx->node, "Armature Modifier");
 }
 
+static void bloRead(BloReader *UNUSED(reader), ModifierData *md)
+{
+  ArmatureModifierData *amd = (ArmatureModifierData *)md;
+  amd->prevCos = NULL;
+}
+
 static void deformVerts(ModifierData *md,
                         const ModifierEvalContext *ctx,
                         Mesh *mesh,
@@ -267,5 +275,5 @@ ModifierTypeInfo modifierType_Armature = {
     /* foreachTexLink */ NULL,
     /* freeRuntimeData */ NULL,
     /* bloWrite */ NULL,
-    /* bloRead */ NULL,
+    /* bloRead */ bloRead,
 };



More information about the Bf-blender-cvs mailing list