re-arrange modifier and blenkernel to overcome some linking problems that stopped...
authorCampbell Barton <ideasman42@gmail.com>
Sun, 25 Apr 2010 01:10:03 +0000 (01:10 +0000)
committerCampbell Barton <ideasman42@gmail.com>
Sun, 25 Apr 2010 01:10:03 +0000 (01:10 +0000)
source/blender/blenkernel/intern/modifier.c
source/blender/modifiers/MOD_modifiertypes.h
source/blender/modifiers/intern/MOD_util.c
source/blender/modifiers/intern/MOD_util.h
source/creator/CMakeLists.txt

index e483ae0e6a8bc8a0f27f310abb010be6563ad454..858e9d6c6d9c272645e47666ff77d0f8b654d187 100644 (file)
@@ -54,50 +54,8 @@ ModifierTypeInfo *modifierType_getInfo(ModifierType type)
        static int types_init = 1;
 
        if (types_init) {
-               memset(types, 0, sizeof(types));
-
-#define INIT_TYPE(typeName) \
-                       (types[eModifierType_##typeName] = &modifierType_##typeName)
-
-               INIT_TYPE(None);
-               INIT_TYPE(Curve);
-               INIT_TYPE(Lattice);
-               INIT_TYPE(Subsurf);
-               INIT_TYPE(Build);
-               INIT_TYPE(Array);
-               INIT_TYPE(Mirror);
-               INIT_TYPE(EdgeSplit);
-               INIT_TYPE(Bevel);
-               INIT_TYPE(Displace);
-               INIT_TYPE(UVProject);
-               INIT_TYPE(Decimate);
-               INIT_TYPE(Smooth);
-               INIT_TYPE(Cast);
-               INIT_TYPE(Wave);
-               INIT_TYPE(Armature);
-               INIT_TYPE(Hook);
-               INIT_TYPE(Softbody);
-               INIT_TYPE(Cloth);
-               INIT_TYPE(Collision);
-               INIT_TYPE(Boolean);
-               INIT_TYPE(MeshDeform);
-               INIT_TYPE(ParticleSystem);
-               INIT_TYPE(ParticleInstance);
-               INIT_TYPE(Explode);
-               INIT_TYPE(Shrinkwrap);
-               INIT_TYPE(Fluidsim);
-               INIT_TYPE(Mask);
-               INIT_TYPE(SimpleDeform);
-               INIT_TYPE(Multires);
-               INIT_TYPE(Surface);
-               INIT_TYPE(Smoke);
-               INIT_TYPE(ShapeKey);
-               INIT_TYPE(Solidify);
-               INIT_TYPE(Screw);
-
-               types_init = 0;
-
-#undef INIT_TYPE
+               modifier_type_init(types, type); /* MOD_utils.c */
+               types_init= 0;
        }
 
        if(type >= 0 && type < NUM_MODIFIER_TYPES &&
index 5ddb15e656f94f570b30028a8b20979be3b1f23c..bd10b4aa6fcae8648badea33ab5b4edb9213f291 100644 (file)
@@ -68,4 +68,7 @@ extern ModifierTypeInfo modifierType_ShapeKey;
 extern ModifierTypeInfo modifierType_Solidify;
 extern ModifierTypeInfo modifierType_Screw;
 
+/* MOD_util.c */
+void modifier_type_init(ModifierTypeInfo *types[], ModifierType type);
+
 #endif //MOD_MODIFIERTYPES_H
index d4e202a73b96e0523ee038d0844880c69f31d73b..7cae7f634c7bdb5b005e2ab04d8031d576fb5ecc 100644 (file)
 #include "BKE_mesh.h"
 #include "BKE_displist.h"
 #include "BKE_utildefines.h"
+#include "BKE_modifier.h"
 
 #include "MOD_util.h"
+#include "MOD_modifiertypes.h"
 
 #include "MEM_guardedalloc.h"
 
@@ -165,3 +167,46 @@ DerivedMesh *get_dm(struct Scene *scene, Object *ob, struct EditMesh *em, Derive
 
        return dm;
 }
+
+/* only called by BKE_modifier.h/modifier.c */
+void modifier_type_init(ModifierTypeInfo *types[], ModifierType type)
+{
+       memset(types, 0, sizeof(types));
+#define INIT_TYPE(typeName) (types[eModifierType_##typeName] = &modifierType_##typeName)
+       INIT_TYPE(None);
+       INIT_TYPE(Curve);
+       INIT_TYPE(Lattice);
+       INIT_TYPE(Subsurf);
+       INIT_TYPE(Build);
+       INIT_TYPE(Array);
+       INIT_TYPE(Mirror);
+       INIT_TYPE(EdgeSplit);
+       INIT_TYPE(Bevel);
+       INIT_TYPE(Displace);
+       INIT_TYPE(UVProject);
+       INIT_TYPE(Decimate);
+       INIT_TYPE(Smooth);
+       INIT_TYPE(Cast);
+       INIT_TYPE(Wave);
+       INIT_TYPE(Armature);
+       INIT_TYPE(Hook);
+       INIT_TYPE(Softbody);
+       INIT_TYPE(Cloth);
+       INIT_TYPE(Collision);
+       INIT_TYPE(Boolean);
+       INIT_TYPE(MeshDeform);
+       INIT_TYPE(ParticleSystem);
+       INIT_TYPE(ParticleInstance);
+       INIT_TYPE(Explode);
+       INIT_TYPE(Shrinkwrap);
+       INIT_TYPE(Fluidsim);
+       INIT_TYPE(Mask);
+       INIT_TYPE(SimpleDeform);
+       INIT_TYPE(Multires);
+       INIT_TYPE(Surface);
+       INIT_TYPE(Smoke);
+       INIT_TYPE(ShapeKey);
+       INIT_TYPE(Solidify);
+       INIT_TYPE(Screw);
+#undef INIT_TYPE
+}
index 98cea11e9f6dcd038f29fa65b9aeb051a6a81ab0..9592a3ce123b324e89cf52f79daa7588d5f16cb8 100644 (file)
@@ -42,4 +42,7 @@ void modifier_vgroup_cache(struct ModifierData *md, float (*vertexCos)[3]);
 void validate_layer_name(const struct CustomData *data, int type, char *name, char *outname);
 struct DerivedMesh *get_cddm(struct Scene *scene, struct Object *ob, struct EditMesh *em, struct DerivedMesh *dm, float (*vertexCos)[3]);
 struct DerivedMesh *get_dm(struct Scene *scene, struct Object *ob, struct EditMesh *em, struct DerivedMesh *dm, float (*vertexCos)[3], int orco);
+
+void modifier_type_init(struct ModifierTypeInfo *types[], ModifierType type);
+
 #endif /* MOD_UTIL_H */
index 42883ffd4ddd9928e9473465b0ba84fcce668878..193217abc9d1511df891d2e75fffbe8f867a2fd0 100644 (file)
@@ -369,8 +369,8 @@ ENDIF(CMAKE_SYSTEM_NAME MATCHES "Linux")
                bf_python 
                bf_gen_python 
                bf_ikplugin
-               bf_blenkernel
                bf_modifiers
+               bf_blenkernel
                bf_nodes
                bf_gpu
                bf_blenloader