option to build without remesh modifier for cmake and scons
authorCampbell Barton <ideasman42@gmail.com>
Sat, 31 Dec 2011 03:34:44 +0000 (03:34 +0000)
committerCampbell Barton <ideasman42@gmail.com>
Sat, 31 Dec 2011 03:34:44 +0000 (03:34 +0000)
CMakeLists.txt
SConstruct
build_files/scons/tools/btools.py
intern/CMakeLists.txt
intern/SConscript
source/blender/modifiers/CMakeLists.txt
source/blender/modifiers/SConscript
source/blender/modifiers/intern/MOD_remesh.c

index 228f34ecde7ffc10212d46c7a69bd303edaffa7d..40a51f0b45249a0ee5229841df081dd651480c72 100644 (file)
@@ -169,6 +169,7 @@ option(WITH_MOD_FLUID               "Enable Elbeem Modifier (Fluid Simulation)" ON)
 option(WITH_MOD_SMOKE          "Enable Smoke Modifier (Smoke Simulation)" ON)
 option(WITH_MOD_DECIMATE               "Enable Decimate Modifier" ON)
 option(WITH_MOD_BOOLEAN                "Enable Boolean Modifier" ON)
+option(WITH_MOD_REMESH         "Enable Remesh Modifier" ON)
 option(WITH_MOD_CLOTH_ELTOPO           "Enable Experemental cloth solver" OFF)
 mark_as_advanced(WITH_MOD_CLOTH_ELTOPO)
 option(WITH_MOD_OCEANSIM        "Enable Ocean Modifier" OFF)
@@ -1570,6 +1571,7 @@ if(FIRST_RUN)
 
        info_cfg_text("Modifiers:")
        info_cfg_option(WITH_MOD_BOOLEAN)
+       info_cfg_option(WITH_MOD_REMESH)
        info_cfg_option(WITH_MOD_DECIMATE)
        info_cfg_option(WITH_MOD_FLUID)
        info_cfg_option(WITH_MOD_OCEANSIM)
index 88444c6131485020679b5db7182bc6e8ae7b6953..ee43015cf6ec1897ee2bc77f4284b6c4fd8dfb76 100644 (file)
@@ -264,6 +264,7 @@ if 'blenderlite' in B.targets:
     target_env_defs['WITH_BF_OCEANSIM'] = False
     target_env_defs['WITH_BF_DECIMATE'] = False
     target_env_defs['WITH_BF_BOOLEAN'] = False
+    target_env_defs['WITH_BF_REMESH'] = False
     target_env_defs['WITH_BF_PYTHON'] = False
     target_env_defs['WITH_BF_3DMOUSE'] = False
     
index adeca5668eb68c047f4d3375ddc4c1816ccabbeb..9d47edcfd793257e31566f9892a10749eb354d7c 100644 (file)
@@ -152,6 +152,7 @@ def validate_arguments(args, bc):
             'WITH_BF_FLUID',
             'WITH_BF_DECIMATE',
             'WITH_BF_BOOLEAN',
+            'WITH_BF_REMESH',
             'WITH_BF_OCEANSIM',
             'WITH_BF_CXX_GUARDEDALLOC',
             'WITH_BF_JEMALLOC', 'WITH_BF_STATICJEMALLOC', 'BF_JEMALLOC', 'BF_JEMALLOC_INC', 'BF_JEMALLOC_LIBPATH', 'BF_JEMALLOC_LIB', 'BF_JEMALLOC_LIB_STATIC',
@@ -261,6 +262,7 @@ def read_opts(env, cfg, args):
         (BoolVariable('WITH_BF_FLUID', 'Build with Fluid simulation (Elbeem)', True)),
         (BoolVariable('WITH_BF_DECIMATE', 'Build with decimate modifier', True)),
         (BoolVariable('WITH_BF_BOOLEAN', 'Build with boolean modifier', True)),
+        (BoolVariable('WITH_BF_REMESH', 'Build with remesh modifier', True)),
         (BoolVariable('WITH_BF_OCEANSIM', 'Build with ocean simulation', False)),
         ('BF_PROFILE_FLAGS', 'Profiling compiler flags', ''),
         (BoolVariable('WITH_BF_OPENAL', 'Use OpenAL if true', False)),
index 3332d1c97e751a4ad7d09f70aaca6c5417106c97..9f5217e68e3098e005a11db33609f7bf62fb4f57 100644 (file)
@@ -31,12 +31,15 @@ add_subdirectory(memutil)
 add_subdirectory(iksolver)
 add_subdirectory(opennl)
 add_subdirectory(mikktspace)
-add_subdirectory(dualcon)
 
 if(WITH_AUDASPACE)
        add_subdirectory(audaspace)
 endif()
 
+if(WITH_MOD_REMESH)
+       add_subdirectory(dualcon)
+endif()
+
 if(WITH_MOD_FLUID)
        add_subdirectory(elbeem)
 endif()
