[Bf-blender-cvs] [ab673563e86] blenloader-api: update subsurf modifier

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


Commit: ab673563e864173ecb58070ddb95275709fdef49
Author: Jacques Lucke
Date:   Sat Mar 7 19:05:24 2020 +0100
Branches: blenloader-api
https://developer.blender.org/rBab673563e864173ecb58070ddb95275709fdef49

update subsurf modifier

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

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

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

diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c
index e467f496e80..5fb076eb840 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_Subsurf) {
-      SubsurfModifierData *smd = (SubsurfModifierData *)md;
-
-      smd->emCache = smd->mCache = NULL;
-    }
     else if (md->type == eModifierType_Armature) {
       ArmatureModifierData *amd = (ArmatureModifierData *)md;
 
diff --git a/source/blender/modifiers/intern/MOD_subsurf.c b/source/blender/modifiers/intern/MOD_subsurf.c
index d2e02d7e54c..8618095dfeb 100644
--- a/source/blender/modifiers/intern/MOD_subsurf.c
+++ b/source/blender/modifiers/intern/MOD_subsurf.c
@@ -41,6 +41,8 @@
 #include "DEG_depsgraph.h"
 #include "DEG_depsgraph_query.h"
 
+#include "BLO_callback_api.h"
+
 #include "MOD_modifiertypes.h"
 
 #include "intern/CCGSubSurf.h"
@@ -108,6 +110,12 @@ static bool isDisabled(const Scene *scene, ModifierData *md, bool useRenderParam
   return get_render_subsurf_level(&scene->r, levels, useRenderParams != 0) == 0;
 }
 
+static void bloRead(BloReader *UNUSED(reader), ModifierData *md)
+{
+  SubsurfModifierData *smd = (SubsurfModifierData *)md;
+  smd->emCache = smd->mCache = NULL;
+}
+
 static int subdiv_levels_for_modifier_get(const SubsurfModifierData *smd,
                                           const ModifierEvalContext *ctx)
 {
@@ -303,5 +311,5 @@ ModifierTypeInfo modifierType_Subsurf = {
     /* foreachTexLink */ NULL,
     /* freeRuntimeData */ freeRuntimeData,
     /* bloWrite */ NULL,
-    /* bloRead */ NULL,
+    /* bloRead */ bloRead,
 };



More information about the Bf-blender-cvs mailing list