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
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2010-09-12 16:27:12 +0400
committerCampbell Barton <ideasman42@gmail.com>2010-09-12 16:27:12 +0400
commit74059891e9f3652c4164257e4980c68e1349ec91 (patch)
tree67d0d468c00da39bbead70d6cc073412cd8a3c9d
parentd0a1b76fe4c50dde3df124caec447dab93b6e90e (diff)
option to disable ITASC IK solver, (will be enabled by default ofcourse)
- option only available to cmake, scons and make have this enabled always. - without this clang/llvm can compile blender - this was the second biggest internal lib, 192mb -> 172mb for all blenders libs (with debug flags), so gives some speedup to linking.
-rw-r--r--CMakeLists.txt1
-rw-r--r--intern/CMakeLists.txt5
-rw-r--r--source/blender/ikplugin/BIK_api.h1
-rw-r--r--source/blender/ikplugin/CMakeLists.txt23
-rw-r--r--source/blender/ikplugin/SConscript6
-rw-r--r--source/blender/ikplugin/intern/Makefile3
-rw-r--r--source/blender/ikplugin/intern/ikplugin_api.c12
-rw-r--r--source/blender/ikplugin/intern/itasc_plugin.cpp2
-rw-r--r--source/creator/CMakeLists.txt6
9 files changed, 44 insertions, 15 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 4fdc6b9ebf6..3b807d1c6bf 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -70,6 +70,7 @@ OPTION(WITH_LCMS "Enable color correction with lcms" OFF)
OPTION(WITH_PYTHON "Enable Embedded Python API" ON)
OPTION(WITH_BUILDINFO "Include extra build details" ON)
OPTION(WITH_FLUID "Enable Elbeem (Fluid Simulation)" ON)
+OPTION(WITH_IK_ITASC "Enable ITASC IK solver" ON)
OPTION(WITH_FFTW3 "Enable FFTW3 support (Used for smoke and audio effects)" OFF)
OPTION(WITH_BULLET "Enable Bullet (Physics Engine)" ON)
OPTION(WITH_GAMEENGINE "Enable Game Engine" ON)
diff --git a/intern/CMakeLists.txt b/intern/CMakeLists.txt
index d64029a6671..acc13fb0e33 100644
--- a/intern/CMakeLists.txt
+++ b/intern/CMakeLists.txt
@@ -33,7 +33,6 @@ ADD_SUBDIRECTORY(container)
ADD_SUBDIRECTORY(memutil)
ADD_SUBDIRECTORY(decimation)
ADD_SUBDIRECTORY(iksolver)
-ADD_SUBDIRECTORY(itasc)
ADD_SUBDIRECTORY(boolop)
ADD_SUBDIRECTORY(opennl)
ADD_SUBDIRECTORY(smoke)
@@ -42,4 +41,8 @@ IF(WITH_FLUID)
ADD_SUBDIRECTORY(elbeem)
ENDIF(WITH_FLUID)
+IF(WITH_IK_ITASC)
+ ADD_SUBDIRECTORY(itasc)
+ENDIF(WITH_IK_ITASC)
+
ADD_SUBDIRECTORY(bsp)
diff --git a/source/blender/ikplugin/BIK_api.h b/source/blender/ikplugin/BIK_api.h
index 0f0703486a3..0f4fea89c37 100644
--- a/source/blender/ikplugin/BIK_api.h
+++ b/source/blender/ikplugin/BIK_api.h
@@ -73,7 +73,6 @@ int BIK_get_solver_param(struct bPose *pose, struct bPoseChannel *pchan, int id,
// number of solver available
// 0 = iksolver
// 1 = iTaSC
-#define BIK_SOLVER_COUNT 2
/* for use in BIK_get_constraint_param */
#define BIK_PARAM_CONSTRAINT_ERROR 0
diff --git a/source/blender/ikplugin/CMakeLists.txt b/source/blender/ikplugin/CMakeLists.txt
index ef1f4d450b9..79f33effb87 100644
--- a/source/blender/ikplugin/CMakeLists.txt
+++ b/source/blender/ikplugin/CMakeLists.txt
@@ -24,12 +24,27 @@
#
# ***** END GPL LICENSE BLOCK *****
-FILE(GLOB SRC intern/*.c intern/*.cpp)
+
+SET(SRC
+ ./intern/ikplugin_api.c
+ ./intern/iksolver_plugin.c
+)
SET(INC
- ../../../intern/guardedalloc ../../../intern/iksolver/extern
- ../../../intern/itasc ../../../extern/Eigen2
- ../blenlib ../makesdna ../blenkernel ../include ../ikplugin
+ ../blenlib
+ ../makesdna
+ ../blenkernel
+ ../include
+ ../ikplugin
+ ../../../intern/guardedalloc
+ ../../../intern/iksolver/extern
)
+IF(WITH_IK_ITASC)
+ ADD_DEFINITIONS(-DWITH_IK_ITASC)
+ LIST(APPEND INC ../../../extern/Eigen2)
+ LIST(APPEND INC ../../../intern/itasc)
+ LIST(APPEND SRC ./intern/itasc_plugin.cpp)
+ENDIF(WITH_IK_ITASC)
+
BLENDERLIB(bf_ikplugin "${SRC}" "${INC}")
diff --git a/source/blender/ikplugin/SConscript b/source/blender/ikplugin/SConscript
index a745a93077a..f60c42f8dc9 100644
--- a/source/blender/ikplugin/SConscript
+++ b/source/blender/ikplugin/SConscript
@@ -1,9 +1,11 @@
#!/usr/bin/python
Import ('env')
-
+defs = []
sources = env.Glob('intern/*.c') + env.Glob('intern/*.cpp')
incs = '#/intern/guardedalloc #/intern/iksolver/extern ../makesdna ../blenlib'
incs += ' ../blenkernel ../include ../ikplugin #/intern/itasc #/extern/Eigen2'
-env.BlenderLib ( 'bf_ikplugin', sources, Split(incs), [], libtype=['core','player'], priority=[180, 190] )
+defs.append('WITH_IK_ITASC')
+
+env.BlenderLib ( 'bf_ikplugin', sources, Split(incs), defs, libtype=['core','player'], priority=[180, 190] )
diff --git a/source/blender/ikplugin/intern/Makefile b/source/blender/ikplugin/intern/Makefile
index 352ab90df9d..12e2366b28e 100644
--- a/source/blender/ikplugin/intern/Makefile
+++ b/source/blender/ikplugin/intern/Makefile
@@ -30,6 +30,9 @@ DIR = $(OCGDIR)/blender/ikplugin
include nan_compile.mk
+CFLAGS += -DWITH_IK_ITASC
+CPPFLAGS += -DWITH_IK_ITASC
+
CFLAGS += $(LEVEL_1_C_WARNINGS)
CFLAGS += -I$(NAN_GUARDEDALLOC)/include
CFLAGS += -I../../makesdna
diff --git a/source/blender/ikplugin/intern/ikplugin_api.c b/source/blender/ikplugin/intern/ikplugin_api.c
index cdc4ee11518..c3310e77ad6 100644
--- a/source/blender/ikplugin/intern/ikplugin_api.c
+++ b/source/blender/ikplugin/intern/ikplugin_api.c
@@ -42,10 +42,12 @@
#include "ikplugin_api.h"
#include "iksolver_plugin.h"
-#include "itasc_plugin.h"
+#ifdef WITH_IK_ITASC
+#include "itasc_plugin.h"
+#endif
-static IKPlugin ikplugin_tab[BIK_SOLVER_COUNT] = {
+static IKPlugin ikplugin_tab[] = {
/* Legacy IK solver */
{
iksolver_initialize_tree,
@@ -55,6 +57,7 @@ static IKPlugin ikplugin_tab[BIK_SOLVER_COUNT] = {
NULL,
NULL,
NULL,
+#ifdef WITH_IK_ITASC
},
/* iTaSC IK solver */
{
@@ -65,13 +68,13 @@ static IKPlugin ikplugin_tab[BIK_SOLVER_COUNT] = {
itasc_clear_cache,
itasc_update_param,
itasc_test_constraint,
+#endif
}
};
-
static IKPlugin *get_plugin(bPose *pose)
{
- if (!pose || pose->iksolver < 0 || pose->iksolver >= BIK_SOLVER_COUNT)
+ if (!pose || pose->iksolver < 0 || pose->iksolver >= (sizeof(ikplugin_tab) / sizeof(IKPlugin)))
return NULL;
return &ikplugin_tab[pose->iksolver];
@@ -135,3 +138,4 @@ void BIK_test_constraint(struct Object *ob, struct bConstraint *cons)
if (plugin && plugin->test_constraint)
plugin->test_constraint(ob, cons);
}
+
diff --git a/source/blender/ikplugin/intern/itasc_plugin.cpp b/source/blender/ikplugin/intern/itasc_plugin.cpp
index af69cb9a996..7bdc327afa1 100644
--- a/source/blender/ikplugin/intern/itasc_plugin.cpp
+++ b/source/blender/ikplugin/intern/itasc_plugin.cpp
@@ -32,6 +32,7 @@
#include <vector>
// iTaSC headers
+#ifdef WITH_IK_ITASC
#include "Armature.hpp"
#include "MovingFrame.hpp"
#include "CopyPose.hpp"
@@ -40,6 +41,7 @@
#include "Scene.hpp"
#include "Cache.hpp"
#include "Distance.hpp"
+#endif
#include "MEM_guardedalloc.h"
diff --git a/source/creator/CMakeLists.txt b/source/creator/CMakeLists.txt
index 89eb5ea97c1..ea2529f1875 100644
--- a/source/creator/CMakeLists.txt
+++ b/source/creator/CMakeLists.txt
@@ -561,9 +561,9 @@ ENDIF(CMAKE_SYSTEM_NAME MATCHES "Linux")
LIST(APPEND BLENDER_SORTED_LIBS bf_intern_guardedalloc_cpp)
ENDIF(WITH_CXX_GUARDEDALLOC)
- IF(WITH_QUICKTIME)
- LIST(APPEND BLENDER_SORTED_LIBS bf_quicktime)
- ENDIF(WITH_QUICKTIME)
+ IF(WITH_IK_ITASC)
+ LIST(APPEND BLENDER_SORTED_LIBS bf_intern_itasc)
+ ENDIF(WITH_IK_ITASC)
FOREACH(SORTLIB ${BLENDER_SORTED_LIBS})