add bullet define & include for scons makesrna, also move meshcache utils into own file.
This commit is contained in:
@@ -65,7 +65,11 @@ incs += ' #/intern/smoke/extern'
|
||||
|
||||
if env['WITH_BF_SMOKE']:
|
||||
defs.append('WITH_SMOKE')
|
||||
|
||||
|
||||
if env['WITH_BF_BULLET']:
|
||||
defs.append('WITH_BULLET')
|
||||
incs += ' ../../rigidbody'
|
||||
|
||||
if env['WITH_BF_OPENEXR']:
|
||||
defs.append('WITH_OPENEXR')
|
||||
|
||||
|
@@ -28,7 +28,6 @@ set(INC
|
||||
.
|
||||
intern
|
||||
../blenkernel
|
||||
../blenkernel/intern
|
||||
../blenlib
|
||||
../blenfont
|
||||
../blenloader
|
||||
@@ -70,6 +69,7 @@ set(SRC
|
||||
intern/MOD_meshcache.c
|
||||
intern/MOD_meshcache_mdd.c
|
||||
intern/MOD_meshcache_pc2.c
|
||||
intern/MOD_meshcache_util.c
|
||||
intern/MOD_meshdeform.c
|
||||
intern/MOD_mirror.c
|
||||
intern/MOD_multires.c
|
||||
|
@@ -29,13 +29,26 @@ Import ('env')
|
||||
|
||||
sources = env.Glob('intern/*.c')
|
||||
|
||||
incs = '. ./intern'
|
||||
incs += ' #/intern/guardedalloc #/intern/bsp/extern #/intern/elbeem/extern #/extern/glew/include #/intern/opennl/extern'
|
||||
incs += ' ../render/extern/include ../blenloader ../bmesh'
|
||||
incs += ' ../include ../blenlib ../blenfont ../makesdna ../makesrna ../blenkernel ../blenkernel/intern'
|
||||
incs += ' ../gpu'
|
||||
|
||||
incs += ' ' + env['BF_ZLIB_INC']
|
||||
incs = [
|
||||
'.',
|
||||
'./intern',
|
||||
'#/intern/guardedalloc',
|
||||
'#/intern/bsp/extern',
|
||||
'#/intern/elbeem/extern',
|
||||
'#/extern/glew/include',
|
||||
'#/intern/opennl/extern',
|
||||
'../render/extern/include',
|
||||
'../blenloader',
|
||||
'../bmesh',
|
||||
'../include',
|
||||
'../blenlib',
|
||||
'../blenfont',
|
||||
'../makesdna',
|
||||
'../makesrna',
|
||||
'../blenkernel',
|
||||
'../gpu',
|
||||
env['BF_ZLIB_INC'],
|
||||
]
|
||||
|
||||
defs = []
|
||||
|
||||
@@ -43,7 +56,7 @@ if env ['WITH_BF_BOOLEAN']:
|
||||
defs.append('WITH_MOD_BOOLEAN')
|
||||
|
||||
if env['WITH_BF_REMESH']:
|
||||
incs += ' #/intern/dualcon'
|
||||
incs.append('#/intern/dualcon')
|
||||
defs.append('WITH_MOD_REMESH')
|
||||
|
||||
if env['WITH_BF_FLUID']:
|
||||
@@ -53,12 +66,12 @@ if env['WITH_BF_OCEANSIM']:
|
||||
defs.append('WITH_OCEANSIM')
|
||||
|
||||
if env['WITH_BF_GAMEENGINE']:
|
||||
incs += ' #/extern/recastnavigation'
|
||||
incs.append('#/extern/recastnavigation')
|
||||
defs.append('WITH_GAMEENGINE')
|
||||
|
||||
if env['WITH_BF_INTERNATIONAL']:
|
||||
defs.append('WITH_INTERNATIONAL')
|
||||
|
||||
env.BlenderLib ( libname = 'bf_modifiers', sources = sources,
|
||||
includes = Split(incs), defines=defs,
|
||||
libtype=['core','player'], priority = [80, 40] )
|
||||
env.BlenderLib(libname='bf_modifiers', sources=sources,
|
||||
includes=incs, defines=defs,
|
||||
libtype=['core', 'player'], priority=[80, 40])
|
||||
|
@@ -47,50 +47,6 @@
|
||||
|
||||
#include "MOD_util.h"
|
||||
|
||||
/* -------------------------------------------------------------------- */
|
||||
/* Utility function shared by formats */
|
||||
void MOD_meshcache_calc_range(const float frame, const char interp,
|
||||
const int frame_tot,
|
||||
int r_index_range[2], float *r_factor)
|
||||
{
|
||||
if (interp == MOD_MESHCACHE_INTERP_NONE) {
|
||||
r_index_range[0] = r_index_range[1] = max_ii(0, min_ii(frame_tot - 1, (int)(floorf(frame) + 0.5f)));
|
||||
*r_factor = 1.0f; /* dummy */
|
||||
}
|
||||
else {
|
||||
const float tframe = floorf(frame);
|
||||
const float range = frame - tframe;
|
||||
r_index_range[0] = (int)tframe;
|
||||
if (range <= FRAME_SNAP_EPS) {
|
||||
/* we're close enough not to need blending */
|
||||
r_index_range[1] = r_index_range[0];
|
||||
*r_factor = 1.0f; /* dummy */
|
||||
}
|
||||
else {
|
||||
/* blend between 2 frames */
|
||||
r_index_range[1] = r_index_range[0] + 1;
|
||||
*r_factor = range;
|
||||
}
|
||||
|
||||
/* clamp */
|
||||
if ((r_index_range[0] >= frame_tot) ||
|
||||
(r_index_range[1] >= frame_tot))
|
||||
{
|
||||
r_index_range[0] = r_index_range[1] = frame_tot - 1;
|
||||
*r_factor = 1.0f; /* dummy */
|
||||
}
|
||||
else if ((r_index_range[0] < 0) ||
|
||||
(r_index_range[1] < 0))
|
||||
{
|
||||
r_index_range[0] = r_index_range[1] = 0;
|
||||
*r_factor = 1.0f; /* dummy */
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/* -------------------------------------------------------------------- */
|
||||
|
||||
static void initData(ModifierData *md)
|
||||
{
|
||||
MeshCacheModifierData *mcmd = (MeshCacheModifierData *)md;
|
||||
|
67
source/blender/modifiers/intern/MOD_meshcache_util.c
Normal file
67
source/blender/modifiers/intern/MOD_meshcache_util.c
Normal file
@@ -0,0 +1,67 @@
|
||||
/*
|
||||
* ***** BEGIN GPL LICENSE BLOCK *****
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation; either version 2
|
||||
* of the License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*
|
||||
* Contributor(s): Campbell Barton
|
||||
*
|
||||
* ***** END GPL LICENSE BLOCK *****
|
||||
*/
|
||||
|
||||
#include "BLI_utildefines.h"
|
||||
#include "BLI_math.h"
|
||||
|
||||
#include "DNA_modifier_types.h"
|
||||
|
||||
#include "MOD_meshcache_util.h"
|
||||
|
||||
void MOD_meshcache_calc_range(const float frame, const char interp,
|
||||
const int frame_tot,
|
||||
int r_index_range[2], float *r_factor)
|
||||
{
|
||||
if (interp == MOD_MESHCACHE_INTERP_NONE) {
|
||||
r_index_range[0] = r_index_range[1] = max_ii(0, min_ii(frame_tot - 1, (int)(floorf(frame) + 0.5f)));
|
||||
*r_factor = 1.0f; /* dummy */
|
||||
}
|
||||
else {
|
||||
const float tframe = floorf(frame);
|
||||
const float range = frame - tframe;
|
||||
r_index_range[0] = (int)tframe;
|
||||
if (range <= FRAME_SNAP_EPS) {
|
||||
/* we're close enough not to need blending */
|
||||
r_index_range[1] = r_index_range[0];
|
||||
*r_factor = 1.0f; /* dummy */
|
||||
}
|
||||
else {
|
||||
/* blend between 2 frames */
|
||||
r_index_range[1] = r_index_range[0] + 1;
|
||||
*r_factor = range;
|
||||
}
|
||||
|
||||
/* clamp */
|
||||
if ((r_index_range[0] >= frame_tot) ||
|
||||
(r_index_range[1] >= frame_tot))
|
||||
{
|
||||
r_index_range[0] = r_index_range[1] = frame_tot - 1;
|
||||
*r_factor = 1.0f; /* dummy */
|
||||
}
|
||||
else if ((r_index_range[0] < 0) ||
|
||||
(r_index_range[1] < 0))
|
||||
{
|
||||
r_index_range[0] = r_index_range[1] = 0;
|
||||
*r_factor = 1.0f; /* dummy */
|
||||
}
|
||||
}
|
||||
}
|
@@ -47,7 +47,7 @@
|
||||
|
||||
#include "MOD_modifiertypes.h"
|
||||
|
||||
#include "CCGSubSurf.h"
|
||||
#include "intern/CCGSubSurf.h"
|
||||
|
||||
static void initData(ModifierData *md)
|
||||
{
|
||||
|
Reference in New Issue
Block a user