Commit Graph

230 Commits

Author SHA1 Message Date
Campbell Barton 0cd414120b Unbreak build on macOS with AppleClang from recent cleanup
Exact an exact match with Clang broke building when the compiler ID
was "AppleClang", reverting parts of [0].

[0]: 6549019ae1
2024-03-07 19:56:58 +11:00
Campbell Barton 6549019ae1 Cleanup: use STREQUAL instead of MATCHES for exact comparisons
MATCHES takes a REGEX and searches the input for a match,
this isn't necessary for CMAKE_SYSTEM_PROCESSOR & CMAKE_*_COMPILER_ID.
2024-03-07 17:56:41 +11:00
Campbell Barton 49594c37ae License headers: use SPDX-FileCopyrightText for CMake files 2023-06-14 23:36:23 +10:00
Sergey Sharybin a12a8a71bb Remove "All Rights Reserved" from Blender Foundation copyright code
The goal is to solve confusion of the "All rights reserved" for licensing
code under an open-source license.

The phrase "All rights reserved" comes from a historical convention that
required this phrase for the copyright protection to apply. This convention
is no longer relevant.

However, even though the phrase has no meaning in establishing the copyright
it has not lost meaning in terms of licensing.

This change makes it so code under the Blender Foundation copyright does
not use "all rights reserved". This is also how the GPL license itself
states how to apply it to the source code:

    <one line to give the program's name and a brief idea of what it does.>
    Copyright (C) <year>  <name of author>

    This program is free software ...

This change does not change copyright notice in cases when the copyright
is dual (BF and an author), or just an author of the code. It also does
mot change copyright which is inherited from NaN Holding BV as it needs
some further investigation about what is the proper way to handle it.
2023-03-30 10:51:59 +02:00
Campbell Barton c434782e3a File headers: SPDX License migration
Use a shorter/simpler license convention, stops the header taking so
much space.

Follow the SPDX license specification: https://spdx.org/licenses

- C/C++/objc/objc++
- Python
- Shell Scripts
- CMake, GNUmakefile

While most of the source tree has been included

- `./extern/` was left out.
- `./intern/cycles` & `./intern/atomic` are also excluded because they
  use different header conventions.

doc/license/SPDX-license-identifiers.txt has been added to list SPDX all
used identifiers.

See P2788 for the script that automated these edits.

Reviewed By: brecht, mont29, sergey

Ref D14069
2022-02-11 09:14:36 +11:00
Dalai Felinto 46e66d154c Missing README.blender license files + New BSD cases
I also changed New BSD to BSD 3 Clause.

Differential Revision: https://developer.blender.org/D9791
2020-12-08 18:51:14 +01:00
Campbell Barton 2bd8f7e059 Cleanup: use string APPEND/PREPEND
Replace 'set' with 'string(APPEND/PREPEND ...)'.
This avoids duplicating the variable name.
2020-11-06 12:32:54 +11:00
Sebastian Parborg ff7d742350 Quiet all warnings when building Bullet 2020-09-02 21:06:02 +02:00
Sebastian Parborg 4446c3a593 Sync Bullet to upstream
This syncs Bullet to the latest upstream git version as of writing this.
(commit 47b0259b9700455022b5cf79b651cc1dc71dd59e).
2020-09-02 20:41:30 +02:00
Sebastian Parborg 1aa54d4921 Make rigidbody simulation handle animated objects gracefully
The animated objects was not updated for each internal substep for the rigidbody sim.
This would lead to unstable simulations or very annoying clipping artifacts.

Updated the code to use explicit substeps and tie it to the scene frame rate.

Fix T47402: Properly updating the animated objects fixes the reported issue.

Reviewed By: Brecht, Jacques

Differential Revision: http://developer.blender.org/D8762
2020-09-02 14:20:41 +02:00
Ray Molenkamp 14608c5e86 Cleanup: Fix MSVC warning regarding flags in bullet
For bullet we compile at /W0 for MSVC but we did not
remove the standard /W3 flag. Leading to the following
warning:

Command line warning D9025 : overriding '/W3' with '/W0'

