Commit Graph

150 Commits

Author SHA1 Message Date
Sergey Sharybin 598ab525da Cleanup: Replace ABS/SQUARE/CUBE with function calls
While it might be handy to have type-less functionality which is
similar to how C++ math is implemented it can not be easily achieved
with just preprocessor in a way which does not have side-effects on
wrong usage.

There macros where often used on a non-trivial expression, and there
was at least one usage where it was causing an actual side effect/bug
on Windows (see change around square_f(sh[index++]) in studiolight.c).

For such cases it is handy to have a function which is guaranteed to
have zero side-effects. The motivation behind actually removing the
macros is that there is already a way to do similar calculation. Also,
not having such macros is a way to guarantee that its usage is not
changed in a way which have side-effects and that it's not used as an
inspiration for cases where it should not be used.

Differential Revision: https://developer.blender.org/D7051
2020-03-09 14:47:59 +01:00
Campbell Barton f37b9ffdcb Cleanup: unused BIK_api struct & defines
This was part of an unfinished API,
however this wasn't touched since 2009.
2020-02-15 15:24:02 +11:00
Campbell Barton fd05f01be6 Partially revert "Cleanup: use post increment/decrement"
This partially reverts commit 0b2d1badec

Post increment can deep-copy for C++ iterators, while in my own checks
GCC was able to optimize this to get the same output,
better follow C++ best practice and use pre-increment for iterators.
2019-09-08 04:08:10 +10:00
Campbell Barton 0b2d1badec Cleanup: use post increment/decrement
When the result isn't used, prefer post increment/decrement
(already used nearly everywhere in Blender).
2019-09-08 00:23:25 +10:00
Campbell Barton dc434bc273 Cleanup: correct use of term 'split' 2019-08-24 12:06:58 +10:00
Campbell Barton 0c7a4c74d3 Cleanup: clang-format, also typo fix. 2019-08-02 20:04:45 +10:00
Campbell Barton 760dbd1cbf Cleanup: misc spelling fixes
T68035 by @luzpaz
2019-08-01 14:02:41 +10:00
Brecht Van Lommel 604fdb6e85 Spelling fixes in comments and descriptions, patch by luzpaz
Differential Revision: https://developer.blender.org/D3744
2019-07-31 14:27:35 +02:00
Campbell Barton 5db4608f70 Cleanup: extra-semi-stmt warning 2019-06-06 10:16:18 +10:00
Campbell Barton aba4e6810f Cleanup: style, use braces in source/ (include disabled blocks) 2019-05-31 23:22:52 +10:00
Campbell Barton d8dbd49a2f Cleanup: style, use braces in source/
Automated using clang-tidy.
2019-05-31 22:55:15 +10:00
Campbell Barton f70470b540 Cleanup: comments (long lines) in ikplugin 2019-05-01 11:01:20 +10:00
Campbell Barton 41d4a19865 ClangFormat: format '#if 0' code in source/ 2019-04-17 08:24:14 +02:00
Campbell Barton e12c08e8d1 ClangFormat: apply to source, most of intern
Apply clang format as proposed in T53211.

For details on usage and instructions for migrating branches
without conflicts, see:

https://wiki.blender.org/wiki/Tools/ClangFormat
2019-04-17 06:21:24 +02:00
Campbell Barton 5498e7f193 CMake: add library deps to CMakeLists.txt
Tested to work on Linux and macOS.

This will be enabled once all platforms are verified.

See D4684
2019-04-16 06:20:52 +02:00
Campbell Barton 813e470eac CMake: cleanup, arg rename, add definitions last 2019-04-16 06:15:18 +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 de13d0a80c doxygen: add newline after \file
While \file doesn't need an argument, it can't have another doxy
command after it.
2019-02-18 08:22:12 +11:00
Campbell Barton eef4077f18 Cleanup: remove redundant doxygen \file argument
Move \ingroup onto same line to be more compact and
make it clear the file is in the group.
2019-02-06 15:45:22 +11: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
Campbell Barton 65ec7ec524 Cleanup: remove redundant, invalid info from headers
BF-admins agree to remove header information that isn't useful,
to reduce noise.

- BEGIN/END license blocks

  Developers should add non license comments as separate comment blocks.
  No need for separator text.

- Contributors

  This is often invalid, outdated or misleading
  especially when splitting files.

  It's more useful to git-blame to find out who has developed the code.

See P901 for script to perform these edits.
2019-02-02 01:36:28 +11:00
Campbell Barton c0f88ed8a8 Cleanup: sort forward declarations of enum & struct
Done using:
  source/tools/utils_maintenance/c_sort_blocks.py
2019-01-28 21:17:58 +11:00
Campbell Barton 1e4aab36c2 Cleanup: remove redundant BKE/BLI/BIF headers 2019-01-26 21:20:25 +11:00
Campbell Barton 88a80fcec8 Cleanup: commas at the end of enums
Without this clang-format may wrap them onto a single line.
2019-01-16 00:03:03 +11:00
Bastien Montagne 9c02f6b1ed Fix (unreported) memleak with legacy IKsolver.
Looks like new depsgraph may initialize some IK trees, without ever
executing them (which also frees them with legacy IKSolver code)...
2018-10-02 18:00:42 +02:00
Campbell Barton 9bd0c63382 Merge branch 'master' into blender2.8 2018-06-29 08:05:38 +02:00
Campbell Barton af36dd4664 Cleanup: trailing newlines 2018-06-29 08:02:49 +02:00
Campbell Barton 908b6960c0 Merge branch 'master' into blender2.8 2018-06-08 08:10:35 +02:00
Campbell Barton a25c11fd8d Cleanup: trailing space
Remove from blender/nodes, collada, blenfont & render.
2018-06-08 08:07:48 +02:00
Campbell Barton bfe1d0e0dc Merge branch 'master' into blender2.8 2018-06-01 18:26:42 +02:00
Campbell Barton 75fc1c3507 Cleanup: trailing whitespace (comment blocks)
Strip unindented comment blocks - mainly headers to avoid conflicts.
2018-06-01 18:19:39 +02:00
Dalai Felinto 159806140f Removing Blender Game Engine from Blender 2.8
Folders removed entirely:
* //extern/recastnavigation
* //intern/decklink
* //intern/moto
* //source/blender/editors/space_logic
* //source/blenderplayer
* //source/gameengine

