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>2013-01-23 11:26:39 +0400
committerCampbell Barton <ideasman42@gmail.com>2013-01-23 11:26:39 +0400
commit69ddc5eb99d36c7d2cf86a7537a3784d3c72777e (patch)
tree2346cd60891c2015fc59a30576d0c99b072712cc /source/blender
parent4544c234f5baf386eae9ffd98994f9905a285aaa (diff)
make bullet optional again
Diffstat (limited to 'source/blender')
-rw-r--r--source/blender/CMakeLists.txt5
-rw-r--r--source/blender/blenkernel/CMakeLists.txt6
-rw-r--r--source/blender/blenkernel/SConscript2
-rw-r--r--source/blender/blenkernel/intern/collision.c6
-rw-r--r--source/blender/blenkernel/intern/pointcache.c8
-rw-r--r--source/blender/blenkernel/intern/rigidbody.c39
-rw-r--r--source/blender/editors/interface/interface_templates.c6
-rw-r--r--source/blender/editors/physics/CMakeLists.txt8
-rw-r--r--source/blender/editors/physics/rigidbody_world.c7
-rw-r--r--source/blender/makesrna/intern/CMakeLists.txt8
-rw-r--r--source/blender/makesrna/intern/rna_rigidbody.c167
-rw-r--r--source/blender/modifiers/intern/MOD_boolean.c2
12 files changed, 202 insertions, 62 deletions
diff --git a/source/blender/CMakeLists.txt b/source/blender/CMakeLists.txt
index db3132132da..36b05fd31f4 100644
--- a/source/blender/CMakeLists.txt
+++ b/source/blender/CMakeLists.txt
@@ -106,7 +106,10 @@ add_subdirectory(nodes)
add_subdirectory(modifiers)
add_subdirectory(makesdna)
add_subdirectory(makesrna)
-add_subdirectory(rigidbody)
+
+if(WITH_BULLET)
+ add_subdirectory(rigidbody)
+endif()
if(WITH_COMPOSITOR)
add_subdirectory(opencl) # later on this may be used more generally
diff --git a/source/blender/blenkernel/CMakeLists.txt b/source/blender/blenkernel/CMakeLists.txt
index 846ed8a9bb4..fefd4c89fbe 100644
--- a/source/blender/blenkernel/CMakeLists.txt
+++ b/source/blender/blenkernel/CMakeLists.txt
@@ -37,7 +37,6 @@ set(INC
../modifiers
../nodes
../render/extern/include
- ../rigidbody
../../../intern/guardedalloc
../../../intern/iksolver/extern
../../../intern/memutil
@@ -264,7 +263,10 @@ if(WITH_BULLET)
list(APPEND INC_SYS
${BULLET_INCLUDE_DIRS}
)
- add_definitions(-DUSE_BULLET)
+ list(APPEND INC
+ ../rigidbody
+ )
+ add_definitions(-DWITH_BULLET)
endif()
#if(WITH_MOD_CLOTH_ELTOPO)
diff --git a/source/blender/blenkernel/SConscript b/source/blender/blenkernel/SConscript
index b146235d63c..e53e4724071 100644
--- a/source/blender/blenkernel/SConscript
+++ b/source/blender/blenkernel/SConscript
@@ -111,7 +111,7 @@ if env['WITH_BF_QUICKTIME']:
incs += ' ' + env['BF_QUICKTIME_INC']
if env['WITH_BF_BULLET']:
- defs.append('USE_BULLET')
+ defs.append('WITH_BULLET')
if env['OURPLATFORM'] == 'darwin':
if env['WITH_BF_OPENMP']:
diff --git a/source/blender/blenkernel/intern/collision.c b/source/blender/blenkernel/intern/collision.c
index 60bf67e19e3..061657c8f2d 100644
--- a/source/blender/blenkernel/intern/collision.c
+++ b/source/blender/blenkernel/intern/collision.c
@@ -59,7 +59,7 @@
#include "BKE_modifier.h"
#include "BKE_DerivedMesh.h"
-#ifdef USE_BULLET
+#ifdef WITH_BULLET
#include "Bullet-C-Api.h"
#endif
#include "BLI_kdopbvh.h"
@@ -385,7 +385,7 @@ static CollPair* cloth_collision(ModifierData *md1, ModifierData *md2,
CollisionModifierData *collmd = (CollisionModifierData *) md2;
/* Cloth *cloth = clmd->clothObject; */ /* UNUSED */
MFace *face1=NULL, *face2 = NULL;
-#ifdef USE_BULLET
+#ifdef WITH_BULLET
ClothVertex *verts1 = clmd->clothObject->verts;
#endif
double distance = 0;
@@ -458,7 +458,7 @@ static CollPair* cloth_collision(ModifierData *md1, ModifierData *md2,
}
}
-#ifdef USE_BULLET
+#ifdef WITH_BULLET
// calc distance + normal
distance = plNearestPoints (
verts1[collpair->ap1].txold, verts1[collpair->ap2].txold, verts1[collpair->ap3].txold, collmd->current_x[collpair->bp1].co, collmd->current_x[collpair->bp2].co, collmd->current_x[collpair->bp3].co, collpair->pa, collpair->pb, collpair->vector );
diff --git a/source/blender/blenkernel/intern/pointcache.c b/source/blender/blenkernel/intern/pointcache.c
index 1670389566e..ef096adc7a7 100644
--- a/source/blender/blenkernel/intern/pointcache.c
+++ b/source/blender/blenkernel/intern/pointcache.c
@@ -73,7 +73,9 @@
#include "BIK_api.h"
-#include "RBI_api.h"
+#ifdef WITH_BULLET
+# include "RBI_api.h"
+#endif
/* both in intern */
#ifdef WITH_SMOKE
@@ -883,10 +885,10 @@ static int ptcache_rigidbody_write(int index, void *rb_v, void **data, int UNUS
RigidBodyOb *rbo = ob->rigidbody_object;
if (rbo->type == RBO_TYPE_ACTIVE) {
-
+#ifdef WITH_BULLET
RB_body_get_position(rbo->physics_object, rbo->pos);
RB_body_get_orientation(rbo->physics_object, rbo->orn);
-
+#endif
PTCACHE_DATA_FROM(data, BPHYS_DATA_LOCATION, rbo->pos);
PTCACHE_DATA_FROM(data, BPHYS_DATA_ROTATION, rbo->orn);
}
diff --git a/source/blender/blenkernel/intern/rigidbody.c b/source/blender/blenkernel/intern/rigidbody.c
index 4f154bce071..9feb6d43bce 100644
--- a/source/blender/blenkernel/intern/rigidbody.c
+++ b/source/blender/blenkernel/intern/rigidbody.c
@@ -42,7 +42,9 @@
#include "BLI_blenlib.h"
#include "BLI_math.h"
-#include "RBI_api.h"
+#ifdef WITH_BULLET
+# include "RBI_api.h"
+#endif
#include "DNA_anim_types.h"
#include "DNA_group_types.h"
@@ -66,6 +68,8 @@
#include "RNA_access.h"
+#ifdef WITH_BULLET
+
/* ************************************** */
/* Memory Management */
@@ -1210,3 +1214,36 @@ void BKE_rigidbody_do_simulation(Scene *scene, float ctime)
}
}
/* ************************************** */
+
+#else /* WITH_BULLET */
+
+/* stubs */
+#ifdef __GNUC__
+# pragma GCC diagnostic push
+# pragma GCC diagnostic ignored "-Wunused-parameter"
+#endif
+
+void BKE_rigidbody_free_world(RigidBodyWorld *rbw) {}
+void BKE_rigidbody_free_object(Object *ob) {}
+void BKE_rigidbody_free_constraint(Object *ob) {}
+struct RigidBodyOb *BKE_rigidbody_copy_object(Object *ob) { return NULL; }
+struct RigidBodyCon *BKE_rigidbody_copy_constraint(Object *ob) { return NULL; }
+void BKE_rigidbody_validate_sim_shape(Object *ob, short rebuild) {}
+void BKE_rigidbody_validate_sim_object(RigidBodyWorld *rbw, Object *ob, short rebuild) {}
+void BKE_rigidbody_validate_sim_constraint(RigidBodyWorld *rbw, Object *ob, short rebuild) {}
+void BKE_rigidbody_validate_sim_world(Scene *scene, RigidBodyWorld *rbw, short rebuild) {}
+struct RigidBodyWorld *BKE_rigidbody_create_world(Scene *scene) { return NULL; }
+struct RigidBodyOb *BKE_rigidbody_create_object(Scene *scene, Object *ob, short type) { return NULL; }
+struct RigidBodyCon *BKE_rigidbody_create_constraint(Scene *scene, Object *ob, short type) { return NULL; }
+struct RigidBodyWorld *BKE_rigidbody_get_world(Scene *scene) { return NULL; }
+void BKE_rigidbody_remove_object(Scene *scene, Object *ob) {}
+void BKE_rigidbody_remove_constraint(Scene *scene, Object *ob) {}
+void BKE_rigidbody_sync_transforms(Scene *scene, Object *ob, float ctime) {}
+void BKE_rigidbody_cache_reset(RigidBodyWorld *rbw) {}
+void BKE_rigidbody_do_simulation(Scene *scene, float ctime) {}
+
+#ifdef __GNUC__
+# pragma GCC diagnostic pop
+#endif
+
+#endif /* WITH_BULLET */
diff --git a/source/blender/editors/interface/interface_templates.c b/source/blender/editors/interface/interface_templates.c
index 70a367256ed..bdff02c1551 100644
--- a/source/blender/editors/interface/interface_templates.c
+++ b/source/blender/editors/interface/interface_templates.c
@@ -1606,7 +1606,7 @@ void uiTemplateIconView(uiLayout *layout, PointerRNA *ptr, const char *propname)
RNAUpdateCb *cb;
uiBlock *block;
uiBut *but;
- rctf rect;
+// rctf rect; /* UNUSED */
int icon;
if (!prop || RNA_property_type(prop) != PROP_ENUM)
@@ -1618,8 +1618,8 @@ void uiTemplateIconView(uiLayout *layout, PointerRNA *ptr, const char *propname)
cb->ptr = *ptr;
cb->prop = prop;
- rect.xmin = 0; rect.xmax = 10.0f * UI_UNIT_X;
- rect.ymin = 0; rect.ymax = 10.0f * UI_UNIT_X;
+// rect.xmin = 0; rect.xmax = 10.0f * UI_UNIT_X;
+// rect.ymin = 0; rect.ymax = 10.0f * UI_UNIT_X;
block = uiLayoutAbsoluteBlock(layout);
diff --git a/source/blender/editors/physics/CMakeLists.txt b/source/blender/editors/physics/CMakeLists.txt
index 7f3eaa892d0..435327319aa 100644
--- a/source/blender/editors/physics/CMakeLists.txt
+++ b/source/blender/editors/physics/CMakeLists.txt
@@ -27,7 +27,6 @@ set(INC
../../makesdna
../../makesrna
../../windowmanager
- ../../rigidbody
../../../../intern/elbeem/extern
../../../../intern/guardedalloc
)
@@ -63,4 +62,11 @@ if(WITH_INTERNATIONAL)
add_definitions(-DWITH_INTERNATIONAL)
endif()
+if(WITH_BULLET)
+ list(APPEND INC
+ ../../rigidbody
+ )
+ add_definitions(-DWITH_BULLET)
+endif()
+
blender_add_lib(bf_editor_physics "${SRC}" "${INC}" "${INC_SYS}")
diff --git a/source/blender/editors/physics/rigidbody_world.c b/source/blender/editors/physics/rigidbody_world.c
index 068f8decef5..5ab8e7697c5 100644
--- a/source/blender/editors/physics/rigidbody_world.c
+++ b/source/blender/editors/physics/rigidbody_world.c
@@ -40,7 +40,9 @@
#include "BLI_blenlib.h"
#include "BLI_math.h"
-#include "RBI_api.h"
+#ifdef WITH_BULLET
+# include "RBI_api.h"
+#endif
#include "BKE_context.h"
#include "BKE_depsgraph.h"
@@ -170,8 +172,9 @@ static int rigidbody_world_export_exec(bContext *C, wmOperator *op)
}
RNA_string_get(op->ptr, "filepath", path);
+#ifdef WITH_BULLET
RB_dworld_export(rbw->physics_world, path);
-
+#endif
return OPERATOR_FINISHED;
}
diff --git a/source/blender/makesrna/intern/CMakeLists.txt b/source/blender/makesrna/intern/CMakeLists.txt
index 83e7a19572d..210857a4690 100644
--- a/source/blender/makesrna/intern/CMakeLists.txt
+++ b/source/blender/makesrna/intern/CMakeLists.txt
@@ -238,6 +238,13 @@ if(WITH_INTERNATIONAL)
add_definitions(-DWITH_INTERNATIONAL)
endif()
+if(WITH_BULLET)
+ list(APPEND INC
+ ../../rigidbody
+ )
+ add_definitions(-DWITH_BULLET)
+endif()
+
# Build makesrna executable
blender_include_dirs(
.
@@ -254,7 +261,6 @@ blender_include_dirs(
../../windowmanager
../../editors/include
../../render/extern/include
- ../../rigidbody
../../../../intern/audaspace/intern
../../../../intern/cycles/blender
../../../../intern/guardedalloc
diff --git a/source/blender/makesrna/intern/rna_rigidbody.c b/source/blender/makesrna/intern/rna_rigidbody.c
index 2c8eafb4aac..7f487a646eb 100644
--- a/source/blender/makesrna/intern/rna_rigidbody.c
+++ b/source/blender/makesrna/intern/rna_rigidbody.c
@@ -73,7 +73,9 @@ EnumPropertyItem rigidbody_con_type_items[] = {
#ifdef RNA_RUNTIME
-#include "RBI_api.h"
+#ifdef WITH_BULLET
+# include "RBI_api.h"
+#endif
#include "BKE_depsgraph.h"
#include "BKE_rigidbody.h"
@@ -105,9 +107,12 @@ static void rna_RigidBodyWorld_num_solver_iterations_set(PointerRNA *ptr, int va
RigidBodyWorld *rbw = (RigidBodyWorld *)ptr->data;
rbw->num_solver_iterations = value;
-
- if (rbw->physics_world)
+
+#ifdef WITH_BULLET
+ if (rbw->physics_world) {
RB_dworld_set_solver_iterations(rbw->physics_world, value);
+ }
+#endif
}
static void rna_RigidBodyWorld_split_impulse_set(PointerRNA *ptr, int value)
@@ -115,9 +120,12 @@ static void rna_RigidBodyWorld_split_impulse_set(PointerRNA *ptr, int value)
RigidBodyWorld *rbw = (RigidBodyWorld *)ptr->data;
RB_FLAG_SET(rbw->flag, value, RBW_FLAG_USE_SPLIT_IMPULSE);
-
- if (rbw->physics_world)
+
+#ifdef WITH_BULLET
+ if (rbw->physics_world) {
RB_dworld_set_split_impulse(rbw->physics_world, value);
+ }
+#endif
}
/* ******************************** */
@@ -152,9 +160,12 @@ static void rna_RigidBodyOb_type_set(PointerRNA *ptr, int value)
rbo->type = value;
rbo->flag |= RBO_FLAG_NEEDS_VALIDATE;
+#ifdef WITH_BULLET
/* do physics sim updates */
- if (rbo->physics_object)
+ if (rbo->physics_object) {
RB_body_set_mass(rbo->physics_object, RBO_GET_MASS(rbo));
+ }
+#endif
}
static void rna_RigidBodyOb_disabled_set(PointerRNA *ptr, int value)
@@ -162,13 +173,15 @@ static void rna_RigidBodyOb_disabled_set(PointerRNA *ptr, int value)
RigidBodyOb *rbo = (RigidBodyOb *)ptr->data;
RB_FLAG_SET(rbo->flag, !value, RBO_FLAG_DISABLED);
-
+
+#ifdef WITH_BULLET
/* update kinematic state if necessary - only needed for active bodies */
if ((rbo->physics_object) && (rbo->type == RBO_TYPE_ACTIVE)) {
RB_body_set_mass(rbo->physics_object, RBO_GET_MASS(rbo));
RB_body_set_kinematic_state(rbo->physics_object, !value);
rbo->flag |= RBO_FLAG_NEEDS_VALIDATE;
}
+#endif
}
static void rna_RigidBodyOb_shape_set(PointerRNA *ptr, int value)
@@ -180,10 +193,13 @@ static void rna_RigidBodyOb_shape_set(PointerRNA *ptr, int value)
/* force creation of new collision shape reflecting this */
BKE_rigidbody_validate_sim_shape(ob, TRUE);
-
+
+#ifdef WITH_BULLET
/* now tell RB sim about it */
- if (rbo->physics_object && rbo->physics_shape)
+ if (rbo->physics_object && rbo->physics_shape) {
RB_body_set_collision_shape(rbo->physics_object, rbo->physics_shape);
+ }
+#endif
}
@@ -192,10 +208,13 @@ static void rna_RigidBodyOb_mass_set(PointerRNA *ptr, float value)
RigidBodyOb *rbo = (RigidBodyOb *)ptr->data;
rbo->mass = value;
-
+
+#ifdef WITH_BULLET
/* only active bodies need mass update */
- if ((rbo->physics_object) && (rbo->type == RBO_TYPE_ACTIVE))
+ if ((rbo->physics_object) && (rbo->type == RBO_TYPE_ACTIVE)) {
RB_body_set_mass(rbo->physics_object, RBO_GET_MASS(rbo));
+ }
+#endif
}
static void rna_RigidBodyOb_friction_set(PointerRNA *ptr, float value)
@@ -203,9 +222,12 @@ static void rna_RigidBodyOb_friction_set(PointerRNA *ptr, float value)
RigidBodyOb *rbo = (RigidBodyOb *)ptr->data;
rbo->friction = value;
-
- if (rbo->physics_object)
+
+#ifdef WITH_BULLET
+ if (rbo->physics_object) {
RB_body_set_friction(rbo->physics_object, value);
+ }
+#endif
}
static void rna_RigidBodyOb_restitution_set(PointerRNA *ptr, float value)
@@ -213,9 +235,11 @@ static void rna_RigidBodyOb_restitution_set(PointerRNA *ptr, float value)
RigidBodyOb *rbo = (RigidBodyOb *)ptr->data;
rbo->restitution = value;
-
- if (rbo->physics_object)
+#ifdef WITH_BULLET
+ if (rbo->physics_object) {
RB_body_set_restitution(rbo->physics_object, value);
+ }
+#endif
}
static void rna_RigidBodyOb_collision_margin_set(PointerRNA *ptr, float value)
@@ -223,9 +247,12 @@ static void rna_RigidBodyOb_collision_margin_set(PointerRNA *ptr, float value)
RigidBodyOb *rbo = (RigidBodyOb *)ptr->data;
rbo->margin = value;
-
- if (rbo->physics_shape)
+
+#ifdef WITH_BULLET
+ if (rbo->physics_shape) {
RB_shape_set_margin(rbo->physics_shape, RBO_GET_MARGIN(rbo));
+ }
+#endif
}
static void rna_RigidBodyOb_kinematic_state_set(PointerRNA *ptr, int value)
@@ -233,13 +260,15 @@ static void rna_RigidBodyOb_kinematic_state_set(PointerRNA *ptr, int value)
RigidBodyOb *rbo = (RigidBodyOb *)ptr->data;
RB_FLAG_SET(rbo->flag, value, RBO_FLAG_KINEMATIC);
-
+
+#ifdef WITH_BULLET
/* update kinematic state if necessary */
if (rbo->physics_object) {
RB_body_set_mass(rbo->physics_object, RBO_GET_MASS(rbo));
RB_body_set_kinematic_state(rbo->physics_object, value);
rbo->flag |= RBO_FLAG_NEEDS_VALIDATE;
}
+#endif
}
static void rna_RigidBodyOb_activation_state_set(PointerRNA *ptr, int value)
@@ -247,10 +276,13 @@ static void rna_RigidBodyOb_activation_state_set(PointerRNA *ptr, int value)
RigidBodyOb *rbo = (RigidBodyOb *)ptr->data;
RB_FLAG_SET(rbo->flag, value, RBO_FLAG_USE_DEACTIVATION);
-
+
+#ifdef WITH_BULLET
/* update activation state if necessary - only active bodies can be deactivated */
- if ((rbo->physics_object) && (rbo->type == RBO_TYPE_ACTIVE))
+ if ((rbo->physics_object) && (rbo->type == RBO_TYPE_ACTIVE)) {
RB_body_set_activation_state(rbo->physics_object, value);
+ }
+#endif
}
static void rna_RigidBodyOb_linear_sleepThresh_set(PointerRNA *ptr, float value)
@@ -258,10 +290,13 @@ static void rna_RigidBodyOb_linear_sleepThresh_set(PointerRNA *ptr, float value)
RigidBodyOb *rbo = (RigidBodyOb *)ptr->data;
rbo->lin_sleep_thresh = value;
-
+
+#ifdef WITH_BULLET
/* only active bodies need sleep threshold update */
- if ((rbo->physics_object) && (rbo->type == RBO_TYPE_ACTIVE))
+ if ((rbo->physics_object) && (rbo->type == RBO_TYPE_ACTIVE)) {
RB_body_set_linear_sleep_thresh(rbo->physics_object, value);
+ }
+#endif
}
static void rna_RigidBodyOb_angular_sleepThresh_set(PointerRNA *ptr, float value)
@@ -269,10 +304,13 @@ static void rna_RigidBodyOb_angular_sleepThresh_set(PointerRNA *ptr, float value
RigidBodyOb *rbo = (RigidBodyOb *)ptr->data;
rbo->ang_sleep_thresh = value;
-
+
+#ifdef WITH_BULLET
/* only active bodies need sleep threshold update */
- if ((rbo->physics_object) && (rbo->type == RBO_TYPE_ACTIVE))
+ if ((rbo->physics_object) && (rbo->type == RBO_TYPE_ACTIVE)) {
RB_body_set_angular_sleep_thresh(rbo->physics_object, value);
+ }
+#endif
}
static void rna_RigidBodyOb_linear_damping_set(PointerRNA *ptr, float value)
@@ -280,10 +318,13 @@ static void rna_RigidBodyOb_linear_damping_set(PointerRNA *ptr, float value)
RigidBodyOb *rbo = (RigidBodyOb *)ptr->data;
rbo->lin_damping = value;
-
+
+#ifdef WITH_BULLET
/* only active bodies need damping update */
- if ((rbo->physics_object) && (rbo->type == RBO_TYPE_ACTIVE))
+ if ((rbo->physics_object) && (rbo->type == RBO_TYPE_ACTIVE)) {
RB_body_set_linear_damping(rbo->physics_object, value);
+ }
+#endif
}
static void rna_RigidBodyOb_angular_damping_set(PointerRNA *ptr, float value)
@@ -291,10 +332,13 @@ static void rna_RigidBodyOb_angular_damping_set(PointerRNA *ptr, float value)
RigidBodyOb *rbo = (RigidBodyOb *)ptr->data;
rbo->ang_damping = value;
-
+
+#ifdef WITH_BULLET
/* only active bodies need damping update */
- if ((rbo->physics_object) && (rbo->type == RBO_TYPE_ACTIVE))
+ if ((rbo->physics_object) && (rbo->type == RBO_TYPE_ACTIVE)) {
RB_body_set_angular_damping(rbo->physics_object, value);
+ }
+#endif
}
static char *rna_RigidBodyCon_path(PointerRNA *ptr)
@@ -317,8 +361,11 @@ static void rna_RigidBodyCon_enabled_set(PointerRNA *ptr, int value)
RB_FLAG_SET(rbc->flag, value, RBC_FLAG_ENABLED);
- if (rbc->physics_constraint)
+#ifdef WITH_BULLET
+ if (rbc->physics_constraint) {
RB_constraint_set_enabled(rbc->physics_constraint, value);
+ }
+#endif
}
static void rna_RigidBodyCon_disable_collisions_set(PointerRNA *ptr, int value)
@@ -336,13 +383,19 @@ static void rna_RigidBodyCon_use_breaking_set(PointerRNA *ptr, int value)
if (value) {
rbc->flag |= RBC_FLAG_USE_BREAKING;
- if (rbc->physics_constraint)
+#ifdef WITH_BULLET
+ if (rbc->physics_constraint) {
RB_constraint_set_breaking_threshold(rbc->physics_constraint, rbc->breaking_threshold);
+ }
+#endif
}
else {
rbc->flag &= ~RBC_FLAG_USE_BREAKING;
- if (rbc->physics_constraint)
+#ifdef WITH_BULLET
+ if (rbc->physics_constraint) {
RB_constraint_set_breaking_threshold(rbc->physics_constraint, FLT_MAX);
+ }
+#endif
}
}
@@ -352,8 +405,11 @@ static void rna_RigidBodyCon_breaking_threshold_set(PointerRNA *ptr, float value
rbc->breaking_threshold = value;
- if (rbc->physics_constraint && (rbc->flag & RBC_FLAG_USE_BREAKING))
+#ifdef WITH_BULLET
+ if (rbc->physics_constraint && (rbc->flag & RBC_FLAG_USE_BREAKING)) {
RB_constraint_set_breaking_threshold(rbc->physics_constraint, value);
+ }
+#endif
}
static void rna_RigidBodyCon_override_solver_iterations_set(PointerRNA *ptr, int value)
@@ -362,13 +418,19 @@ static void rna_RigidBodyCon_override_solver_iterations_set(PointerRNA *ptr, int
if (value) {
rbc->flag |= RBC_FLAG_OVERRIDE_SOLVER_ITERATIONS;
- if (rbc->physics_constraint)
+#ifdef WITH_BULLET
+ if (rbc->physics_constraint) {
RB_constraint_set_solver_iterations(rbc->physics_constraint, rbc->num_solver_iterations);
+ }
+#endif
}
else {
rbc->flag &= ~RBC_FLAG_OVERRIDE_SOLVER_ITERATIONS;
- if (rbc->physics_constraint)
+#ifdef WITH_BULLET
+ if (rbc->physics_constraint) {
RB_constraint_set_solver_iterations(rbc->physics_constraint, -1);
+ }
+#endif
}
}
@@ -378,8 +440,11 @@ static void rna_RigidBodyCon_num_solver_iterations_set(PointerRNA *ptr, int valu
rbc->num_solver_iterations = value;
- if (rbc->physics_constraint && (rbc->flag & RBC_FLAG_OVERRIDE_SOLVER_ITERATIONS))
+#ifdef WITH_BULLET
+ if (rbc->physics_constraint && (rbc->flag & RBC_FLAG_OVERRIDE_SOLVER_ITERATIONS)) {
RB_constraint_set_solver_iterations(rbc->physics_constraint, value);
+ }
+#endif
}
static void rna_RigidBodyCon_spring_stiffness_x_set(PointerRNA *ptr, float value)
@@ -388,8 +453,11 @@ static void rna_RigidBodyCon_spring_stiffness_x_set(PointerRNA *ptr, float value
rbc->spring_stiffness_x = value;
- if (rbc->physics_constraint && rbc->type == RBC_TYPE_6DOF_SPRING && (rbc->flag & RBC_FLAG_USE_SPRING_X))
+#ifdef WITH_BULLET
+ if (rbc->physics_constraint && rbc->type == RBC_TYPE_6DOF_SPRING && (rbc->flag & RBC_FLAG_USE_SPRING_X)) {
RB_constraint_set_stiffness_6dof_spring(rbc->physics_constraint, RB_LIMIT_LIN_X, value);
+ }
+#endif
}
static void rna_RigidBodyCon_spring_stiffness_y_set(PointerRNA *ptr, float value)
@@ -398,8 +466,11 @@ static void rna_RigidBodyCon_spring_stiffness_y_set(PointerRNA *ptr, float value
rbc->spring_stiffness_y = value;
- if (rbc->physics_constraint && rbc->type == RBC_TYPE_6DOF_SPRING && (rbc->flag & RBC_FLAG_USE_SPRING_Y))
+#ifdef WITH_BULLET
+ if (rbc->physics_constraint && rbc->type == RBC_TYPE_6DOF_SPRING && (rbc->flag & RBC_FLAG_USE_SPRING_Y)) {
RB_constraint_set_stiffness_6dof_spring(rbc->physics_constraint, RB_LIMIT_LIN_Y, value);
+ }
+#endif
}
static void rna_RigidBodyCon_spring_stiffness_z_set(PointerRNA *ptr, float value)
@@ -408,8 +479,11 @@ static void rna_RigidBodyCon_spring_stiffness_z_set(PointerRNA *ptr, float value
rbc->spring_stiffness_z = value;
- if (rbc->physics_constraint && rbc->type == RBC_TYPE_6DOF_SPRING && (rbc->flag & RBC_FLAG_USE_SPRING_Z))
+#ifdef WITH_BULLET
+ if (rbc->physics_constraint && rbc->type == RBC_TYPE_6DOF_SPRING && (rbc->flag & RBC_FLAG_USE_SPRING_Z)) {
RB_constraint_set_stiffness_6dof_spring(rbc->physics_constraint, RB_LIMIT_LIN_Z, value);
+ }
+#endif
}
static void rna_RigidBodyCon_spring_damping_x_set(PointerRNA *ptr, float value)
@@ -418,8 +492,11 @@ static void rna_RigidBodyCon_spring_damping_x_set(PointerRNA *ptr, float value)
rbc->spring_damping_x = value;
- if (rbc->physics_constraint && rbc->type == RBC_TYPE_6DOF_SPRING && (rbc->flag & RBC_FLAG_USE_SPRING_X))
+#ifdef WITH_BULLET
+ if (rbc->physics_constraint && rbc->type == RBC_TYPE_6DOF_SPRING && (rbc->flag & RBC_FLAG_USE_SPRING_X)) {
RB_constraint_set_damping_6dof_spring(rbc->physics_constraint, RB_LIMIT_LIN_X, value);
+ }
+#endif
}
static void rna_RigidBodyCon_spring_damping_y_set(PointerRNA *ptr, float value)
@@ -427,9 +504,11 @@ static void rna_RigidBodyCon_spring_damping_y_set(PointerRNA *ptr, float value)
RigidBodyCon *rbc = (RigidBodyCon *)ptr->data;
rbc->spring_damping_y = value;
-
- if (rbc->physics_constraint && rbc->type == RBC_TYPE_6DOF_SPRING && (rbc->flag & RBC_FLAG_USE_SPRING_Y))
+#ifdef WITH_BULLET
+ if (rbc->physics_constraint && rbc->type == RBC_TYPE_6DOF_SPRING && (rbc->flag & RBC_FLAG_USE_SPRING_Y)) {
RB_constraint_set_damping_6dof_spring(rbc->physics_constraint, RB_LIMIT_LIN_Y, value);
+ }
+#endif
}
static void rna_RigidBodyCon_spring_damping_z_set(PointerRNA *ptr, float value)
@@ -437,9 +516,11 @@ static void rna_RigidBodyCon_spring_damping_z_set(PointerRNA *ptr, float value)
RigidBodyCon *rbc = (RigidBodyCon *)ptr->data;
rbc->spring_damping_z = value;
-
- if (rbc->physics_constraint && rbc->type == RBC_TYPE_6DOF_SPRING && (rbc->flag & RBC_FLAG_USE_SPRING_Z))
+#ifdef WITH_BULLET
+ if (rbc->physics_constraint && rbc->type == RBC_TYPE_6DOF_SPRING && (rbc->flag & RBC_FLAG_USE_SPRING_Z)) {
RB_constraint_set_damping_6dof_spring(rbc->physics_constraint, RB_LIMIT_LIN_Z, value);
+ }
+#endif
}
#else
diff --git a/source/blender/modifiers/intern/MOD_boolean.c b/source/blender/modifiers/intern/MOD_boolean.c
index a97ca2f9243..04198d9feb9 100644
--- a/source/blender/modifiers/intern/MOD_boolean.c
+++ b/source/blender/modifiers/intern/MOD_boolean.c
@@ -136,7 +136,7 @@ static DerivedMesh *applyModifier(ModifierData *md, Object *ob,
* in other scenes when compositing */
if (bmd->object != ob) {
/* weak! - but we can too easy end up with circular dep crash otherwise */
- if (modifiers_findByType(bmd->object, eModifierType_Boolean) == false) {
+ if (modifiers_findByType(bmd->object, eModifierType_Boolean) == NULL) {
dm = mesh_get_derived_final(md->scene, bmd->object, CD_MASK_MESH);
}
else {