This change removes the W3 flag for bullet to get rid
of the warning.
2020-08-26 09:16:21 -06:00
David Vogel 820ca419e0 Add compound shape for rigid body simulation
This patch adds a new compound shape entry to the shape selection
dropdown. It also corrects wrong inertia calculation for convex hulls,
that resulted in strange behavior for small objects.

The compound shape take the collision shapes from its object children
and combines them. This makes it possible to create concave shapes from
primitive shapes. Using this instead of the mesh collision shape is
often many times faster.

Reviewed By: Sergey, Sebastian Parborg

Differential Revision: http://developer.blender.org/D5797
2020-07-30 18:53:35 +02:00
Campbell Barton 74855969e7 Cleanup: use term suppress instead of repress
Also check MSVC instead of WIN32, for setting MSVC flags.
2020-03-12 12:13:41 +11:00
Ray Molenkamp 72461c09b4 Windows: Clean-up warnings originating from bullet
Bullet currently generates the majority of the warnings
on windows all of them are silly. This patch disables
all warns from bullet for now.

We should revisit this if/when we update bullet
to a newer version.

Reviewed By: sergey brecht

Differential Revision: https://developer.blender.org/D7118
2020-03-11 14:11:19 -06:00
Brecht Van Lommel 922e77036b Fix Bullet build error with Clang 8 and Xcode 11
See D5366 and upstream:
https://github.com/bulletphysics/bullet3/commit/7f6c479ea6
2019-08-12 15:12:27 +02:00
Campbell Barton 3076d95ba4 Cleanup: use 2 space indentation for CMake 2019-04-17 06:35:54 +02:00
Campbell Barton 47adab4f99 CMake: prepare for BLENDER_SORTED_LIBS removal
No functional change, this adds LIB definition and args to cmake files.
Without this it's difficult to migrate away from 'BLENDER_SORTED_LIBS'
since there are many platforms/configurations that could break when
changing linking order.

Manually add and enable WITHOUT_SORTED_LIBS to try building
without sorted libs (currently fails since all variables are empty).
This check will eventually be removed.

See T46725.
2019-04-14 15:37:24 +02:00
Campbell Barton ab5e69e660 Cleanup: remove contributors for CMake files
Following removal from C source code.

See: 8c68ed6df1
2019-02-05 09:10:32 +11:00
Ray Molenkamp 81060ff6b2 Windows: Add support for building with clang.
This commit contains the minimum to make clang build/work with blender, asan and ninja build support is forthcoming

Things to note:

1) Builds and runs, and is able to pass all tests (except for the freestyle_stroke_material.blend test which was broken at that time for all platforms by the looks of it)

2) It's slightly faster than msvc when using cycles. (time in seconds, on an i7-3370)

victor_cpu
	msvc:3099.51
	clang:2796.43

pavillon_barcelona_cpu
	msvc:1872.05
	clang:1827.72

koro_cpu
	msvc:1097.58
	clang:1006.51

fishy_cat_cpu
	msvc:815.37
	clang:722.2

classroom_cpu
	msvc:1705.39
	clang:1575.43

bmw27_cpu
	msvc:552.38
	clang:561.53

barbershop_interior_cpu
	msvc:2134.93
	clang:1922.33

3) clang on windows uses a drop in replacement for the Microsoft cl.exe (takes some of the Microsoft parameters, but not all, and takes some of the clang parameters but not all) and uses ms headers + libraries + linker, so you still need visual studio installed and will use our existing vc14 svn libs.

4) X64 only currently, X86 builds but crashes on startup.

5) Tested with llvm/clang 6.0.0

6) Requires visual studio integration, available at https://github.com/LazyDodo/llvm-vs2017-integration

7) The Microsoft compiler spawns a few copies of cl in parallel to get faster build times, clang doesn't, so the build time is 3-4x slower than with msvc.

8) No openmp support yet. Have not looked at this much, the binary distribution of clang doesn't seem to include it on windows.

9) No ASAN support yet, some of the sanitizers can be made to work, but it was decided to leave support out of this commit.

Reviewers: campbellbarton

