diff options
-rw-r--r-- | CMakeLists.txt | 2 | ||||
-rw-r--r-- | SConstruct | 1 | ||||
-rw-r--r-- | build_files/scons/tools/btools.py | 2 | ||||
-rw-r--r-- | intern/CMakeLists.txt | 5 | ||||
-rw-r--r-- | intern/SConscript | 4 | ||||
-rw-r--r-- | source/blender/modifiers/CMakeLists.txt | 8 | ||||
-rw-r--r-- | source/blender/modifiers/SConscript | 6 | ||||
-rw-r--r-- | source/blender/modifiers/intern/MOD_remesh.c | 26 |
8 files changed, 45 insertions, 9 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 228f34ecde7..40a51f0b452 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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) diff --git a/SConstruct b/SConstruct index 88444c61314..ee43015cf6e 100644 --- a/SConstruct +++ b/SConstruct @@ -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 diff --git a/build_files/scons/tools/btools.py b/build_files/scons/tools/btools.py index adeca5668eb..9d47edcfd79 100644 --- a/build_files/scons/tools/btools.py +++ b/build_files/scons/tools/btools.py @@ -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)), diff --git a/intern/CMakeLists.txt b/intern/CMakeLists.txt index 3332d1c97e7..9f5217e68e3 100644 --- a/intern/CMakeLists.txt +++ b/intern/CMakeLists.txt @@ -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() diff --git a/intern/SConscript b/intern/SConscript index a6d50c80468..bb19426263a 100644 --- a/intern/SConscript +++ b/intern/SConscript @@ -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']) diff --git a/source/blender/modifiers/CMakeLists.txt b/source/blender/modifiers/CMakeLists.txt index c04bc06be9e..c6cb6584973 100644 --- a/source/blender/modifiers/CMakeLists.txt +++ b/source/blender/modifiers/CMakeLists.txt @@ -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 diff --git a/source/blender/modifiers/SConscript b/source/blender/modifiers/SConscript index a93ee8523f9..ce413faec86 100644 --- a/source/blender/modifiers/SConscript +++ b/source/blender/modifiers/SConscript @@ -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') diff --git a/source/blender/modifiers/intern/MOD_remesh.c b/source/blender/modifiers/intern/MOD_remesh.c index a58c0416163..c698985efc3 100644 --- a/source/blender/modifiers/intern/MOD_remesh.c +++ b/source/blender/modifiers/intern/MOD_remesh.c @@ -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", |