Fix building w/o bullet
authorCampbell Barton <ideasman42@gmail.com>
Mon, 10 Dec 2018 23:07:43 +0000 (10:07 +1100)
committerCampbell Barton <ideasman42@gmail.com>
Mon, 10 Dec 2018 23:13:05 +0000 (10:13 +1100)
source/blender/blenloader/CMakeLists.txt
source/blender/blenloader/intern/versioning_280.c
source/blender/makesrna/intern/rna_rigidbody.c

index 49987cb860cc100ea7afd44746380f4375b3a184..5edeb8ccbbbbd180946aeea6978945c2b099752b 100644 (file)
@@ -88,6 +88,10 @@ if(WITH_CODEC_FFMPEG)
        add_definitions(-DWITH_FFMPEG)
 endif()
 
+if(WITH_BULLET)
+       add_definitions(-DWITH_BULLET)
+endif()
+
 if(WITH_ALEMBIC)
        list(APPEND INC
                ../alembic
index b05be55e8fa579474741d195ac664f499b336681..188372ab4382cd0dc95472355a7bf0c5c13865aa 100644 (file)
@@ -2490,6 +2490,7 @@ void blo_do_versions_280(FileData *fd, Library *UNUSED(lib), Main *bmain)
                        }
                }
 
+#ifdef WITH_BULLET
                /* Ensure we get valid rigidbody object/constraint data in relevant collections' objects. */
                for (Scene *scene = bmain->scene.first; scene; scene = scene->id.next) {
                        RigidBodyWorld *rbw = scene->rigidbody_world;
@@ -2501,6 +2502,7 @@ void blo_do_versions_280(FileData *fd, Library *UNUSED(lib), Main *bmain)
                        BKE_rigidbody_objects_collection_validate(scene, rbw);
                        BKE_rigidbody_constraints_collection_validate(scene, rbw);
                }
+#endif
        }
 
        {
index 15046928ce78c5db767b8603f3c23600ef306492..dfdbed0dafd1c40d02cd8c1ad492ffc934a545d1 100644 (file)
@@ -151,17 +151,19 @@ static void rna_RigidBodyWorld_split_impulse_set(PointerRNA *ptr, bool value)
 
 static void rna_RigidBodyWorld_objects_collection_update(Main *bmain, Scene *scene, PointerRNA *ptr)
 {
+#ifdef WITH_BULLET
        RigidBodyWorld *rbw = (RigidBodyWorld *)ptr->data;
-
        BKE_rigidbody_objects_collection_validate(scene, rbw);
+#endif
        rna_RigidBodyWorld_reset(bmain, scene, ptr);
 }
 
 static void rna_RigidBodyWorld_constraints_collection_update(Main *bmain, Scene *scene, PointerRNA *ptr)
 {
+#ifdef WITH_BULLET
        RigidBodyWorld *rbw = (RigidBodyWorld *)ptr->data;
-
        BKE_rigidbody_constraints_collection_validate(scene, rbw);
+#endif
        rna_RigidBodyWorld_reset(bmain, scene, ptr);
 }