This includes DNA data and any reference to the BGE code in Blender itself.
We are bumping the subversion.

Pending tasks:
* Tile/clamp code in image editor draw code.
* Viewport drawing code (so much of this will go away because of BI removal
  that we can wait until then to remove this.
2018-04-17 17:51:28 +02:00
Brecht Van Lommel 34ab90f546 Depsgraph: remove EvaluationContext, pass Depsgraph instead.
The depsgraph was always created within a fixed evaluation context. Passing
both risks the depsgraph and evaluation context not matching, and it
complicates the Python API where we'd have to expose both which is not so
easy to understand.

This also removes the global evaluation context in main, which assumed there
to be a single active scene and view layer.

Differential Revision: https://developer.blender.org/D3152
2018-04-16 19:55:33 +02:00
Brecht Van Lommel b92d78553b Cleanup: don't use Blender structs in iTaSC module. 2018-04-13 11:31:19 +02:00
Campbell Barton 1b462e5a51 Pass EvaluationContext instead of bContext
2.8x branch added bContext arg in many places,
pass eval-context instead since its not simple to reason about what
what nested functions do when they can access and change almost anything.

Also use const to prevent unexpected modifications.

This fixes crash loading files with shadows,
since off-screen buffers use a NULL context for rendering.
2017-08-16 12:46:04 +10:00
Luca Rood 1c4c288727 Pass EvaluationContext argument everywhere
Note that some little parts of code have been dissabled because eval_ctx
was not available there. This should be resolved once DerivedMesh is
replaced.
2017-07-21 14:47:26 +02:00
Brecht Van Lommel f05f2f0336 Fix T51971: IK non-uniform scale regression.
This is a different fix for the issue from D2088, preserving backwards compatibility
for IK stretching. The main problem with this patch is that this new behavior has
been there for a year, so it may break rigs created since then which rely on the new
IK stretch behavior.

Test file for various cases:
https://developer.blender.org/diffusion/BL/browse/trunk/lib/tests/animation/IK.blend

Reviewers: campbellbarton

Subscribers: maverick, pkrime

Differential Revision: https://developer.blender.org/D2743
2017-07-17 18:31:19 +02:00
Sergey Sharybin af0e6b31a5 Depsgraph: Fix frash with iTaSC solver
This commit reverts part of a fix for T33275, but things are:

- I can not reproduce the original issue at all, so doesn't seem to
  cause any regressions.

- It is really bad idea to do delayed initialization in the threaded
  environment, it's a straight way to some nasty issues.

- We can't do things like this anyway because we go more granular,
  meaning such a delayed initialization will fail in the case of
  having several IK solvers (unless they properly accommodate to
  changed bone head).

- Verified the fix with various files from Mango project and all of
  them seems to work nice with new depednency graph now (old depsgraph
  has some flickering, but it's not related on DEG itself, but on
  an environment with lots of proxies and threaded evaluation and it
  is not a new behavior).
2016-11-15 16:18:59 +01:00
Campbell Barton c206b7cbb6 Correct error in non-uniform scale IK commit
Rename arg to avoid confusion
2016-07-08 21:13:19 +10:00
Campbell Barton a92fc348f4 Fix/Workaround non-uniform scaled bones failing w/ IK solver
Scaling a bone on the Y axis (for a stretch effect), wasn't supported by the IK solver.

Support this by solving as uniform scaled bones by matching the X,Z axis to the Y.

Requested by @pepeland, see D2088 for details.
2016-07-08 10:28:07 +10: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 6e4cb463c4 Cleanup: shadowing (rna, modifiers, *misc*) 2015-11-23 17:40:49 +11:00
Campbell Barton 9510137d12 Cleanup: brace placement /w structs 2015-04-07 11:25:42 +10:00
Campbell Barton b1d758ae6b Cleanup: redundant struct declarations 2015-03-29 03:56:39 +11:00
Sergey Sharybin 6cd82dbf57 CMake: Enable strict flags for C++ 2015-03-27 18:23:31 +05:00
Campbell Barton 4b88541d59 CMake: unbundle eigen3
Optionally use systems eigen3 library.

T41989 by @hasufell with edits
2015-03-19 15:41:41 +11:00
Campbell Barton 915235c87a Cleanup: unused headers 2014-11-28 22:16:14 +01:00
Campbell Barton bcbbc66795 Cleanup: unused headers 2014-11-28 15:52:30 +01:00
Campbell Barton c2dc51d827 Math Lib: add transpose_m3_m3, m3_m4, m4_m4 2014-10-30 12:15:14 +01:00
Campbell Barton 023ac217dd Cleanup: set var static 2014-09-24 14:55:01 +10:00