index a6d50c80468a8e85a12af87f4824649d9067636b..bb19426263a7ff19be0483d9221e967cc7a08c7a 100644 (file)
@@ -9,7 +9,6 @@ SConscript(['audaspace/SConscript',
             'container/SConscript',
             'memutil/SConscript/',
             'decimation/SConscript',
-            'dualcon/SConscript',
             'iksolver/SConscript',
             'itasc/SConscript',
             'boolop/SConscript',
@@ -23,6 +22,9 @@ SConscript(['audaspace/SConscript',
 # perhaps get rid of intern/csg?
 NEW_CSG='false'
 
+if env ['WITH_BF_REMESH']:
+       SConscript(['dualcon/SConscript'])
+
 if env['WITH_BF_FLUID']:
     SConscript(['elbeem/SConscript'])
     
index c04bc06be9e5455fa6879971101c132ddbe1d92b..c6cb658497351ee4e6bd92bf6c6e34761982f038 100644 (file)
@@ -36,7 +36,6 @@ set(INC
        ../render/extern/include
        ../../../intern/elbeem/extern
        ../../../intern/guardedalloc
-       ../../../intern/dualcon
 )
 
 set(INC_SYS
@@ -108,6 +107,13 @@ if(WITH_MOD_BOOLEAN)
        )
 endif()
 
+if(WITH_MOD_REMESH)
+       add_definitions(-DWITH_MOD_REMESH)
+       list(APPEND INC
+               ../../../intern/dualcon
+       )
+endif()
+
 if(WITH_MOD_DECIMATE)
        add_definitions(-DWITH_MOD_DECIMATE)
        list(APPEND INC
index a93ee8523f98a6df6273b883c81d4dd7ff634052..ce413faec86a05326aa5d177b7b7fe84ef482d34 100644 (file)
@@ -4,7 +4,7 @@ Import ('env')
 sources = env.Glob('intern/*.c')
 
 incs = '. ./intern'
-incs += ' #/intern/guardedalloc #/intern/decimation/extern #/intern/bsp/extern #/intern/elbeem/extern #/extern/glew/include #/intern/dualcon'
+incs += ' #/intern/guardedalloc #/intern/decimation/extern #/intern/bsp/extern #/intern/elbeem/extern #/extern/glew/include'
 incs += ' ../render/extern/include ../blenloader'
 incs += ' ../include ../blenlib ../makesdna ../makesrna ../blenkernel ../blenkernel/intern'
 incs += ' ../gpu'
@@ -14,8 +14,12 @@ incs += ' ' + env['BF_ZLIB_INC']
 defs = []
 
 if env ['WITH_BF_BOOLEAN']:
+    incs += ' #/intern/dualcon'
     defs.append('WITH_MOD_BOOLEAN')
 
+if env['WITH_BF_REMESH']:
+    defs.append('WITH_MOD_REMESH')
+
 if env ['WITH_BF_DECIMATE']:
     defs.append('WITH_MOD_DECIMATE')
 
index a58c0416163ea664112a9f827e28d577f385527f..c698985efc3351cd5fe2e6a7bc5f93a1c015dd69 100644 (file)
@@ -46,7 +46,9 @@
 #include <stdlib.h>
 #include <string.h>
 
-#include "dualcon.h"
+#ifdef WITH_MOD_REMESH
+#  include "dualcon.h"
+#endif
 
 static void initData(ModifierData *md)
 {
@@ -73,7 +75,9 @@ static void copyData(ModifierData *md, ModifierData *target)
        trmd->mode = rmd->mode;
 }
 
-void init_dualcon_mesh(DualConInput *mesh, DerivedMesh *dm)
+#ifdef WITH_MOD_REMESH
+
+static void init_dualcon_mesh(DualConInput *mesh, DerivedMesh *dm)
 {
        memset(mesh, 0, sizeof(DualConInput));
 
@@ -96,7 +100,7 @@ typedef struct {
 } DualConOutput;
 
 /* allocate and initialize a DualConOutput */
-void *dualcon_alloc_output(int totvert, int totquad)
+static void *dualcon_alloc_output(int totvert, int totquad)
 {
        DualConOutput *output;
 
@@ -108,7 +112,7 @@ void *dualcon_alloc_output(int totvert, int totquad)
        return output;
 }
 
-void dualcon_add_vert(void *output_v, const float co[3])
+static void dualcon_add_vert(void *output_v, const float co[3])
 {
        DualConOutput *output = output_v;
        DerivedMesh *dm = output->dm;
@@ -119,7 +123,7 @@ void dualcon_add_vert(void *output_v, const float co[3])
        output->curvert++;
 }
 
-void dualcon_add_quad(void *output_v, const int vert_indices[4])
+static void dualcon_add_quad(void *output_v, const int vert_indices[4])
 {
        DualConOutput *output = output_v;
        DerivedMesh *dm = output->dm;
@@ -189,6 +193,18 @@ static DerivedMesh *applyModifier(ModifierData *md,
        return result;
 }
 
+#else /* !WITH_MOD_REMESH */
+
+static DerivedMesh *applyModifier(ModifierData *UNUSED(md), Object *UNUSED(ob),
+                                               DerivedMesh *derivedData,
+                                               int UNUSED(useRenderParams),
+                                               int UNUSED(isFinalCalc))
+{
+       return derivedData;
+}
+
+#endif /* !WITH_MOD_REMESH */
+
 ModifierTypeInfo modifierType_Remesh = {
        /* name */              "Remesh",
        /* structName */        "RemeshModifierData",