Differential Revision: https://developer.blender.org/D3304
2018-05-28 14:34:47 -06:00
Sergej Reich 4db3b4da46 Bullet: Fix velocity calculation of new spring constraint
This is a backport of bullet commit: 86ca7dc
2018-04-07 17:37:23 +02:00
Sergey Sharybin f7263b8b1a Cleanup: Reduce amount of misleading indentation
Was polluting compile output too much.
2016-09-01 12:14:16 +02:00
Sergey Sharybin 87dcee0c0c Silence some annoying warnings when doing full build with strict flags
This mainly touches extern libraries and few debug-only places in intern.

Some summary:

- External libraries are not strict at all about missing declarations,
  so we can rather safely remove such warning together with other strict
  flags.

- Bullet has some static functions which are not used.
  Those were commented out.

- Carve now has some unused debug-only functions commented out as well.
  While we're on the way of getting rid of Carve, it makes sense to make
  things a bit cleaner for the time being.

- In LZMA we have some parts disabled which gives some set but unused
  variables which is rather correct.

- Elbeem had quite some variables set and never used because their usage
  is inside of debug-only code which is commented out.

Note about patching upstream libraries: surely one might say that we
have to make local patchset against this, but own experience says it
only gives extra work trying to merge such tweaks to a new upstream
version and usually it's just faster to re-apply such fixes again after
bundling new upstream library.
2016-04-22 10:59:15 +02:00
Brecht Van Lommel e14324daa7 Fix T47758: rigidbody bug with constraint breaking and disable collisions.
This is a regression in Bullet, reverted the problematic change for now with
a custom patch.
2016-03-27 01:32:28 +01:00
Brecht Van Lommel deef941208 Fix build error on OS X in previous commit, this define should stay. 2016-02-02 00:41:32 +01:00
Brecht Van Lommel fae710a213 Fix T47293: game engine crashes since Bullet upgrade.
This restores a modification that was there before.
2016-02-02 00:19:09 +01:00
Brecht Van Lommel b64d5809e7 Upgrade Bullet to version 2.83.
I tried to carefully preserve all patches since the last upgrade.

Improves T47195, cloth collision detection bug.

Differential Revision: https://developer.blender.org/D1739
2016-01-25 22:14:46 +01:00
Sergey Sharybin 5d99cde822 Remove SCons building system
While SCons building system was serving us really good for ages it's no longer
having much attention by the developers and started to become quite a difficult
task to maintain.

What's even worse -- there started to be quite serious divergence between SCons
and CMake which was only accumulating over the releases now. The fact that none
of the active developers are really using SCons and that our main studio is also
using CMake spotting bugs in the SCons builds became quite a difficult task and
we aren't always spotting them in time.

Meanwhile CMake became really mature building system which is available on every
platform we support and arguably it's also easier and more robust to use.

This commit includes:

- Removal of actual SCons building system
- Removal of SCons git submodule
- Removal of documentation which is stored in the sources and covers SCons
- Tweaks to the buildbot master to stop using SCons submodule
  (this change requires deploying to the server)
- Tweaks to the install dependencies script to skip installing or mentioning
  SCons building system
- Tweaks to various helper scripts to avoid mention of SCons folders/files
  as well

Reviewers: mont29, dingto, dfelinto, lukastoenne, lukasstockner97, brecht, Severin, merwin, aligorith, psy-fi, campbellbarton, juicyfruit

Reviewed By: campbellbarton, juicyfruit

