Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/source
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2013-11-25 08:33:41 +0400
committerCampbell Barton <ideasman42@gmail.com>2013-11-25 08:36:19 +0400
commit2b4c68b902b261127f7deabf922048c41be6fb55 (patch)
tree1c40311a6c8e13ea4754fc692283b11cafdb8bea /source
parent295116ea6b3a81a6c7b84d8a9d21288108c5f19e (diff)
CMake Build: option to compile without opennl/superlu.
Diffstat (limited to 'source')
-rw-r--r--source/blender/bmesh/CMakeLists.txt8
-rw-r--r--source/blender/bmesh/operators/bmo_smooth_laplacian.c16
-rw-r--r--source/blender/editors/armature/CMakeLists.txt8
-rw-r--r--source/blender/editors/armature/armature_skinning.c6
-rw-r--r--source/blender/editors/armature/meshlaplacian.c15
-rw-r--r--source/blender/editors/uvedit/CMakeLists.txt8
-rw-r--r--source/blender/editors/uvedit/uvedit_parametrizer.c39
-rw-r--r--source/blender/modifiers/CMakeLists.txt8
-rw-r--r--source/blender/modifiers/intern/MOD_laplaciandeform.c16
-rw-r--r--source/blender/modifiers/intern/MOD_laplaciansmooth.c102
-rw-r--r--source/creator/CMakeLists.txt5
11 files changed, 171 insertions, 60 deletions
diff --git a/source/blender/bmesh/CMakeLists.txt b/source/blender/bmesh/CMakeLists.txt
index b80a10b43fe..afb8b07b1a6 100644
--- a/source/blender/bmesh/CMakeLists.txt
+++ b/source/blender/bmesh/CMakeLists.txt
@@ -31,7 +31,6 @@ set(INC
../makesdna
../../../intern/guardedalloc
../../../extern/rangetree
- ../../../intern/opennl/extern
)
set(INC_SYS
@@ -160,6 +159,13 @@ if(WITH_INTERNATIONAL)
add_definitions(-DWITH_INTERNATIONAL)
endif()
+if(WITH_OPENNL)
+ add_definitions(-DWITH_OPENNL)
+ list(APPEND INC_SYS
+ ../../../intern/opennl/extern
+ )
+endif()
+
if(WITH_FREESTYLE)
add_definitions(-DWITH_FREESTYLE)
endif()
diff --git a/source/blender/bmesh/operators/bmo_smooth_laplacian.c b/source/blender/bmesh/operators/bmo_smooth_laplacian.c
index 3f04e23aa73..16e70e8c155 100644
--- a/source/blender/bmesh/operators/bmo_smooth_laplacian.c
+++ b/source/blender/bmesh/operators/bmo_smooth_laplacian.c
@@ -34,10 +34,12 @@
#include "bmesh.h"
-#include "ONL_opennl.h"
-
#include "intern/bmesh_operators_private.h" /* own include */
+#ifdef WITH_OPENNL
+
+#include "ONL_opennl.h"
+
// #define SMOOTH_LAPLACIAN_AREA_FACTOR 4.0f /* UNUSED */
// #define SMOOTH_LAPLACIAN_EDGE_FACTOR 2.0f /* UNUSED */
#define SMOOTH_LAPLACIAN_MAX_EDGE_PERCENTAGE 1.8f
@@ -572,3 +574,13 @@ void bmo_smooth_laplacian_vert_exec(BMesh *bm, BMOperator *op)
delete_laplacian_system(sys);
}
+
+#else /* WITH_OPENNL */
+
+#ifdef __GNUC__
+# pragma GCC diagnostic ignored "-Wunused-parameter"
+#endif
+
+void bmo_smooth_laplacian_vert_exec(BMesh *bm, BMOperator *op) {}
+
+#endif /* WITH_OPENNL */
diff --git a/source/blender/editors/armature/CMakeLists.txt b/source/blender/editors/armature/CMakeLists.txt
index 1a0841f5342..ca2dc1b66e2 100644
--- a/source/blender/editors/armature/CMakeLists.txt
+++ b/source/blender/editors/armature/CMakeLists.txt
@@ -27,7 +27,6 @@ set(INC
../../makesrna
../../windowmanager
../../../../intern/guardedalloc
- ../../../../intern/opennl/extern
)
set(INC_SYS
@@ -67,4 +66,11 @@ if(WITH_INTERNATIONAL)
add_definitions(-DWITH_INTERNATIONAL)
endif()
+if(WITH_OPENNL)
+ add_definitions(-DWITH_OPENNL)
+ list(APPEND INC_SYS
+ ../../../../intern/opennl/extern
+ )
+endif()
+
blender_add_lib(bf_editor_armature "${SRC}" "${INC}" "${INC_SYS}")
diff --git a/source/blender/editors/armature/armature_skinning.c b/source/blender/editors/armature/armature_skinning.c
index 5f15d15d478..7ec0acf12d1 100644
--- a/source/blender/editors/armature/armature_skinning.c
+++ b/source/blender/editors/armature/armature_skinning.c
@@ -386,9 +386,13 @@ static void add_verts_to_dgroups(ReportList *reports, Scene *scene, Object *ob,
/* compute the weights based on gathered vertices and bones */
if (heat) {
const char *error = NULL;
+
+#ifdef WITH_OPENNL
heat_bone_weighting(ob, mesh, verts, numbones, dgrouplist, dgroupflip,
root, tip, selected, &error);
-
+#else
+ error = "Built without OpenNL";
+#endif
if (error) {
BKE_report(reports, RPT_WARNING, error);
}
diff --git a/source/blender/editors/armature/meshlaplacian.c b/source/blender/editors/armature/meshlaplacian.c
index 16d7f9c9420..3b285e12331 100644
--- a/source/blender/editors/armature/meshlaplacian.c
+++ b/source/blender/editors/armature/meshlaplacian.c
@@ -46,13 +46,14 @@
#include "BLI_polardecomp.h"
#endif
-#include "ONL_opennl.h"
-
#include "ED_mesh.h"
#include "ED_armature.h"
#include "meshlaplacian.h"
+#ifdef WITH_OPENNL
+
+#include "ONL_opennl.h"
/* ************* XXX *************** */
static void waitcursor(int UNUSED(val)) {}
@@ -2006,3 +2007,13 @@ void mesh_deform_bind(Scene *scene, MeshDeformModifierData *mmd, float *vertexco
waitcursor(0);
}
+#else /* WITH_OPENNL */
+
+#ifdef __GNUC__
+# pragma GCC diagnostic ignored "-Wunused-parameter"
+#endif
+
+void mesh_deform_bind(Scene *scene, MeshDeformModifierData *mmd, float *vertexcos, int totvert, float cagemat[4][4]) {}
+void *modifier_mdef_compact_influences_link_kludge = modifier_mdef_compact_influences;
+
+#endif /* WITH_OPENNL */
diff --git a/source/blender/editors/uvedit/CMakeLists.txt b/source/blender/editors/uvedit/CMakeLists.txt
index 62d4b01cab7..45edbde7482 100644
--- a/source/blender/editors/uvedit/CMakeLists.txt
+++ b/source/blender/editors/uvedit/CMakeLists.txt
@@ -28,7 +28,6 @@ set(INC
../../makesrna
../../windowmanager
../../../../intern/guardedalloc
- ../../../../intern/opennl/extern
)
set(INC_SYS
@@ -51,4 +50,11 @@ if(WITH_INTERNATIONAL)
add_definitions(-DWITH_INTERNATIONAL)
endif()
+if(WITH_OPENNL)
+ add_definitions(-DWITH_OPENNL)
+ list(APPEND INC_SYS
+ ../../../../intern/opennl/extern
+ )
+endif()
+
blender_add_lib(bf_editor_uvedit "${SRC}" "${INC}" "${INC_SYS}")
diff --git a/source/blender/editors/uvedit/uvedit_parametrizer.c b/source/blender/editors/uvedit/uvedit_parametrizer.c
index 2d33a2d3937..e5c3510db4b 100644
--- a/source/blender/editors/uvedit/uvedit_parametrizer.c
+++ b/source/blender/editors/uvedit/uvedit_parametrizer.c
@@ -35,8 +35,6 @@
#include "BLI_boxpack2d.h"
#include "BLI_convexhull2d.h"
-#include "ONL_opennl.h"
-
#include "uvedit_intern.h"
#include "uvedit_parametrizer.h"
@@ -47,6 +45,10 @@
#include "BLI_sys_types.h" /* for intptr_t support */
+#ifdef WITH_OPENNL
+
+#include "ONL_opennl.h"
+
/* Utils */
#if 0
@@ -4715,3 +4717,36 @@ void param_flush_restore(ParamHandle *handle)
}
}
+#else /* WITH_OPENNL */
+
+#ifdef __GNUC__
+# pragma GCC diagnostic ignored "-Wunused-parameter"
+#endif
+
+/* stubs */
+void param_face_add(ParamHandle *handle, ParamKey key, int nverts,
+ ParamKey *vkeys, float **co, float **uv,
+ ParamBool *pin, ParamBool *select, float normal[3]) {}
+void param_edge_set_seam(ParamHandle *handle,
+ ParamKey *vkeys) {}
+void param_aspect_ratio(ParamHandle *handle, float aspx, float aspy) {}
+ParamHandle *param_construct_begin(void) { return NULL; }
+void param_construct_end(ParamHandle *handle, ParamBool fill, ParamBool impl) {}
+void param_delete(ParamHandle *handle) {}
+
+void param_stretch_begin(ParamHandle *handle) {}
+void param_stretch_blend(ParamHandle *handle, float blend) {}
+void param_stretch_iter(ParamHandle *handle) {}
+void param_stretch_end(ParamHandle *handle) {}
+
+void param_pack(ParamHandle *handle, float margin, bool do_rotate) {}
+void param_average(ParamHandle *handle) {}
+
+void param_flush(ParamHandle *handle) {}
+void param_flush_restore(ParamHandle *handle) {}
+
+void param_lscm_begin(ParamHandle *handle, ParamBool live, ParamBool abf) {}
+void param_lscm_solve(ParamHandle *handle) {}
+void param_lscm_end(ParamHandle *handle) {}
+
+#endif /* WITH_OPENNL */
diff --git a/source/blender/modifiers/CMakeLists.txt b/source/blender/modifiers/CMakeLists.txt
index 450501c9db5..4eb15c0fbdb 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/opennl/extern
)
set(INC_SYS
@@ -146,4 +145,11 @@ if(WITH_INTERNATIONAL)
add_definitions(-DWITH_INTERNATIONAL)
endif()
+if(WITH_OPENNL)
+ add_definitions(-DWITH_OPENNL)
+ list(APPEND INC_SYS
+ ../../../intern/opennl/extern
+ )
+endif()
+
blender_add_lib(bf_modifiers "${SRC}" "${INC}" "${INC_SYS}")
diff --git a/source/blender/modifiers/intern/MOD_laplaciandeform.c b/source/blender/modifiers/intern/MOD_laplaciandeform.c
index 3b909a4b209..a8a6f1a1cb9 100644
--- a/source/blender/modifiers/intern/MOD_laplaciandeform.c
+++ b/source/blender/modifiers/intern/MOD_laplaciandeform.c
@@ -41,7 +41,6 @@
#include "MOD_util.h"
-#include "ONL_opennl.h"
enum {
LAPDEFORM_SYSTEM_NOT_CHANGE = 0,
@@ -54,6 +53,10 @@ enum {
LAPDEFORM_SYSTEM_CHANGE_NOT_VALID_GROUP,
};
+#ifdef WITH_OPENNL
+
+#include "ONL_opennl.h"
+
typedef struct LaplacianSystem {
bool is_matrix_computed;
bool has_solution;
@@ -766,6 +769,14 @@ static void LaplacianDeformModifier_do(
}
}
+#else /* WITH_OPENNL */
+static void LaplacianDeformModifier_do(
+ LaplacianDeformModifierData *lmd, Object *ob, DerivedMesh *dm,
+ float (*vertexCos)[3], int numVerts)
+{
+ (void)lmd, (void)ob, (void)dm, (void)vertexCos, (void)numVerts;
+}
+#endif /* WITH_OPENNL */
static void initData(ModifierData *md)
{
@@ -831,11 +842,12 @@ static void deformVertsEM(
static void freeData(ModifierData *md)
{
LaplacianDeformModifierData *lmd = (LaplacianDeformModifierData *)md;
+#ifdef WITH_OPENNL
LaplacianSystem *sys = (LaplacianSystem *)lmd->cache_system;
-
if (sys) {
deleteLaplacianSystem(sys);
}
+#endif
MEM_SAFE_FREE(lmd->vertexco);
lmd->total_verts = 0;
}
diff --git a/source/blender/modifiers/intern/MOD_laplaciansmooth.c b/source/blender/modifiers/intern/MOD_laplaciansmooth.c
index 3843ee6f535..f97818a02d4 100644
--- a/source/blender/modifiers/intern/MOD_laplaciansmooth.c
+++ b/source/blender/modifiers/intern/MOD_laplaciansmooth.c
@@ -50,6 +50,8 @@
#include "MOD_modifiertypes.h"
#include "MOD_util.h"
+#ifdef WITH_OPENNL
+
#include "ONL_opennl.h"
#if 0
@@ -195,52 +197,6 @@ static LaplacianSystem *init_laplacian_system(int a_numEdges, int a_numFaces, in
return sys;
}
-static void init_data(ModifierData *md)
-{
- LaplacianSmoothModifierData *smd = (LaplacianSmoothModifierData *) md;
- smd->lambda = 0.01f;
- smd->lambda_border = 0.01f;
- smd->repeat = 1;
- smd->flag = MOD_LAPLACIANSMOOTH_X | MOD_LAPLACIANSMOOTH_Y | MOD_LAPLACIANSMOOTH_Z | MOD_LAPLACIANSMOOTH_PRESERVE_VOLUME | MOD_LAPLACIANSMOOTH_NORMALIZED;
- smd->defgrp_name[0] = '\0';
-}
-
-static void copy_data(ModifierData *md, ModifierData *target)
-{
- LaplacianSmoothModifierData *smd = (LaplacianSmoothModifierData *) md;
- LaplacianSmoothModifierData *tsmd = (LaplacianSmoothModifierData *) target;
-
- tsmd->lambda = smd->lambda;
- tsmd->lambda_border = smd->lambda_border;
- tsmd->repeat = smd->repeat;
- tsmd->flag = smd->flag;
- BLI_strncpy(tsmd->defgrp_name, smd->defgrp_name, sizeof(tsmd->defgrp_name));
-}
-
-static bool is_disabled(ModifierData *md, int UNUSED(useRenderParams))
-{
- LaplacianSmoothModifierData *smd = (LaplacianSmoothModifierData *) md;
- short flag;
-
- flag = smd->flag & (MOD_LAPLACIANSMOOTH_X | MOD_LAPLACIANSMOOTH_Y | MOD_LAPLACIANSMOOTH_Z);
-
- /* disable if modifier is off for X, Y and Z or if factor is 0 */
- if (flag == 0) return 1;
-
- return 0;
-}
-
-static CustomDataMask required_data_mask(Object *UNUSED(ob), ModifierData *md)
-{
- LaplacianSmoothModifierData *smd = (LaplacianSmoothModifierData *)md;
- CustomDataMask dataMask = 0;
-
- /* ask for vertexgroups if we need them */
- if (smd->defgrp_name[0]) dataMask |= CD_MASK_MDEFORMVERT;
-
- return dataMask;
-}
-
static float average_area_quad_v3(float *v1, float *v2, float *v3, float *v4)
{
float areaq;
@@ -663,7 +619,61 @@ static void laplaciansmoothModifier_do(
nlDeleteContext(sys->context);
sys->context = NULL;
delete_laplacian_system(sys);
+}
+
+#else /* WITH_OPENNL */
+static void laplaciansmoothModifier_do(
+ LaplacianSmoothModifierData *smd, Object *ob, DerivedMesh *dm,
+ float (*vertexCos)[3], int numVerts)
+{
+ (void)smd, (void)ob, (void)dm, (void)vertexCos, (void)numVerts;
+}
+#endif /* WITH_OPENNL */
+static void init_data(ModifierData *md)
+{
+ LaplacianSmoothModifierData *smd = (LaplacianSmoothModifierData *) md;
+ smd->lambda = 0.01f;
+ smd->lambda_border = 0.01f;
+ smd->repeat = 1;
+ smd->flag = MOD_LAPLACIANSMOOTH_X | MOD_LAPLACIANSMOOTH_Y | MOD_LAPLACIANSMOOTH_Z | MOD_LAPLACIANSMOOTH_PRESERVE_VOLUME | MOD_LAPLACIANSMOOTH_NORMALIZED;
+ smd->defgrp_name[0] = '\0';
+}
+
+static void copy_data(ModifierData *md, ModifierData *target)
+{
+ LaplacianSmoothModifierData *smd = (LaplacianSmoothModifierData *) md;
+ LaplacianSmoothModifierData *tsmd = (LaplacianSmoothModifierData *) target;
+
+ tsmd->lambda = smd->lambda;
+ tsmd->lambda_border = smd->lambda_border;
+ tsmd->repeat = smd->repeat;
+ tsmd->flag = smd->flag;
+ BLI_strncpy(tsmd->defgrp_name, smd->defgrp_name, sizeof(tsmd->defgrp_name));
+}
+
+static bool is_disabled(ModifierData *md, int UNUSED(useRenderParams))
+{
+ LaplacianSmoothModifierData *smd = (LaplacianSmoothModifierData *) md;
+ short flag;
+
+ flag = smd->flag & (MOD_LAPLACIANSMOOTH_X | MOD_LAPLACIANSMOOTH_Y | MOD_LAPLACIANSMOOTH_Z);
+
+ /* disable if modifier is off for X, Y and Z or if factor is 0 */
+ if (flag == 0) return 1;
+
+ return 0;
+}
+
+static CustomDataMask required_data_mask(Object *UNUSED(ob), ModifierData *md)
+{
+ LaplacianSmoothModifierData *smd = (LaplacianSmoothModifierData *)md;
+ CustomDataMask dataMask = 0;
+
+ /* ask for vertexgroups if we need them */
+ if (smd->defgrp_name[0]) dataMask |= CD_MASK_MDEFORMVERT;
+
+ return dataMask;
}
static void deformVerts(ModifierData *md, Object *ob, DerivedMesh *derivedData,
diff --git a/source/creator/CMakeLists.txt b/source/creator/CMakeLists.txt
index cb745d46fa4..2a355bd5606 100644
--- a/source/creator/CMakeLists.txt
+++ b/source/creator/CMakeLists.txt
@@ -932,7 +932,6 @@ endif()
bf_editor_io
bf_render
- bf_intern_opennl
bf_python
bf_python_ext
bf_python_mathutils
@@ -1061,6 +1060,10 @@ endif()
list(APPEND BLENDER_SORTED_LIBS bf_intern_locale)
endif()
+ if(WITH_OPENNL)
+ list_insert_after(BLENDER_SORTED_LIBS "bf_render" "bf_intern_opennl")
+ endif()
+
if(WITH_BULLET)
list_insert_after(BLENDER_SORTED_LIBS "bf_blenkernel" "bf_intern_rigidbody")
endif()