Modifier compilation tweaks (Blender conference commit)
* Fluid compilation: Inverse the compile flag from DISABLE_ELBEEM to WITH_MOD_FLUID for consistency. (scons/cmake) * Use WITH_BF_FLUID in your user config (scons) * Add support for scons to disable build with Decimate and Boolean modifier. (WITH_BF_DECIMATE and WITH_BF_BOOLEAN)
This commit is contained in:
parent
15bd96efeb
commit
f837b46a2b
10
SConstruct
10
SConstruct
|
@ -253,7 +253,9 @@ if 'blenderlite' in B.targets:
|
|||
target_env_defs['WITH_BF_BULLET'] = False
|
||||
target_env_defs['WITH_BF_BINRELOC'] = False
|
||||
target_env_defs['BF_BUILDINFO'] = False
|
||||
target_env_defs['BF_NO_ELBEEM'] = True
|
||||
target_env_defs['WITH_BF_FLUID'] = False
|
||||
target_env_defs['WITH_BF_DECIMATE'] = False
|
||||
target_env_defs['WITH_BF_BOOLEAN'] = False
|
||||
target_env_defs['WITH_BF_PYTHON'] = False
|
||||
target_env_defs['WITH_BF_3DMOUSE'] = False
|
||||
|
||||
|
@ -323,9 +325,9 @@ if 'blenderplayer' in B.targets:
|
|||
if 'blendernogame' in B.targets:
|
||||
env['WITH_BF_GAMEENGINE'] = False
|
||||
|
||||
# disable elbeem (fluidsim) compilation?
|
||||
if env['BF_NO_ELBEEM'] == 1:
|
||||
env['CPPFLAGS'].append('-DDISABLE_ELBEEM')
|
||||
# build without elbeem (fluidsim)?
|
||||
if env['WITH_BF_FLUID'] == 1:
|
||||
env['CPPFLAGS'].append('-DWITH_MOD_FLUID')
|
||||
|
||||
|
||||
if btools.ENDIAN == "big":
|
||||
|
|
|
@ -150,7 +150,9 @@ def validate_arguments(args, bc):
|
|||
'BF_GHOST_DEBUG',
|
||||
'WITH_BF_RAYOPTIMIZATION',
|
||||
'BF_RAYOPTIMIZATION_SSE_FLAGS',
|
||||
'BF_NO_ELBEEM',
|
||||
'WITH_BF_FLUID',
|
||||
'WITH_BF_DECIMATE',
|
||||
'WITH_BF_BOOLEAN',
|
||||
'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',
|
||||
'BUILDBOT_BRANCH', 'WITH_BF_3DMOUSE', 'WITH_BF_STATIC3DMOUSE', 'BF_3DMOUSE', 'BF_3DMOUSE_INC', 'BF_3DMOUSE_LIB', 'BF_3DMOUSE_LIBPATH', 'BF_3DMOUSE_LIB_STATIC'
|
||||
|
@ -250,7 +252,9 @@ def read_opts(env, cfg, args):
|
|||
(BoolVariable('WITH_OSX_STATICPYTHON', 'Staticly link to python', True)),
|
||||
('BF_PYTHON_ABI_FLAGS', 'Python ABI flags (suffix in library version: m, mu, etc)', ''),
|
||||
|
||||
(BoolVariable('BF_NO_ELBEEM', 'Disable Fluid Sim', False)),
|
||||
(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)),
|
||||
('BF_PROFILE_FLAGS', 'Profiling compiler flags', ''),
|
||||
(BoolVariable('WITH_BF_OPENAL', 'Use OpenAL if true', False)),
|
||||
('BF_OPENAL', 'base path for OpenAL', ''),
|
||||
|
|
|
@ -22,7 +22,7 @@ SConscript(['audaspace/SConscript',
|
|||
# perhaps get rid of intern/csg?
|
||||
NEW_CSG='false'
|
||||
|
||||
if not env['BF_NO_ELBEEM']:
|
||||
if env['WITH_BF_FLUID']:
|
||||
SConscript(['elbeem/SConscript'])
|
||||
|
||||
if NEW_CSG=='false':
|
||||
|
|
|
@ -323,8 +323,8 @@ if(WITH_OPENMP)
|
|||
add_definitions(-DPARALLEL=1)
|
||||
endif()
|
||||
|
||||
if(NOT WITH_MOD_FLUID)
|
||||
add_definitions(-DDISABLE_ELBEEM)
|
||||
if(WITH_MOD_FLUID)
|
||||
add_definitions(-DWITH_MOD_FLUID)
|
||||
endif()
|
||||
|
||||
if(WITH_MOD_SMOKE)
|
||||
|
|
|
@ -79,8 +79,8 @@ if env['OURPLATFORM'] == 'darwin':
|
|||
if env['WITH_BF_OPENMP']:
|
||||
defs.append('PARALLEL=1')
|
||||
|
||||
if env['BF_NO_ELBEEM']:
|
||||
defs.append('DISABLE_ELBEEM')
|
||||
if env['WITH_BF_FLUID']:
|
||||
defs.append('WITH_MOD_FLUID')
|
||||
|
||||
if env['WITH_BF_LZO']:
|
||||
incs += ' #/extern/lzo/minilzo'
|
||||
|
|
|
@ -91,12 +91,12 @@
|
|||
#include "RE_shader_ext.h"
|
||||
|
||||
/* fluid sim particle import */
|
||||
#ifndef DISABLE_ELBEEM
|
||||
#ifdef WITH_MOD_FLUID
|
||||
#include "DNA_object_fluidsim.h"
|
||||
#include "LBM_fluidsim.h"
|
||||
#include <zlib.h>
|
||||
#include <string.h>
|
||||
#endif // DISABLE_ELBEEM
|
||||
#endif // WITH_MOD_FLUID
|
||||
|
||||
//XXX #include "BIF_screen.h"
|
||||
|
||||
|
|
|
@ -95,13 +95,13 @@
|
|||
#include "RE_shader_ext.h"
|
||||
|
||||
/* fluid sim particle import */
|
||||
#ifndef DISABLE_ELBEEM
|
||||
#ifdef WITH_MOD_FLUID
|
||||
#include "DNA_object_fluidsim.h"
|
||||
#include "LBM_fluidsim.h"
|
||||
#include <zlib.h>
|
||||
#include <string.h>
|
||||
|
||||
#endif // DISABLE_ELBEEM
|
||||
#endif // WITH_MOD_FLUID
|
||||
|
||||
/************************************************/
|
||||
/* Reacting to system events */
|
||||
|
@ -3916,7 +3916,7 @@ static void particles_fluid_step(ParticleSimulationData *sim, int UNUSED(cfra))
|
|||
}
|
||||
|
||||
/* fluid sim particle import handling, actual loading of particles from file */
|
||||
#ifndef DISABLE_ELBEEM
|
||||
#ifdef WITH_MOD_FLUID
|
||||
{
|
||||
FluidsimModifierData *fluidmd = (FluidsimModifierData *)modifiers_findByType(sim->ob, eModifierType_Fluidsim);
|
||||
|
||||
|
@ -4009,7 +4009,7 @@ static void particles_fluid_step(ParticleSimulationData *sim, int UNUSED(cfra))
|
|||
|
||||
} // fluid sim particles done
|
||||
}
|
||||
#endif // DISABLE_ELBEEM
|
||||
#endif // WITH_MOD_FLUID
|
||||
}
|
||||
|
||||
static int emit_particles(ParticleSimulationData *sim, PTCacheID *pid, float UNUSED(cfra))
|
||||
|
|
|
@ -45,8 +45,8 @@ set(SRC
|
|||
physics_intern.h
|
||||
)
|
||||
|
||||
if(NOT WITH_MOD_FLUID)
|
||||
add_definitions(-DDISABLE_ELBEEM)
|
||||
if(WITH_MOD_FLUID)
|
||||
add_definitions(-DWITH_MOD_FLUID)
|
||||
endif()
|
||||
|
||||
if(WITH_OPENMP)
|
||||
|
|
|
@ -85,7 +85,7 @@
|
|||
#include "physics_intern.h" // own include
|
||||
|
||||
/* enable/disable overall compilation */
|
||||
#ifndef DISABLE_ELBEEM
|
||||
#ifdef WITH_MOD_FLUID
|
||||
|
||||
#include "WM_api.h"
|
||||
|
||||
|
@ -1111,7 +1111,7 @@ void fluidsimFreeBake(Object *UNUSED(ob))
|
|||
/* not implemented yet */
|
||||
}
|
||||
|
||||
#else /* DISABLE_ELBEEM */
|
||||
#else /* WITH_MOD_FLUID */
|
||||
|
||||
/* compile dummy functions for disabled fluid sim */
|
||||
|
||||
|
@ -1135,7 +1135,7 @@ static int fluidsimBake(bContext *UNUSED(C), ReportList *UNUSED(reports), Object
|
|||
return 0;
|
||||
}
|
||||
|
||||
#endif /* DISABLE_ELBEEM */
|
||||
#endif /* WITH_MOD_FLUID */
|
||||
|
||||
/***************************** Operators ******************************/
|
||||
|
||||
|
|
|
@ -195,8 +195,8 @@ if(WITH_CODEC_FFMPEG)
|
|||
add_definitions(-DWITH_FFMPEG)
|
||||
endif()
|
||||
|
||||
if(NOT WITH_MOD_FLUID)
|
||||
add_definitions(-DDISABLE_ELBEEM)
|
||||
if(WITH_MOD_FLUID)
|
||||
add_definitions(-DWITH_MOD_FLUID)
|
||||
endif()
|
||||
|
||||
if(WITH_FFTW3)
|
||||
|
|
|
@ -170,7 +170,7 @@ static void rna_FluidSettings_update_type(Main *bmain, Scene *scene, PointerRNA
|
|||
|
||||
static void rna_DomainFluidSettings_memory_estimate_get(PointerRNA *ptr, char *value)
|
||||
{
|
||||
#ifdef DISABLE_ELBEEM
|
||||
#ifndef WITH_MOD_FLUID
|
||||
(void)ptr;
|
||||
value[0]= '\0';
|
||||
#else
|
||||
|
@ -183,7 +183,7 @@ static void rna_DomainFluidSettings_memory_estimate_get(PointerRNA *ptr, char *v
|
|||
|
||||
static int rna_DomainFluidSettings_memory_estimate_length(PointerRNA *UNUSED(ptr))
|
||||
{
|
||||
#ifdef DISABLE_ELBEEM
|
||||
#ifndef WITH_MOD_FLUID
|
||||
return 0;
|
||||
#else
|
||||
return 31;
|
||||
|
|
|
@ -111,8 +111,8 @@ if(WITH_MOD_DECIMATE)
|
|||
)
|
||||
endif()
|
||||
|
||||
if(NOT WITH_MOD_FLUID)
|
||||
add_definitions(-DDISABLE_ELBEEM)
|
||||
if(WITH_MOD_FLUID)
|
||||
add_definitions(-DWITH_MOD_FLUID)
|
||||
endif()
|
||||
|
||||
if(WITH_GAMEENGINE)
|
||||
|
|
|
@ -13,12 +13,14 @@ incs += ' ' + env['BF_ZLIB_INC']
|
|||
|
||||
defs = []
|
||||
|
||||
# could be made optional
|
||||
defs += ['WITH_MOD_BOOLEAN']
|
||||
defs += ['WITH_MOD_DECIMATE']
|
||||
if env ['WITH_BF_BOOLEAN']:
|
||||
defs.append('WITH_MOD_BOOLEAN')
|
||||
|
||||
if env['BF_NO_ELBEEM']:
|
||||
defs.append('DISABLE_ELBEEM')
|
||||
if env ['WITH_BF_DECIMATE']:
|
||||
defs.append('WITH_MOD_DECIMATE')
|
||||
|
||||
if env['WITH_BF_FLUID']:
|
||||
defs.append('WITH_MOD_FLUID')
|
||||
|
||||
if env['WITH_BF_GAMEENGINE']:
|
||||
incs += ' #/extern/recastnavigation'
|
||||
|
|
|
@ -62,9 +62,10 @@
|
|||
// headers for fluidsim bobj meshes
|
||||
#include "LBM_fluidsim.h"
|
||||
|
||||
|
||||
void fluidsim_init(FluidsimModifierData *fluidmd)
|
||||
{
|
||||
#ifndef DISABLE_ELBEEM
|
||||
#ifdef WITH_MOD_FLUID
|
||||
if(fluidmd)
|
||||
{
|
||||
FluidsimSettings *fss = MEM_callocN(sizeof(FluidsimSettings), "fluidsimsettings");
|
||||
|
@ -152,7 +153,7 @@ void fluidsim_init(FluidsimModifierData *fluidmd)
|
|||
|
||||
void fluidsim_free(FluidsimModifierData *fluidmd)
|
||||
{
|
||||
#ifndef DISABLE_ELBEEM
|
||||
#ifdef WITH_MOD_FLUID
|
||||
if(fluidmd)
|
||||
{
|
||||
if(fluidmd->fss->meshVelocities)
|
||||
|
@ -169,7 +170,7 @@ void fluidsim_free(FluidsimModifierData *fluidmd)
|
|||
return;
|
||||
}
|
||||
|
||||
#ifndef DISABLE_ELBEEM
|
||||
#ifdef WITH_MOD_FLUID
|
||||
/* read .bobj.gz file into a fluidsimDerivedMesh struct */
|
||||
static DerivedMesh *fluidsim_read_obj(const char *filename)
|
||||
{
|
||||
|
@ -534,14 +535,14 @@ static DerivedMesh *fluidsim_read_cache(DerivedMesh *orgdm, FluidsimModifierData
|
|||
|
||||
return dm;
|
||||
}
|
||||
#endif // DISABLE_ELBEEM
|
||||
#endif // WITH_MOD_FLUID
|
||||
|
||||
DerivedMesh *fluidsimModifier_do(FluidsimModifierData *fluidmd, Scene *scene,
|
||||
Object *UNUSED(ob),
|
||||
DerivedMesh *dm,
|
||||
int useRenderParams, int UNUSED(isFinalCalc))
|
||||
{
|
||||
#ifndef DISABLE_ELBEEM
|
||||
#ifdef WITH_MOD_FLUID
|
||||
DerivedMesh *result = NULL;
|
||||
int framenr;
|
||||
FluidsimSettings *fss = NULL;
|
||||
|
|
Loading…
Reference in New Issue