Differential Revision: https://developer.blender.org/D1680
2016-01-04 14:20:48 +05:00
Campbell Barton 36d47ce203 Fix leak in BMesh convex hull operator 2015-05-30 16:17:04 +10:00
Campbell Barton 5d30c23c35 doxygen: corrections/updates
Also add depsgraph & physics
2015-05-20 14:12:22 +10:00
Ines Almeida b7033e3d4e BGE physics: adding links to bullet documentation 2015-02-19 11:20:18 +00:00
Campbell Barton 72ca952641 correct permissions 2015-01-08 23:01:15 +11:00
Benoit Bolsee 3a53ed8d1b Remove an assert in Bullet for the Character physics.
This assert happens all the time for character physics in debug mode.
In release mode, the assert is skipped but the code is still incorrect
although it does not cause any crash strangely.
2014-08-10 00:39:22 +02:00
Sergej Reich 81c3fc9726 cloth: Speed up collision detection
Noticed this while looking into something else.
The change is trivial, but gives a rather nice preformance improvement,
so why not.
Theres's actually a lot one can do to improve collision performance if
one wanted to, the triangle-triangle check alone has a lot of room for
improvement.
2014-07-03 21:40:04 +02:00
Jens Verwiebe 9c93c0bf08 Bullet: making bullet friction workaround more furureproof by using the __apple_build_version__ macro, TODO: check if problem persists with newer clang 2014-04-19 14:10:49 +02:00
Jens Verwiebe 8a4210074c Bullet: better workaround for failing friction with clang 3.4, remove the obsolete compileflag magic 2014-04-17 00:25:25 +02:00
Sergej Reich 6ffabfae85 Fix T39646: Rigid Body Constraints non functional on release builds
-ffast-math is evil, not sure why it was enabled...
I seems to work better on OSX but it's still not a good idea.

The SConscript for bullet is a mess, I don't understand why
we use different flags for different platforms in the first place.
Seems to be a historical artifact but I don't know enough about scons
to try and clean it up.
2014-04-09 01:48:44 +02:00
Jens Verwiebe 877706b8eb Cleanup: Restrict the debug -gline-tables-only to cxx_debug in cycles and spelling 2014-03-22 11:33:32 +01:00
Jens Verwiebe 3f89b92823 Ups, forgot to remove something i just placed temporary … 2014-03-19 11:26:41 +01:00
Jens Verwiebe 67f0290382 OSX/bullet/scons: a better workaround for clang 3.4 issues with actual bullet, according cmake ( less speed penalty ) 2014-03-19 11:21:36 +01:00
Jens Verwiebe 5ff0500593 OSX/cmake/bullet: fix ambigoius compiler ID and make deoptimize fix a bit stricter to reduce speed penalty 2014-03-18 12:18:03 +01:00
Jens Verwiebe d0ad48fdc9 OSX/bullet: i have to use -O0 again, else weird bullet behaviour comes back.
I overlooked in cmake my fix same time changed the optimization level to 0,
so not use optimization is the real fix ( postponed for after 2.70 ).
I appears we should investigate scons anyway: compileflags does not apply to c and c++ same time as expected.
2014-03-12 13:04:31 +01:00
Sergey Sharybin de86b7097f Fix T39104: 2 clothes on a collision object cause crash
This was caused by static variables used in plNearestPoints().

For now solved by making the solvers allocated in the stack,
seems no noticeable affect on the simulation speed so far.
2014-03-12 14:48:47 +06:00
Jens Verwiebe 09b2531bb3 OSX/bullet: add -O2 to bt_cxx_flags, in cmake thats default, in scons CXXFLAGS start empty also in “Release” 2014-03-11 18:32:22 +01:00
Campbell Barton 6e9ee13de0 CMake: add fastmath for gcc release flags (OSX had already) 2014-03-12 03:39:12 +11:00
Jens Verwiebe 4e3f27032e OSX/bullet: do a last fix for scons. Now in both buildsystems the used flags are in sync for OSX 2014-03-11 17:34:31 +01:00
Jens Verwiebe ce37400c0b OSX/cmake: tentative fix for T38746, conflictting flags somewhere 2014-03-11 15:56:50 +01:00
Jens Verwiebe 558fa43ffd OSX/bullet: Truely fix T38746 now, compile flags where not propagated right,
also remove gcc 4.6 workaround, i don’t think its needed any longer.
!!! pls check if this would be right thing todo for othere OS too !!!
2014-03-11 13:27:06 +01:00
Jens Verwiebe ac0cdec90f OSX/clang3.4: tentative fix for T38746, strange bullet behaviour 2014-03-10 18:09:53 +01:00
Sergej Reich 05eebf49d3 Bullet: Update to svn r2719
Fixes part of T37905, fixed constraint didn't work correctly.
2013-12-26 12:45:57 +01:00
Sergej Reich 13caf5cc14 bullet: Remove patch applied upstream 2013-11-04 17:02:01 +00:00