1
1

Compare commits

...

164 Commits

Author SHA1 Message Date
40f92e161a Quiet a warning in non-debug build. 2020-08-28 10:44:09 -04:00
b8cc4b9392 Merge branch 'master' into newboolean 2020-08-28 10:27:21 -04:00
8556a10bd9 Moved orientation etc tests into BLI_math_boolean.hh.
These tests are only used by the delaunay, mesh_intersect,
and mesh_boolean files. At the suggestion of Brecht, moving
them into BLI_math_boolean.hh and math_boolean.cc.
2020-08-28 10:21:59 -04:00
123955377c Merge branch 'master' into newboolean 2020-08-28 07:43:07 -04:00
baf9ee73d3 Use blo_do_versions_290 to set Fast solver for pre-2.91 files. 2020-08-28 07:18:46 -04:00
665ffa5dca Cleanup: more spelling corrections 2020-08-27 18:53:02 +10:00
cc0a0d3291 Expand on solver descriptions 2020-08-27 18:37:59 +10:00
e0cb025870 Cleanup: mostly comments, use doxy syntax & typos
- Use doxy syntax for functions.
- Use `pragma once` for header guard.
2020-08-27 18:18:47 +10:00
94884777b2 Merge branch 'master' into newboolean 2020-08-27 15:49:22 +10:00
0659560a10 Merge branch 'master' into newboolean 2020-08-26 07:21:08 -04:00
77242de80e Refactor to defer building Plane for Faces until later.
This is a precursor to a big speed optimization in the "finding clusters"
code. Right now there is no speedup, maybe even a bit of a slowdown,
but following commits should lead to nice speed increases.
2020-08-26 06:59:58 -04:00
4909e599e8 Some small speedups from parallelizing more parts.
Parallelized bounding box finding and degenerate triangle testing.
2020-08-23 10:12:55 -04:00
f4e337a7da Some tweaks to multithreading parameters based on tests to minimize time. 2020-08-22 15:53:22 -04:00
99d4d94762 Merge branch 'master' into newboolean 2020-08-22 09:44:33 -04:00
7cc85d8b9c A couple more cleanups inspire by reviewer comments. 2020-08-22 09:33:00 -04:00
2231c4bd89 Fix clang-tidy warnings. 2020-08-22 08:19:10 -04:00
7e06208f6a Fixed an error and warning on Linux from previous commit. 2020-08-22 08:02:33 -04:00
9810cfa1e8 Addressed comments of reviewers on D8623.
Almost all changes asked for by Campbell and Jacques have been
addressed. The clang-tidy fixes will happen in the next commit.
2020-08-22 07:30:13 -04:00
0a6ef69509 Cleanup: move break statements into case body, or remove if follwing a return. 2020-08-21 10:16:37 -04:00
4b13eb2788 Rename some classes at the suggestion of reviewers.
Mesh -> IMesh; MArena -> IMeshArena
Remove type abbreviations Vertp and Facep.
2020-08-21 10:02:58 -04:00
481927d4d6 Use an enum type for solver in boolean modifier.
This matches what was done in a previous commit for the tool.
It makes it easier to associate a tooltip with each choice.
For this branch, I have the default solver be the Exact one;
when we merge to master, we will have to decide the best default.
Make format caught a coouple other files, sorr for not doing those
earlier.
2020-08-21 08:23:18 -04:00
de294bb3e2 Use custom layout for intersect tools, with expanded choices.
Makes "Exact" vs "Fast" a choice with tooltips for each.
Hides merge threshold when in Exact mode.
2020-08-20 21:23:21 -04:00
6903b3414a Renamed boolean to meah_boolean in BLI file names. 2020-08-20 19:46:57 -04:00
3b36e2b781 Merge branch 'master' into newboolean 2020-08-20 17:03:51 -04:00
57c3718447 Revert "Use std::abs instead of fabs in C++ code."
This reverts commit eac84bf527.

Using std::abs causes ambiguity problems when compiling on a Mac.
2020-08-19 20:29:09 -04:00
eac84bf527 Use std::abs instead of fabs in C++ code. 2020-08-19 18:20:31 -04:00
fa9a630b29 Use std::lower_bound instead of custom binary search. 2020-08-19 17:48:28 -04:00
f5c7a6d3b6 Fix memory leak in delaunay C interface code. 2020-08-19 17:29:04 -04:00
db292912f4 Fix crash in Debug build for some cases of no intersects. 2020-08-19 07:35:57 -04:00
b1a53cc85b Merge branch 'master' into newboolean 2020-08-19 16:43:30 +10:00
108e6d4ef2 Better performance when there are clusters of coplanar triangles. 2020-08-18 21:51:35 -04:00
5cd49e46f4 Added a sphere/grid test to mesh intersect performance tests. 2020-08-18 06:12:47 -04:00
f65a50d794 Tweaked the performance debugging gathering. 2020-08-16 19:01:52 -04:00
cce4bafc53 Add support for non-closed-volume arguments.
Use a "generalized winding number" calculation to get an inside/outside
test that works reasonably well when meshes aren't closed.
This change allows one to use a plane as the cutter in a difference
operator and get the expected results.
2020-08-16 11:05:58 -04:00
06696ab0bd Let Boolean be seen in edit mode, if enabled.
Since the beginning of time, Boolean has not supported this.
While it might be too slow for some uses, it seems that the user
should be able to decide whether to use it or not.
2020-08-15 13:21:36 -04:00
eba77a95fc Fixed a bug in dissolving triangulation edges.
If an original face was divided into triangles with different
orientations, the program would crash. Fixed now.
2020-08-15 13:03:13 -04:00
abd7b1c20e Merge branch 'master' into newboolean 2020-08-15 08:24:19 -04:00
4d9d12a48f Added more debugging help. 2020-08-15 07:22:25 -04:00
d75c86429f Checking for PWN.
The current code is only supposed to work if the input meshes
are "piecewise constant winding number" (PWN). Added a check
to see if this is true about the inputs.
2020-08-12 07:35:48 -04:00
2b6bd6f76d Fix the nearest point containing cell when nearest is inside a tri. 2020-08-09 16:16:07 -04:00
7f5a4053f5 Remove degenerate triangles before intersecting. 2020-08-09 13:38:37 -04:00
18c6d7b066 Use #pragma in newboolean branch. 2020-08-09 07:32:33 -04:00
e66c59129c Merge branch 'master' into newboolean 2020-08-09 07:24:50 -04:00
56b547aa9d Cleanup: stop some warnings. 2020-08-09 07:14:09 -04:00
8da4842fd5 Fixed bug in understanding of nesting of connected components. 2020-08-08 17:23:11 -04:00
81410044bc Add debugging to face merge. 2020-08-07 09:25:36 -04:00
c581c4ae44 Fix crash when point finding encounters a coplanar stack. 2020-08-05 19:19:48 -04:00
843aead88e Disable the boolean and modifier python tests.
These tests rely on the behavoir of the old boolean, down the the
exact values of coordinates and ordering of the output vertices.
Because I want the default behavior of boolean to be new boolean
in this branch, this is inconvenient. I will make these tests work
again if/when we merge with master. Probably by adding the flag
that invokes the old behavior to the tests.
New bevel is mostly tested by unit tests now, so disabling the
regression test for it is not a big deal.
2020-08-05 15:52:48 -04:00
0023d30590 Merge branch 'master' into newboolean 2020-08-05 15:13:57 -04:00
4539f345e8 Fixed bug where normals were sometimes wrong after a difference op.
Needed to check for correct orientation of a face before reusing an
original face.
Also added another test case.
2020-08-05 15:02:21 -04:00
ca109986a6 Add some more boolean unit tests. 2020-08-05 10:03:06 -04:00
10109fd1b2 Fix union of two disjoint meshes.
Also added unit test for that.
2020-08-05 09:25:25 -04:00
37d326a052 Merge branch 'master' into newboolean 2020-08-04 15:35:50 -04:00
1ae25d48dd Resetting some stuff that got messed up with previous commit. 2020-08-04 15:20:50 -04:00
f2bee8e5e6 Fixed several filtering bugs.
Several bugs with the acceleration filters cauased crashes and
incorrect results. Redid the error analysis and found some mistakes.
There was also a bug in the code for checking non-trivial intersections.
Now you can boolean a standard cube and cylinder and scale the cylinder
without crashing.
Also rewrote the tri-tri intersection code to make it more understandable
and also prepare the way for more floating filters.
2020-08-04 13:48:30 -04:00
3e30fd75ab Fix bugs re triangle sorting.
Several somewhat self-compensating bugs in the routine that sorts
triangles around an edge let to a bug visible with a unit cube
subtracting a unit cylinder with 4 sides. Fixed.
2020-08-02 17:13:54 -04:00
e65ddfa5fd Fix building WITH_GMP in case of boolean modifier.
Left out a define.
Also, added more debugging in boolean.cc.
2020-08-02 10:30:35 -04:00
b9845566b4 Merge branch 'master' into newboolean.
Also, make it possible to build when WITH_GMP is disabled.
2020-08-02 09:35:20 -04:00
771da552bb Warning removal: Remove unused argument; make a private function static. 2020-08-02 06:44:42 -04:00
eb0231f20f Handle cases of nested meshes.
This fixes some "implement me" crashes and also case where one
moves a cutter completely inside the cut mesh.
Also fixed a bug in the implementation of mpq3::distance_squared.
2020-08-01 18:24:16 -04:00
04ba7e05e8 Merge branch 'master' into newboolean 2020-07-31 08:49:42 -04:00
9f23dbe75c Merge branch 'master' into newboolean 2020-07-30 19:47:41 -04:00
a85a52f064 Fix wrong use of initializer in C++. Fix unused parameter. 2020-07-30 19:13:53 -04:00
7755a2ed78 Fix a coplanar case - two cubes forming steps.
Needed careful logic about what to do with zero volume cells.
It worked before on some cases by accident, but now it should
work on any depth stack of coincident faces.
2020-07-30 17:58:36 -04:00
64d8f6b191 Use floating point filtering to make the degenerate triangle detection faster. 2020-07-26 13:23:49 -04:00
7781c49c22 Set up to try either spinlock or mutex for boolean parallelism.
On my 48 core Linux machine, mutex's seem to lead to faster execution.
2020-07-26 13:09:29 -04:00
4c25824f19 Use multithreading to calculate subdivided triangles. 2020-07-26 12:43:37 -04:00
a2dbeb458c Merge branch 'master' into newboolean 2020-07-26 06:47:46 -04:00
accadbc2aa Used wrong #if to isolate debugging code for Windows. 2020-07-26 06:38:02 -04:00
d6e3ba3416 Fix the knife boolean modes.
Had to track the intersect edges through from mesh_intersect
through to the bmesh boolean.
2020-07-25 21:19:39 -04:00
04ea79dc0b Turn off debug file writing in boolean etc unit tests.
Also, for Windows, do something other than /tmp when file writing
is turned on. This file writing is only intended for debugging.
2020-07-24 16:20:33 -04:00
e18cf6f998 Interpolate face loop data from example faces.
This makes for a reasonable first pass at getting OK UV maps.
2020-07-24 09:58:34 -04:00
50b7025ebf Use original edges as examples when possible.
These means that, for example, an original edge that has a bevel
weight and only survives partly after the boolean will still
have that bevel weight.
2020-07-24 09:27:26 -04:00
3edc33123c BMesh construction now better at preserving attributes of mesh elements.
Uses existing BMVerts, BMEdges, and BMFaces if possible.
Uses good examples for BMFaces for intersected faces.
Still todo: good examples for BMEdges when partially reusing an edge,
and UV interpolation for new faces.
2020-07-23 07:46:53 -04:00
7c36c72b25 Merge branch 'master' into newboolean 2020-07-21 18:31:40 -04:00
77c83d3be1 Fixed the regression after making binary ops not do self-intersection.
Now the new Boolean code is only about 3 to 4 times slower than the
current BMesh one.
2020-07-20 11:58:37 -04:00
3b77c59bf7 Merge branch 'master' into newboolean 2020-07-20 08:15:06 -04:00
37ee7f20e7 Update integer type usage 2020-07-20 13:35:58 +02:00
44f58e0d96 Merge branch 'master' into newboolean 2020-07-20 13:34:29 +02:00
833514b2ce Work in progress to treat nary boolean differently.
This will make it faster. There's one bug in it still,
but committing progress.
2020-07-20 05:28:42 -04:00
62dc64bdee Better estimate of number of output faces.
Avoids need to resize some arena vectors in many cases.
2020-07-19 16:00:48 -04:00
383b4c0727 Added floating filters to the initial plane-side tests in tri-tri intersect.
Needed an "abs" function for double3, so added it to all of the
float/double/mpq 2/3 types.
2020-07-19 14:16:39 -04:00
41722bfaa6 Fix a strange merge problem, and fix a couple of warnings. 2020-07-18 19:58:41 -04:00
64e462f688 Merge branch 'master' into newboolean 2020-07-18 06:58:43 -04:00
49a15ac05a Merge master
commit aa8279648e
Author: Jacques Lucke <jacques@blender.org>
Date:   Fri Jul 17 21:19:48 2020 +0200

    Simulation: extract node tree parsing code to separate file

commit 25582aef61
Author: Jacques Lucke <jacques@blender.org>
Date:   Fri Jul 17 20:51:52 2020 +0200

    Simulation: separate code from node tree parsing and solver

commit 69d14c0ddb
Author: Hans Goudey <h.goudey@me.com>
Date:   Fri Jul 17 15:18:54 2020 -0400

    Fix T78959: Show current frame indicator when interface is locked

    When the playhead drawing moved to an overlay, a check was added to keep
    it from drawing with a locked interface. This is necessary for some overlays,
    but not this one, so this removes the check, making it the responsibility of
    the editor.

    A context function is added to make that check easier in the future.

    Differential Revision: https://developer.blender.org/D8313

commit 8b0df381d9
Author: Germano Cavalcante <germano.costa@ig.com.br>
Date:   Fri Jul 17 14:33:40 2020 -0300

    Transform: use GHASH_ITER when restoring customdata

commit d8a6eec1a3
Author: Sybren A. Stüvel <sybren@blender.org>
Date:   Fri Jul 17 16:00:08 2020 +0200

    Cleanup: Removed incorrect `// namespace DEG` comment

    No functional changes.

commit 893eb30730
Author: Sebastián Barschkis <sebbas@sebbas.org>
Date:   Fri Jul 17 16:11:21 2020 +0200

    Fluid: Numpy support for Mantaflow build system

    Adjusted the fluid build system so that plugins that depend on numpy can be compiled as well.

    Note that in this commit numpy support is still disabled. It can be enabled by re-running the Mantaflow update script with USE_NUMPY=1 and enabling WITH_MANTA_NUMPY in extern/mantaflow/CMakeLists.txt. This will happen in a future commit.

commit 0cdc75ccd2
Author: Sebastián Barschkis <sebbas@sebbas.org>
Date:   Fri Jul 17 15:58:13 2020 +0200

    Fluid: Cleanup build system for extern mantaflow

    No longer including unused dependencies. Should numpy IO be needed at some point, the Manta source update script can be configured so that the required dependencies are included again.

commit e3f8768d8a
Author: Jacques Lucke <jacques@blender.org>
Date:   Fri Jul 17 14:23:57 2020 +0200

    Refactor: move ParticleFunction to separate file

commit 2679236047
Author: Jacques Lucke <jacques@blender.org>
Date:   Fri Jul 17 14:15:06 2020 +0200

    Cleanup: avoid static initialization order issues when accessing CPPTypes

    Instead of depending on static initialization order of globals use
    static variables within functions. Those are initialized on first use.
    This is every so slighly less efficient, but avoids a full class of problems.

commit 3ef59121a4
Author: Jacques Lucke <jacques@blender.org>
Date:   Fri Jul 17 13:47:57 2020 +0200

    Simulation: move initial simulation code from bf_blenkernel to bf_simulation

    I removed bf_blenkernel from `nodes/CMakeLists.txt` again (added it yesterday),
    because now this was causing me unresolved symbol errors... Without it, cmake
    seems to link the libraries bf_simulation, bf_blenkernel and bf_nodes in the right
    order. Not sure if that is just luck or if it is guaranteed.

    It was possible to fix the issue by using cmakes `LINK_INTERFACE_MULTIPLICITY`,
    but that is probably bad style.

commit 9582797d4b
Author: Jeroen Bakker <jbakker>
Date:   Fri Jul 17 13:47:10 2020 +0200

    Fix T77867: Link Duplicate Object crashes during batch creation

    When using link duplicated objects it could happen that one object is
    calculating the GPUBuffers and the second object is marking these
    buffers invalid. This introduces threading issues.

    This patch fixes this by combining the surface and surface per material
    batches. Most likely the surface per material batches are used and when
    requested you will most likely need the surface batch for the depth
    tests and overlays.

    During tests it slightly improves performance as batches aren't thrown
    away without using it.

    After this patch we can add a quick path for meshes with one material
    and two materials.

    Alternative approaches that have been checked:
    - sync extraction per object: reduced performance to much (-15%)
      ({D8292})
    - post checks: reduced the threading issues, but didn't solve it.
    - separating preparation and execution of the extraction ({D8312})

    Reviewed By: Clément Foucault

    Differential Revision: https://developer.blender.org/D8329

commit bf2bb6db26
Author: Ankit Meel <ankitjmeel@gmail.com>
Date:   Fri Jul 17 12:50:08 2020 +0530

    Cleanup: silence unused variable warning

    Reviewed By: fclem

    Differential Revision: https://developer.blender.org/D8328

commit 0e3d34e48f
Author: Jacques Lucke <jacques@blender.org>
Date:   Fri Jul 17 12:38:15 2020 +0200

    BLI: add StringRefNull.c_str() method

    This should be used whenever you rely on the fact, that the
    returned pointer points to the beginning of a null-terminated array.

commit 0fcd23a388
Author: Jacques Lucke <jacques@blender.org>
Date:   Fri Jul 17 12:28:09 2020 +0200

    Simulation: use better api for adding and removing simulation states

commit c5f61fbf48
Author: Sybren A. Stüvel <sybren@blender.org>
Date:   Fri Jul 17 11:29:46 2020 +0200

    Cleanup: avoid warning about redundant access specifier

    No functional changes.

commit 5910dbdbf7
Author: Jacques Lucke <jacques@blender.org>
Date:   Fri Jul 17 11:36:59 2020 +0200

    Nodes: move some code from blenkernel directory to nodes

    This also introduces the `blender::nodes` namespace. Eventually,
    we want to move most/all of the node implementation files into
    this namespace.

    The reason for this file-move is that the code fits much better
    into the `nodes` directory than in the `blenkernel` directory.

commit 0a40c671b0
Author: Campbell Barton <ideasman42@gmail.com>
Date:   Fri Jul 17 17:11:32 2020 +1000

    Cleanup: consistent ordering for scene argument to UV functions

commit 83e204702d
Author: Campbell Barton <ideasman42@gmail.com>
Date:   Thu Jul 16 23:50:33 2020 +1000

    Cleanup: remove f-string use in favor of percentage for formatting

commit 618f31312c
Author: Campbell Barton <ideasman42@gmail.com>
Date:   Fri Jul 17 17:35:46 2020 +1000

    Fix vertex selection error from recent refactor

    Temporary fix for regression in 8084b7e6e2.

commit 89a7a1c156
Author: Jeroen Bakker <jeroen@blender.org>
Date:   Fri Jul 17 08:31:03 2020 +0200

    Cleanup: extract draw cache sanity checks to own function

commit 608d9b5aa1
Author: Hans Goudey <h.goudey@me.com>
Date:   Thu Jul 16 14:07:47 2020 -0400

    UI: Add shortcuts for constraint panels

    Only the delete shortcut applies here, although the move up and down
    operators can optionally be assigned in the keymap.

    See rB1fa40c9f8a81 for more details and rB5d2005cbb54b for the
    grease pencil modifier panel implementation, which is the same.
    Some refactoring of the constraint delete operator was necessary,
    including adding an invoke function.

    Differential Revision: https://developer.blender.org/D8238

commit b13bbb22e4
Author: Jacques Lucke <jacques@blender.org>
Date:   Thu Jul 16 19:52:28 2020 +0200

    Fix link error in bf_nodes

    I got undefined reference errors on the `NodeMFNetworkBuilder::get_default_fn`
    function under some circumstances. This symbol is definitely defined in bf_blenkernel.
    The error seemed a bit undeterministic and was probably caused by some incorrect
    link order. I don't get the error with this change.

commit 02a3720000
Author: Jacques Lucke <jacques@blender.org>
Date:   Thu Jul 16 18:49:26 2020 +0200

    Simulation: rename bf_physics to bf_simulation

    Also see {rB9363c4de0635394548fa2eb8d205581313029775}.

commit 93f21ebb13
Author: Sebastián Barschkis <sebbas@sebbas.org>
Date:   Thu Jul 16 18:01:08 2020 +0200

    Fluid: Update Mantaflow source files

    Includes cleanup that resolves a -Wunused-but-set-variable warning.

commit e7c1a32a78
Author: Sybren A. Stüvel <sybren@blender.org>
Date:   Thu Jul 16 17:22:58 2020 +0200

    Tests: disable ASAN when discovering tests

    CMake, when it's configuring the project, runs the `blender_test` test
    runner (if it exists from a previous build) to discover which tests it
    contains. At this time none of the tests themselves are run, so it's not
    that useful to run ASAN and have it break things when there are memory
    leaks.

    This commit disables ASAN by injecting `ASAN_OPTIONS="detect_leaks=0"` in
    the environment variables.

    It is not enough to use `set(ENV{ASAN_OPTIONS} "detect_leaks=0")` in
    `tests/gtests/runner/CMakeLists.txt`, as it wouldn't be passed to the child
    process.

commit a138bf57c9
Author: Sybren A. Stüvel <sybren@blender.org>
Date:   Thu Jul 16 16:10:53 2020 +0200

    Tests: move tests from USD test directory into `io/common` and `io/usd`

    This commit is a followup of {D7649}, and ports the USD tests to the new
    testing approach. It moves test code from `tests/gtests/usd` into
    `source/blender/io/common` and `source/blender/io/usd`, and adjusts the
    use of namespaces to be consistent with the other tests.

    I decided to put one test into `io/usd/tests`, instead of
    `io/usd/intern`. The reason is that this test does not correspond with a
    single file in that directory; instead, it tests Blender's integration
    with the USD library itself.

    There are two new CLI arguments for the Big Test Runner:

    - `--test-assets-dir`, which points to the `lib/tests` directory in the
      SVN repository. This allows unit tests to find test assets.
    - `--test-release-dir`, which points to `bin/{BLENDER_VERSION}` in the
      build directory. At the moment this is only used by the USD test.

    The CLI arguments are automatically passed to the Big Test Runner when
    using `ctest`. When manually running the tests, the arguments are only
    required when there is a test run that needs them.

    For more info about splitting some code into 'common', see
    rB084c5d6c7e2cf8.

    No functional changes to the tests themselves, only to the way they are
    built & run.

    Differential Revision: https://developer.blender.org/D8314

    Reviewed by: brecht, mont29

commit 09a483a3aa
Author: Francesco Siddi <fsiddi>
Date:   Thu Jul 16 17:10:15 2020 +0200

    macOS: improve design of .dmg background

    Differential Revision: https://developer.blender.org/D8300

commit 671c6d8afd
Author: Clément Foucault <foucault.clem@gmail.com>
Date:   Thu Jul 16 04:32:09 2020 +0200

    Cleanup: Gizmo: Remove non matched glDisable

    We use the polyline shader for drawing the rotation gizmo now.
    This shader supports clipping without hardware clip planes.

commit 07d70a76df
Author: Clément Foucault <foucault.clem@gmail.com>
Date:   Thu Jul 16 04:31:29 2020 +0200

    Cleanup: WM: Use GPUTexture API instead of raw ogl calls

commit 5099cbeec9
Author: Clément Foucault <foucault.clem@gmail.com>
Date:   Thu Jul 16 04:16:10 2020 +0200

    Cleanup: GPU: Move depth/color masks functions to GPU_state

commit 436d38bb54
Author: Clément Foucault <foucault.clem@gmail.com>
Date:   Thu Jul 16 03:31:25 2020 +0200

    Cleanup: GPU: Move XOR logic op to gpu_state.c

commit 3481f6eaf2
Author: Clément Foucault <foucault.clem@gmail.com>
Date:   Thu Jul 16 03:12:21 2020 +0200

    Cleanup: GPU: Remove GL_DITHER usage

commit 71ac137662
Author: Clément Foucault <foucault.clem@gmail.com>
Date:   Thu Jul 16 03:01:07 2020 +0200

    Cleanup: GPU: Move quad buffer stereo check to GPU module

commit 8084b7e6e2
Author: Clément Foucault <foucault.clem@gmail.com>
Date:   Thu Jul 16 02:50:55 2020 +0200

    Cleanup: GPU: Replace all glReadPixels by GPU equivalent

commit ab19abe223
Author: Clément Foucault <foucault.clem@gmail.com>
Date:   Thu Jul 16 02:06:25 2020 +0200

    Cleanup: Port glClear calls to GPU module functions

commit bc85081156
Author: Clément Foucault <foucault.clem@gmail.com>
Date:   Thu Jul 16 01:20:25 2020 +0200

    Cleanup: DRW: remove uneeded double bind

    Now that binds are permanent there is no need to setup the same
    texture for each subgroups.

commit 56b8adb9e2
Author: Jacques Lucke <jacques@blender.org>
Date:   Thu Jul 16 16:41:36 2020 +0200

    Particles: avoid crash when connected unimplemented node

commit 1494ad20b9
Author: Jacques Lucke <jacques@blender.org>
Date:   Thu Jul 16 16:33:20 2020 +0200

    Particles: add implicit covnersions between Vector and Color

    Not sure if these conversions are a good idea. However, we have them
    in Cycles, so they be available in the simulation node tree for consistency
    reasons.

commit 76bf050853
Author: Jacques Lucke <jacques@blender.org>
Date:   Thu Jul 16 16:29:05 2020 +0200

    Particles: simplify adding new implicit conversions between sockets

commit aa547ce88b
Author: Sebastián Barschkis <sebbas@sebbas.org>
Date:   Thu Jul 16 16:39:14 2020 +0200

    Fluid: Update Mantaflow source files

    Refactored various functions after noticing new warnings when compiling on Apple DTK devices - there should now be fewer warnings when building.

commit f64710a518
Author: Jacques Lucke <jacques@blender.org>
Date:   Thu Jul 16 16:09:09 2020 +0200

    Particles: change initial velocity of particles

    This is only temporary, but makes testing the system a bit easier.

commit 4249d6f58e
Author: Jacques Lucke <jacques@blender.org>
Date:   Thu Jul 16 16:08:18 2020 +0200

    Particles: support Separate/Combine RGB nodes

commit ada173ebfd
Author: Jacques Lucke <jacques@blender.org>
Date:   Thu Jul 16 15:54:18 2020 +0200

    Particles: simplify Combine XYZ node

commit 72df7c23c4
Author: Jacques Lucke <jacques@blender.org>
Date:   Thu Jul 16 15:49:56 2020 +0200

    Particles: support Color Ramp node

commit c7aa0f9d74
Author: Brecht Van Lommel <brecht@blender.org>
Date:   Thu Jul 16 14:54:45 2020 +0200

    Fix T78537: too much memory usage rendering animation with persistent images

    For still images, always return 0 for the current frame number. This ensures
    Cycles can detects that the image did not change.

    Based on patch by Vincent Blankfield.

    Differential Revision: https://developer.blender.org/D8242

commit 279cc34343
Author: Campbell Barton <ideasman42@gmail.com>
Date:   Thu Jul 16 23:44:38 2020 +1000

    Keymap: disable 'Alt' click for tools prompt by default

    Based on feedback from artists in the Blender Studio this is too
    easy to access by accident.

    This is still accessible as a preference.

commit 83955d6769
Author: Jacques Lucke <jacques@blender.org>
Date:   Thu Jul 16 13:25:57 2020 +0200

    Particles: support Map Range node

    Only linear interpolation mode is supported for now.

commit 99fda4d31e
Author: Ray Molenkamp <github@lazydodo.com>
Date:   Thu Jul 16 07:22:52 2020 -0600

    deps builder: Fix typo in windows harvesting

commit 9b6088cb9d
Author: Jacques Lucke <jacques@blender.org>
Date:   Thu Jul 16 14:37:21 2020 +0200

    Simulation: Change BPH prefix to SIM

    In a previous commit the `physics` folder has been renamed to `simulation`.
    This commit updates the function/file prefix accordingly.

commit 9363c4de06
Author: Jacques Lucke <jacques@blender.org>
Date:   Thu Jul 16 14:27:47 2020 +0200

    Simulation: Rename `physics` directory to `simulation`

    Function names will be updated in a separate commit.

    This will be the place for the new particle system and other
    code related to the Simulation data block. We don't want
    to have all that code in blenkernel.

    Approved by brecht.

commit 66b48ad8fb
Author: Brecht Van Lommel <brecht@blender.org>
Date:   Thu Jul 16 12:47:28 2020 +0200

    Fix git tag warning when running make update after recent changes

commit f3ea6a5b28
Author: Jacques Lucke <jacques@blender.org>
Date:   Thu Jul 16 14:15:12 2020 +0200

    Particles: implement more vector math operations

commit 3d8f8085fb
Author: Campbell Barton <ideasman42@gmail.com>
Date:   Thu Jul 16 18:53:41 2020 +1000

    UI: show connected icon for proportional editing in the image space

commit b882f89fe3
Author: Jacques Lucke <jacques@blender.org>
Date:   Thu Jul 16 13:41:47 2020 +0200

    Particles: support for most math node operations

commit 2ddb3dc617
Author: Jacques Lucke <jacques@blender.org>
Date:   Thu Jul 16 13:38:23 2020 +0200

    Nodes: support default function for partially implemented nodes

commit 56aa5b0d8c
Author: Sybren A. Stüvel <sybren@blender.org>
Date:   Thu Jul 16 12:58:49 2020 +0200

    T73268: Link C/C++ unit tests into single executable

    This commit introduces a new way to build unit tests. It is now possible
    for each module to generate its own test library. The tests in these
    libraries are then bundled into a single executable.

    The test executable can be run with `ctest`. Even though the tests
    reside in a single executable, they are still exposed as individual
    tests to `ctest`, and thus can be selected via its `-R` argument.

    Not yet ported tests still build & run as before.

    The following rules apply:

    - Test code should reside in the same directory as the code under test.
    - Tests that target functionality in `somefile.{c,cc}` should reside in
      `somefile_test.cc`.
    - The namespace for tests is the `tests` sub-namespace of the code under
      test. For example, tests for `blender::bke` should be in
      `blender::bke:tests`.
    - The test files should be listed in the module's `CMakeLists.txt` in a
      `blender_add_test_lib()` call. See the `blenkernel` module for an
      example.

    Reviewed By: brecht

    Differential Revision: https://developer.blender.org/D7649

commit 065a00ee3e
Author: Sybren A. Stüvel <sybren@blender.org>
Date:   Tue Jul 14 16:31:54 2020 +0200

    Fix T78920: missing depsgraph relation when using sound strips in VSE

    Having a sound strip in the VSE caused a missing relation error to be
    logged on the console. This was caused by the AUDIO depsgraph component
    not having an entry node. This commits adds that node, and sets up
    relations correctly.

    Differential Revision: https://developer.blender.org/D8290

    Reviewed By: Sergey

commit d4ce777aed
Author: Jacques Lucke <jacques@blender.org>
Date:   Thu Jul 16 11:33:35 2020 +0200

    BLI: move inline include to the bottom to avoid redeclaration warning

commit d897228682
Author: Jacques Lucke <jacques@blender.org>
Date:   Thu Jul 16 11:28:31 2020 +0200

    BLI: move safe math functions to separate header

commit f6f93b5b12
Author: Jacques Lucke <jacques@blender.org>
Date:   Thu Jul 16 11:05:13 2020 +0200

    BLI: add safe_divide, safe_modf and safe_logf

    Those are defined exactly as their corresponding functions in Cycles.

commit 7e0bf7a0f1
Author: Bastien Montagne <bastien@blender.org>
Date:   Thu Jul 16 11:03:11 2020 +0200

    LibOverride: Fix getting proper RNA path and ID from embedded ones.

    Master collections and root node trees should now be working as expected
    in that regard.

commit 35bfe1702c
Author: Jacques Lucke <jacques@blender.org>
Date:   Thu Jul 16 10:46:18 2020 +0200

    BLI: add safe_powf function

    The same function is also used by cycles.

commit 4a9d903e2b
Author: Yevgeny Makarov <jenkm>
Date:   Thu Jul 16 18:06:51 2020 +1000

    Fix View3D "Mirror" menu, both "Global" and "Local" items are GLOBAL

commit 9715ad5aca
Author: Stefan Werner <stewreo@gmail.com>
Date:   Thu Jul 16 09:25:55 2020 +0200

    macOS: Support arm64 architecture.

    Enabling all `make deps` dependencies with the exception of Embree and OIDN.
    After that, Blender can be compiled on an Apple Silicon Mac just like on any
    Intel based Mac. There are still compiler warnings that need to be
    investigated and there are probably a couple of bug still to be discovered
    and to be fixed.

    Most patches to the dependencies are simple and are about disabling SSE and
    setting the proper architecture to compiile for. Notable exception is Python,
    where I back ported a yet to be accepted PR for upstream Python:
    https://github.com/python/cpython/pull/21249

    Cross compiling or buliding a Universal Binary is not supported yet.
    The minimum macOS target version for x86_64 remains at 10.13, the target
    for arm64 is 11.00.

    Differential Revision: https://developer.blender.org/D8236

commit ad4928a171
Author: Campbell Barton <ideasman42@gmail.com>
Date:   Thu Jul 16 17:00:16 2020 +1000

    UI: avoid aligning labels for ui_item_with_label

    Key-map display was doing thousands of redundant alignment operations.
    Set the spacing instead as align was only set to use zero spacing.

    This would have prevented the crash reported by T78636.

commit 75520894c7
Author: Campbell Barton <ideasman42@gmail.com>
Date:   Thu Jul 16 16:32:55 2020 +1000

    Fix T78636: Crash displaying many aligned buttons

    Displaying user preferences search crashed on macOS when the search
    contained a common character such as 'E'.
    This caused alignment to 'alloca' too much memory.

    Replace with a heap allocation fallback.

commit 2811de6e5c
Author: Campbell Barton <ideasman42@gmail.com>
Date:   Thu Jul 16 13:48:01 2020 +1000

    Cleanup: fix building without USE_UIBUT_SPATIAL_ALIGN defined

commit 5b099a25d7
Author: Campbell Barton <ideasman42@gmail.com>
Date:   Thu Jul 16 13:27:50 2020 +1000

    Fix T78966: Center cursor doesn't refresh the UI

commit 123e29c274
Author: Campbell Barton <ideasman42@gmail.com>
Date:   Thu Jul 16 13:17:31 2020 +1000

    Cleanup: missing CMake headers from source lists

commit 54abab53bf
Author: Campbell Barton <ideasman42@gmail.com>
Date:   Thu Jul 16 11:07:36 2020 +1000

    Cleanup: undeclared function warning, unused argument

commit a3d90337b8
Author: Campbell Barton <ideasman42@gmail.com>
Date:   Thu Jul 16 10:58:33 2020 +1000

    Cleanup: spelling

commit d11a2dfe71
Author: Campbell Barton <ideasman42@gmail.com>
Date:   Thu Jul 16 10:44:37 2020 +1000

    Cleanup: minor change to grease pencil material access

    Rename for clarity and avoid passing in the prefix length.

commit 75a09ba2ed
Author: Richard Antalik <richardantalik@gmail.com>
Date:   Thu Jul 16 02:24:37 2020 +0200

    Fix T78837: Prefetching can corrupt .blend files

    This happened because of typo in seq_dupli() when duplicating effect data.
    Instead of duplicating data to new sequence, it was duplicated into original.

    Reviewed By: sergey

    Differential Revision: https://developer.blender.org/D8295

commit 974e36d7d0
Author: Clément Foucault <foucault.clem@gmail.com>
Date:   Wed Jul 15 21:05:50 2020 +0200

    Fix T78647 UVEdit: Crash when entering edit mode with UV Editor open

    Only affects MacOS.

commit 058514aa0a
Author: Clément Foucault <foucault.clem@gmail.com>
Date:   Wed Jul 15 20:10:45 2020 +0200

    PointCloud: Initial rendering support for Workbench

    Also includes outline overlays. Removes the temp overlay drawing

    We make the geometry follow camera like billboards this uses less
    geometry. Currently we use half octahedron for now. Goal would be
    to use icospheres.

    This patch also optimize the case when pointcloud has uniform radius.
    However we should premultiply the radius prop by the default radius
    beforehand to avoid a multiplication on CPU.

    Using geometry instead of pseudo raytraced spheres is more scalable as
    we can render as low as 1 or 2 triangle to a full half sphere and can
    integrate easily in the render pipeline using a low amount of code.

    Reviewed By: brecht

    Differential Revision: https://developer.blender.org/D8301

commit d4d810f817
Author: Clément Foucault <foucault.clem@gmail.com>
Date:   Mon Jul 6 21:15:36 2020 +0200

    Cleanup: EEVEE: Remove concentric samples.

commit 37a8c6d809
Author: Clément Foucault <foucault.clem@gmail.com>
Date:   Mon Jul 6 21:06:16 2020 +0200

    Cleanup: EEVEE: Remove unused IRRADIANCE_CUBEMAP

commit 47885abbe6
Author: Clément Foucault <foucault.clem@gmail.com>
Date:   Wed Jul 15 16:41:30 2020 +0200

    Workbench: Replace viewvecs caculation by DRWView

commit cd8f3c9ee7
Author: Clément Foucault <foucault.clem@gmail.com>
Date:   Wed Jul 15 16:38:44 2020 +0200

    DRW: Add glsl math libraries

    Copied from eevee bsdf_common_lib.glsl

commit 2c1edcf3ef
Author: Clément Foucault <foucault.clem@gmail.com>
Date:   Wed Jul 15 15:01:59 2020 +0200

    EEVEE: Fix undefined behavior in world output

commit 24c846b2b4
Author: Clément Foucault <foucault.clem@gmail.com>
Date:   Wed Jul 15 14:59:52 2020 +0200

    GPU: Shader: Move IN_OUT define to shader GPU_shader_create_ex

    This adds the opportunity to use it in multiple places.

commit 987d14a3b2
Author: Clément Foucault <foucault.clem@gmail.com>
Date:   Wed Jul 15 14:40:28 2020 +0200

    DRW: Shader: Fix const correctness and print better debug output

commit 8e16873086
Author: Clément Foucault <foucault.clem@gmail.com>
Date:   Wed Jul 15 14:39:29 2020 +0200

    DRW: Shader: Add DRW_shader_create(_fullscreen)_with_shaderlib

    Some convenience function for using DRWShaderLibrary.

commit 5dcf60e053
Author: Clément Foucault <foucault.clem@gmail.com>
Date:   Wed Jul 15 14:35:57 2020 +0200

    DRW: View: Add ViewVecs calculation

    This will remove some code duplication between draw engines.

commit f1104c2828
Author: Pablo Dobarro <pablodp606@gmail.com>
Date:   Wed Jul 15 18:52:01 2020 +0200

    Fix T78369: Sculpt Vertex Colors not rendering in EEVEE

    The vertex colors node was using the M_COL attribute type but Sculpt
    Vertex Colors use CD_PROP_COLOR
    Now the Vertex Color node also fallbacks to legacy vertex colors if
    Scultp Vertex Colors are not enabled as experimental.

    Reviewed By: brecht

    Maniphest Tasks: T78369

    Differential Revision: https://developer.blender.org/D8185

commit eb54624a9a
Author: Bastien Montagne <bastien@blender.org>
Date:   Wed Jul 15 18:10:55 2020 +0200

    LibOverride: make outliner's 'override hierarchy' use same logic as 3DView operator.

    So now one can create a 'full', 'complete' override of a character from
    the outliner as well.

commit 5057b28a2f
Author: Bastien Montagne <bastien@blender.org>
Date:   Wed Jul 15 18:09:30 2020 +0200

    LibOverride: move most of 'complete override creation' from ED_object to BKE_lib_override.

    This code is fairly complex and can be used in more places, better not
    duplicate that logic and just have it in BKE area.

commit ba100c883c
Author: Bastien Montagne <bastien@blender.org>
Date:   Wed Jul 15 18:07:56 2020 +0200

    BKE collection: add util to add a collection using another collection as 'template'.

    Similar to what we already had using an object as 'template'.

commit a082e49671
Author: Bastien Montagne <bastien@blender.org>
Date:   Wed Jul 15 15:51:13 2020 +0200

    Cleanup: remove debug prints.

commit cda6da4957
Author: Jacques Lucke <jacques@blender.org>
Date:   Wed Jul 15 18:14:03 2020 +0200

    Fix error in recent commit

    Obviously a copy paste error of mine...

commit ae4098e234
Author: Antonio Vazquez <blendergit@gmail.com>
Date:   Wed Jul 15 17:25:07 2020 +0200

    GPencil: Fix unreported error baking mesh animation

    When the mesh is linked, the materials can not be available or be the same assigned to mesh. Now, if the mesh is linked, a simple two materials conversion is used.

    To get the full list of materials, the mesh must not be linked.

    Also checked some indexes to be sure never get a wrong value and that materials are not created again and again.

commit 36e836d0e9
Author: Sebastián Barschkis <sebbas@sebbas.org>
Date:   Wed Jul 15 17:03:51 2020 +0200

    Fluid: Adjusted Mantaflow version number

    Version number was increased after recent OpenVDB IO changes.

commit 19d17b217a
Author: Jacques Lucke <jacques@blender.org>
Date:   Wed Jul 15 16:48:30 2020 +0200

    Particles: use CD_PROP_FLOAT3 instead of CD_LOCATION

    `CD_LOCATION` was only used temporarily due to the lack
    of a better alternative. This also removes the name from
    `CD_LOCATION` again, because at most one layer of this
    type should exist.

commit 57ec1f37e9
Author: Jacques Lucke <jacques@blender.org>
Date:   Wed Jul 15 16:42:17 2020 +0200

    CustomData: add float2 and float3 data types

    This adds `CD_PROP_FLOAT2` and `CD_PROP_FLOAT3`.

    Reviewers: brecht

    Differential Revision: https://developer.blender.org/D8251

commit e06a346458
Author: Pablo Dobarro <pablodp606@gmail.com>
Date:   Wed Jul 15 16:24:03 2020 +0200

    Fix T78747: Fix mesh boundary detection and automasking

    This issue was produced by a hack in the sculpt mode code from 2.80
     when the sculpt API for connectivity info was not available.
    The smooth brush was the only brush that needed connectivity info,
    so there were 3 different smooth functions with the connectivity
    queries implemented for dyntopo, meshes and grids. The mesh version
    of smoothing was checking the number of connected faces to a vertex
    to mask the mesh boundaries, which was not covering all cases and
    was hardcoded in the smooth function itself.

    This patch removes all those legacy functions and unifies all
    smooth functions into a single one using the new API and the
    automasking system. In order to achieve this, there were needed
    some extra changes:

    - The smooth brush now does not automasks the boundaries by default,
    so its default preset needs to be updated to enable automasking

    - The mesh boundary info is extracted once and cached in a
    bitmap, similar to the disconnected elements IDs. This makes
    boundary detection work as expected in all cases, solving a lot
    of known issues with the smooth brush. In multires, this info is
    extracted and cached only at the base mesh level, so it is much
    more memory efficient than the previous automasking system.

    - In order to keep the brushes responsive as they were before,
    the automasking system can now skip creating the cache when it
    is not needed for the requested options. This means that for
    high poly meshes and simple automasking options the brushes
    won't lag on start.

    Reviewed By: sergey

    Maniphest Tasks: T78747

    Differential Revision: https://developer.blender.org/D8260

commit 10cacbbb15
Author: Pablo Dobarro <pablodp606@gmail.com>
Date:   Tue Jul 14 23:15:13 2020 +0200

    Fix T77417: Topology Automasking not working with individual vertices

    The flood fill operation was setting the mask using to_v, so in the first
    iteration when the floodfill callback was using the active vertex as
    from_v and any other neighbor as to_v, the mask for the active vertex
    was never set.

    Now the mask is set using from_v and it checks if it should continue
    propagating to the next neighbor using to_v.

    Reviewed By: sergey

    Maniphest Tasks: T77417

    Differential Revision: https://developer.blender.org/D8294

commit 613d314251
Author: Campbell Barton <ideasman42@gmail.com>
Date:   Wed Jul 15 17:35:57 2020 +1000

    UV: support region fill for path select

    This matches edit-mesh region selection (Ctrl-Shift-Select).

commit b3c34011c0
Author: Hans Goudey <h.goudey@me.com>
Date:   Wed Jul 15 09:11:01 2020 -0400

    Cleanup: Replace 0 with False for boolean argument

commit efc6f6e1ae
Author: Jacques Lucke <jacques@blender.org>
Date:   Wed Jul 15 14:23:51 2020 +0200

    Clang-Tidy: ignore some newer checks

    Those checks have been added to clang tidy within the last year.
    They fail when I use a clang tidy version I built from source.

    Reviewers: sergey

    Differential Revision: https://developer.blender.org/D8302

commit 5a11c8ba24
Author: Campbell Barton <ideasman42@gmail.com>
Date:   Wed Jul 15 21:48:28 2020 +1000

    Fix T68845: Follow Active Quads, divide by zero error

commit 87f8949f0e
Author: Brecht Van Lommel <brecht@blender.org>
Date:   Wed Jul 15 13:37:13 2020 +0200

    Fix T78930: Cycles OpenCL error on graphics cards that don't support half float

commit 44bb73e765
Author: Germano Cavalcante <germano.costa@ig.com.br>
Date:   Wed Jul 15 08:10:41 2020 -0300

    Revert "Cleanup: simplify Weld Modifier logic"

    This reverts commit 98b1a716d6.

    That commit broke a few modifiers.py tests
    (Screw+Weld and a weld merge threshold).

    And some pairs may be lost in the first loop.

commit ff2fa59689
Author: Jacques Lucke <jacques@blender.org>
Date:   Wed Jul 15 12:45:40 2020 +0200

    Fix T76690: Incorrect liquid particle count displayed

    Reviewers: sergey, sebbas

    Differential Revision: https://developer.blender.org/D7852

commit 4e8fc14120
Author: Antonio Vazquez <blendergit@gmail.com>
Date:   Wed Jul 15 12:47:45 2020 +0200

    GPencil: Fix name typo error

commit 7e2ffbfb25
Author: Sebastian Parborg <darkdefende@gmail.com>
Date:   Wed Jul 15 12:36:48 2020 +0200

    Add missing NULL assignment to D8293

    Missed reseting "next_td" in that patch.
    Shouldn't have caused any issues in practice, but it is nice to be
    extra clear and safe in the code.

commit 50c6448781
Author: Sebastian Parborg <darkdefende@gmail.com>
Date:   Wed Jul 15 12:28:32 2020 +0200

    Fix T78909: Curve-edit proportional connected-only broken

    Now it calculates the actual distance when traveling along the curve.

    I addition to this, it also now supports cyclic curves.

    Reviewed By: Campbell

    Differential Revision: http://developer.blender.org/D8293

commit e8b26a0501
Author: Jacques Lucke <jacques@blender.org>
Date:   Wed Jul 15 11:06:37 2020 +0200

    Fix signed/unsigned comparison

commit 680a81fc49
Author: Bastien Montagne <bastien@blender.org>
Date:   Wed Jul 15 10:58:54 2020 +0200

    LibOverride: rework 'make override' 3DView operator.

    Removed the 'select main object to override' menu when overriding an
    instanced collection, this was no more used anyway.

    Added new behavior allowing to select which directly linked collection
    to override when trying to override an inderctly linked object. This
    allows to link collections without instancing them with an empty object,
    select one of their objects, and call override operator.

commit eb87b1c8f6
Author: Campbell Barton <ideasman42@gmail.com>
Date:   Wed Jul 15 15:37:03 2020 +1000

    Cleanup: remove assignment from a NULL struct

    Quiet ASAN 'member access within null pointer' warning.

    While this doesn't crash, access to 'shading'
    without checking if the 'v3d' would have.

commit 920b138f83
Author: Liam Scaife <Voltist>
Date:   Wed Jul 15 15:19:21 2020 +1000

    UI: Add manifold extrude to extrude menu

commit e062def3b4
Author: Campbell Barton <ideasman42@gmail.com>
Date:   Wed Jul 15 13:11:22 2020 +1000

    Cleanup: spelling

commit 061d76f55c
Author: Campbell Barton <ideasman42@gmail.com>
Date:   Wed Jul 15 13:09:06 2020 +1000

    Revert "Cleanup: remove public unused function."

    This reverts commit 03c8b048a1.

    This commit re-introduced T76837.

    While there is a comment explaining why this function is needed,
    the naming of the poll function does make this confusing.
    The API could be changed to avoid confusion here.

commit d493fc43bd
Author: Germano Cavalcante <germano.costa@ig.com.br>
Date:   Tue Jul 14 17:45:31 2020 -0300

    Fix T78875: Numerical display of delta of translation is not updating in 3d view

commit 7f67e3200a
Author: Sebastián Barschkis <sebbas@sebbas.org>
Date:   Tue Jul 14 22:16:43 2020 +0200

    Fluid: Fix liquid mesh scaling

    Fixes issue with .bobj.gz and .obj mesh files not always being scaled correctly in the viewport.

commit 7e0289b618
Author: Sebastián Barschkis <sebbas@sebbas.org>
Date:   Tue Jul 14 22:15:00 2020 +0200

    Fluid: Updated Mantaflow source files

    New files include fixes for obj mesh import and minor cleanups.

commit 98b1a716d6
Author: Germano Cavalcante <germano.costa@ig.com.br>
Date:   Tue Jul 14 15:18:03 2020 -0300

    Cleanup: simplify Weld Modifier logic

    The original code to rearrange the weld vertices map was confusing.

    It traverses the overlap result multiple times within a loop.

    This part of the code has therefore been rethought, simplified and commented.

    This also results in a slight improvement in the performance of the modifier.

commit dbcc74f801
Author: Sebastián Barschkis <sebbas@sebbas.org>
Date:   Tue Jul 14 18:11:28 2020 +0200

    Fix T77263: Mantaflow: Cache gets deleted at changing upres factor under Particles section.

    Moved fluid simulation reset to separate functions based on type.

commit 0b100e21fb
Author: Jeroen Bakker <j.bakker@atmind.nl>
Date:   Mon Jul 13 14:19:13 2020 +0200

    Fix T78704: RenderPass normals disapear when view isn't updated

    When the view isn't updated the renderpass thought that it was rendering
    the next sample, skipping the conversion from encoded to blender
    normals.

    This patch resets the current sample when only rendering single sample
    layers.

    Reviewed By: Clément Foucault

    Differential Revision: https://developer.blender.org/D8280

commit 6cc88e330b
Author: Jeroen Bakker <j.bakker@atmind.nl>
Date:   Mon Jul 6 08:41:28 2020 +0200

    Fix T78431: Update mesh_cd_layers_type_ to support 8 bytes.

    Sculpt vertex colors changed the `DRW_MeshCDMask` from 4 bytes to 8 bytes, but
    the functions assumed it still was 4 bytes. This patch updates the functions and
    adds a compile time check.

    Reviewed By: Clément Foucault

    Differential Revision: https://developer.blender.org/D8215

commit 2ba1cf4b40
Author: Sebastian Parborg <darkdefende@gmail.com>
Date:   Tue Jul 14 17:26:13 2020 +0200

    Fix T78880: UV Editor - Match prop edit connected behavior with mesh editing and fix Rip Region double proportional checkbox

    This fixes the double prop edit checkbox in the redo menu.

    This also makes it so that proportional edit in connected mode now
    matches how it behaves in mesh edit mode.

    Without this change, ripping in UV edit mode with proportional edit on
    would be useless as the UV verts you ripped will still be stuck together
    even if they were not connected anymore.

    Reviewed By: Campbell

    Differential Revision: http://developer.blender.org/D8289

commit 797027be6b
Author: Sebastián Barschkis <sebbas@sebbas.org>
Date:   Tue Jul 14 16:30:01 2020 +0200

    Fluid: Fix missing flag update for cache

    These flags need to be set correctly in order to distinguish between data that comes from cache files and raw data that comes directly from pointers to the data in Mantaflow.

commit 14eaa9ed63
Author: Bastien Montagne <bastien@blender.org>
Date:   Tue Jul 14 16:03:12 2020 +0200

    LibOverride: fix for removing `use_override_library` in rB3d587efef2872.

    Thanks to @JacquesLucke for the heads up.

commit 8e9dd5492a
Author: Antonio Vazquez <blendergit@gmail.com>
Date:   Tue Jul 14 15:59:40 2020 +0200

    Gpencil: Simplify modifier sample mode minimal vert count fix.

    For this mode is possible use strokes of 2 points.

    Differential revision: https://developer.blender.org/D8138

commit c8a62e4f50
Author: Bastien Montagne <bastien@blender.org>
Date:   Tue Jul 14 15:27:41 2020 +0200

    Cleanup: function name not following its module conventions.

commit 6068f49c33
Author: Jacques Lucke <jacques@blender.org>
Date:   Tue Jul 14 15:20:44 2020 +0200

    BLI: remove static assert noexcept move constructors

    The move constructor of `mpq_class` from GMP currently
    allocates when it is moved. So, it cannot be noexcept.
    Since we want to use this type, this static assert cannot
    stay there.

commit 2e8a78f4d1
Author: Kévin Dietrich <kevin.dietrich@mailoo.org>
Date:   Mon Jul 13 18:26:48 2020 +0200

    Fluid bake: fix memory leak when path validation fails

    Reviewed By: sebbas

    Differential Revision: https://developer.blender.org/D8284

commit 78148e20fa
Author: Campbell Barton <ideasman42@gmail.com>
Date:   Tue Jul 14 22:47:18 2020 +1000

    Cleanup: remove tab indention

commit fa7ace2215
Author: Campbell Barton <ideasman42@gmail.com>
Date:   Tue Jul 14 22:45:33 2020 +1000

    PyAPI: support element multiplication for vector, matrix, quaternions

    This was disabled during 2.8x for smooth porting of 2.7x scripts,

    Now '@' is used for matrix multiplication,
    support '*' to multiple vector elements.

    See T56276.

commit e3fd60b182
Author: Bastien Montagne <bastien@blender.org>
Date:   Tue Jul 14 14:49:59 2020 +0200

    LibOverride: Outliner: Add an operation to override the selected ID and its parents.

    This will override all linked data-blocks in the tree branch leading to
    the selected one.

commit 140b26909e
Author: Bastien Montagne <bastien@blender.org>
Date:   Tue Jul 14 11:38:25 2020 +0200

    LibOverride: Move code tagging reauired dependencies of an override into BKE.

    This is fairly generic code that can be re-used in other places.

commit 1e5ce39156
Author: Germano Cavalcante <germano.costa@ig.com.br>
Date:   Tue Jul 14 09:30:54 2020 -0300

    Fix T78900: Single vertex sliding crashes

    As we can see in `initVertSlide_ex`, `sld` can be `NULL`.
    `sld` is dereferenced, but can still be `NULL`.

commit 01ec76842f
Author: Jacques Lucke <jacques@blender.org>
Date:   Tue Jul 14 13:47:32 2020 +0200

    Fix T77766: support animated global gravity toggle

    Reviewers: sebbas

    Differential Revision: https://developer.blender.org/D8281

commit 4096330b81
Author: Jacques Lucke <jacques@blender.org>
Date:   Tue Jul 14 13:01:46 2020 +0200

    Cleanup: typo

commit 25fc84bf2e
Author: Sergey Sharybin <sergey.vfx@gmail.com>
Date:   Tue Jul 14 10:42:35 2020 +0200

    Fix wrong vector size functions used in knife tool

    Should not use copy_v3_v3 on a 2 element vectors.

commit 26793d619c
Author: Antonio Vazquez <blendergit@gmail.com>
Date:   Tue Jul 14 10:26:19 2020 +0200

    GPencil: Cleanup Build modifier and fix potential div by zero errors

commit 0fb08b7cc4
Author: Campbell Barton <ideasman42@gmail.com>
Date:   Tue Jul 14 16:04:18 2020 +1000

    Cleanup: sort header, cmake paths

commit 93e14e5935
Author: Campbell Barton <ideasman42@gmail.com>
Date:   Tue Jul 14 15:53:56 2020 +1000

    Fix T78883: New bezier curve points to uninitialized memory

commit 5338b36fcc
Author: Campbell Barton <ideasman42@gmail.com>
Date:   Tue Jul 14 15:19:52 2020 +1000

    Cleanup: spelling

commit b818f6b55f
Author: Hans Goudey <h.goudey@me.com>
Date:   Mon Jul 13 20:10:49 2020 -0400

    Fix T78902: Only check main modifier panel for expansion property

    Internally the "show_expanded" property stores the expansion for every
    subpanel, but for RNA we should only check the first bit of the flag that
    corresponds to the main panel.

commit 0b24930541
Author: Hans Goudey <h.goudey@me.com>
Date:   Mon Jul 13 17:16:01 2020 -0400

    UI: Add missing row in curve profile template

commit 37fb586a0b
Author: Germano Cavalcante <germano.costa@ig.com.br>
Date:   Mon Jul 13 16:10:45 2020 -0300

    Cleanup: remove unnecessary member

    `Kfv-> sco` was being treated as a local variable, and can be
    confusing since this value is not updated when navigating the viewport.

commit 70992ae270
Author: Ray Molenkamp <github@lazydodo.com>
Date:   Mon Jul 13 12:29:53 2020 -0600

    Fix: Fix build error with MSVC in BLI_span_test

    span.size() returns an uint, causing a signed/unsigned comparison
    using 3u sidesteps the issue

commit 6e74a8b69f
Author: Brecht Van Lommel <brecht@blender.org>
Date:   Mon Jul 13 16:45:15 2020 +0200

    Fix T78881: Cycles OpenImageDenoise not using albedo and normal correctly

    Properly normalize buffers now. Also expose option to not use albedo and normal
    just like OptiX.

commit 2b5e21fe00
Author: Pablo Dobarro <pablodp606@gmail.com>
Date:   Sat Jul 11 00:19:45 2020 +0200

    Sculpt: Add extra deform types to Smear

    The smear brush was using the stroke direction to slide colors across
    the mesh surface (this is called drag in other sculpt tools). Similarly,
    other deformations can be included. The most common ones in image
    editing are pinch and expand, which can be used to sharpen transitions
    between colors.

    Reviewed By: sergey

    Differential Revision: https://developer.blender.org/D8270

commit 1076952209
Author: Pablo Dobarro <pablodp606@gmail.com>
Date:   Fri Jul 10 23:00:21 2020 +0200

    Fix wrong variable name in Sculpt Vertex Colors experimental check

    Reviewed By: sergey

    Differential Revision: https://developer.blender.org/D8269

commit eb3f74a0fe
Author: Pablo Dobarro <pablodp606@gmail.com>
Date:   Fri Jul 10 19:43:01 2020 +0200

    Sculpt: Enable color palettes for sculpt vertex colors

    Enables the color palette subpanel for brushes that have color
    capabilities (only the paint brush for now)

    Reviewed By: sergey

    Differential Revision: https://developer.blender.org/D8268

commit 8dd2386a68
Author: Bastien Montagne <bastien@blender.org>
Date:   Mon Jul 13 17:43:22 2020 +0200

    IDTemplate: Minor tweak to 'make local/override' code.

    Only update pointer of the template if we actually changed it...

commit fcc91faf3f
Author: Bastien Montagne <bastien@blender.org>
Date:   Mon Jul 13 17:02:58 2020 +0200

    Fix (unreported) bad handling of undo for some IDTemplates operations.

commit 91e67c7bda
Author: Jacques Lucke <jacques@blender.org>
Date:   Mon Jul 13 16:55:39 2020 +0200

    Cleanup: remove some incorrectly placed consts

    Clang-tidy reported that those parameters could be const,
    but that is not true on windows.

commit 3d587efef2
Author: Bastien Montagne <bastien@blender.org>
Date:   Mon Jul 13 16:44:41 2020 +0200

    LibOverride: Cleanup: Remove option to disable library overrides.

    Code is mature enough now to not need this anymore, people who do not
    want to use liboverrides can just not create them.

commit 5c8dd2a703
Author: Germano Cavalcante <germano.costa@ig.com.br>
Date:   Mon Jul 13 11:40:14 2020 -0300

    Cleanup: silence warnings

commit 3dcc7c73e2
Author: Ray Molenkamp <github@lazydodo.com>
Date:   Mon Jul 13 08:38:31 2020 -0600

    MSVC: Fix build error with the 8.1 SDK

    shobjidl_core.h only exists in the windows 10 SDK in the 8.1
    SDK ShObjIdl.h will have the definitions we need, which still
    exists in the 10 SDK and implicitly includes shobjidl_core.h.

    so ShObjIdl.h will work on both SDK versions.

commit 29da019cb3
Author: Szymon Ulatowski <szulat>
Date:   Mon Jul 13 17:02:19 2020 +0200

    EEVEE: Fix sky zenith bug

    Careless use of acos() in spherical coordinates transformation was
    deteriorating the precision near zenith (and nadir) and producing
    glitchy pixels (best seen in longer focal lengths).

    Reviewed By: fclem

    Differential Revision: https://developer.blender.org/D8266

commit 16989c4d1d
Author: Bastien Montagne <bastien@blender.org>
Date:   Mon Jul 13 16:15:52 2020 +0200

    Fix T78037: fresh install of blender 2.83.0 not able to save user startup file.

    Simply remove that check ob userdef's themes, we are never read any
    userdef from startup file anymore, so this check makes no more sense.

    To be backported to 2.83.

commit 952279a366
Author: Sebastián Barschkis <sebbas@sebbas.org>
Date:   Mon Jul 13 16:09:24 2020 +0200

    Fix T76687: [Mantaflow] low domain transformation performance

    Implemented G.moving suggestion from comments.

commit 5ecefc6a07
Author: Brecht Van Lommel <brecht@blender.org>
Date:   Mon Jul 13 15:42:47 2020 +0200

    Build: make update support for git tags

    Previously it only picked the appropriate version with the
    blender-vX.XX-release branches.

commit 2be7a11e43
Author: Sybren A. Stüvel <sybren@blender.org>
Date:   Mon Jul 13 15:26:00 2020 +0200

    Python API: new RNA property `Screen.is_scrubbing`

    This commit adds a new read-only boolean property `Screen.is_scrubbing`.

    The related property `Screen.is_animation_playing` is set to `True` in
    two situations:

    - Animation is actually playing (for example via the Play button in the
      timeline)
    - The user is scrubbing through time (in the timeline, dopesheet, graph
      editor, etc.)

    To distinguish between these two cases, the property
    `Screen.is_scrubbing` has been added.

    Concept approved by @brecht.

commit b9f565881e
Author: Sybren A. Stüvel <sybren@blender.org>
Date:   Mon Jul 13 15:02:25 2020 +0200

    VSE: Python API, allow creation of VSE Movie strips with missing file

    It was already possible to create Sound and Image strips that reference
    non-existing files. Now it's also possible to create Movie strips
    referencing missing files via the Python API call
    `Sequences.new_movie()`. In this case, the duration of the strip will be
    set to 1 frame.

    Note that this commit does not change anything in the user interface.

    The Python API of the `MovieStrip` class is extended with a function
    `reload_if_needed()`. This function only performs disk I/O if the movie
    strip cannot produce frames, that is either when its filepath points to
    a non-existing file, or when the video sequence editor has not been
    shown yet (for example because it is in an inactive workspace).

    This allows for the following:

    ```
    import bpy

    scene = bpy.context.scene
    vse = scene.sequence_editor_create()

    filepath = bpy.path.abspath('//demo.mkv')
    strip = vse.sequences.new_movie("movie", filepath,
        channel=2,
        frame_start=47,
        file_must_exist=False)
    strip.frame_final_end = 327
    ```

    This will create a new movie strip, even when `demo.mkv` does not exist.

    Once `demo.mkv` has appeared at the expected location, either
    `strip.reload_if_needed()` or `strip.filepath = strip.filepath` will
    load it.

    Differential Revision: https://developer.blender.org/D8257

    Reviewed By: Sergey, ISS

commit 9db0c36af1
Author: Bastien Montagne <bastien@blender.org>
Date:   Mon Jul 13 14:29:04 2020 +0200

    LibOverride: add more polling checks to operators not supposed to work on overrides.

    This is long work, we are still likely missing a lot of cases...

commit 03c8b048a1
Author: Bastien Montagne <bastien@blender.org>
Date:   Mon Jul 13 14:15:57 2020 +0200

    Cleanup: remove public unused function.

commit 9c9eb03d78
Author: Germano Cavalcante <germano.costa@ig.com.br>
Date:   Sun Jul 12 21:47:50 2020 -0300

    Fix T78855: Knife tool crashes when the geometry has no face

    I don't see the need for a BVH Tree to have root but not have leafs.
    But apparently this case is possible.

commit f019164f1f
Author: Germano Cavalcante <germano.costa@ig.com.br>
Date:   Sun Jul 12 21:13:05 2020 -0300

    Optimization: Use dedicated function to restore customdata

    Called when canceling a transform operation.

commit 8074a18964
Author: Germano Cavalcante <germano.costa@ig.com.br>
Date:   Sun Jul 12 21:01:54 2020 -0300

    Cleanup: move unchanged condition out of loop

commit 7b558a20a9
Author: Germano Cavalcante <germano.costa@ig.com.br>
Date:   Sun Jul 12 20:53:22 2020 -0300

    Fix Extrude Manifold losing original UV

commit 976a0ff691
Author: Bastien Montagne <bastien@blender.org>
Date:   Mon Jul 13 12:48:56 2020 +0200

    RNA code cleanup: Fix wrong usages of `rna_idproperty_check()`.

    This function is more expansive than the simpler `rna_ensure_property()`
    one, and should only be used when IDProperty data is actually needed.

    If one only needs to ensure it has a valid PropertyRNA pointer,
    `rna_ensure_property()` is much more efficient.

    Also add compiler warnings when results of those functions are unused,
    this should never be the case.

commit f8afbb7657
Author: Bastien Montagne <bastien@blender.org>
Date:   Mon Jul 13 12:47:49 2020 +0200

    RNA property management: tweak to 'is set' information.

    Only consider a full IDProperty as set if it actually exists in given
    PointerRNA data.

commit 0158571b34
Author: Bastien Montagne <bastien@blender.org>
Date:   Mon Jul 13 12:46:29 2020 +0200

    I18n utils: fix broken case when 'settings' argument is default NULL one.

commit 7453ff73ad
Author: Jacques Lucke <jacques@blender.org>
Date:   Mon Jul 13 12:48:46 2020 +0200

    Cleanup: quiet warnings by adding const in some places

    The warnings were introduced in rB725973485a909c2b732c5.

commit 725973485a
Author: Jacques Lucke <jacques@blender.org>
Date:   Mon Jul 13 11:27:09 2020 +0200

    Clang Tidy: enable readability-non-const-parameter warning

    Clang Tidy reported a couple of false positives. I disabled
    those `NOLINTNEXTLINE`.

    Differential Revision: https://developer.blender.org/D8199

commit a19584a471
Author: Jacques Lucke <jacques@blender.org>
Date:   Mon Jul 13 10:51:46 2020 +0200

    BLI: fix constructor regression for Vector and Array

    This was introduced in rB403384998a6bb5f428e15ced5.

commit 644a915b1b
Author: Jacques Lucke <jacques@blender.org>
Date:   Mon Jul 13 10:49:59 2020 +0200

    BLI: don't allow mutable span of initializer list

commit 0718c6fae0
Author: Jacques Lucke <jacques@blender.org>
Date:   Mon Jul 13 10:40:05 2020 +0200

    Cleanup: fix clang tidy warning

    The code was actually correct, but clang tidy complaint about
    using the Vector after it was moved from.

commit 91c763af3e
Author: Jacques Lucke <jacques@blender.org>
Date:   Mon Jul 13 10:34:44 2020 +0200

    Cleanup: typo

commit 6dabfacb38
Author: Lukas Stockner <lukas.stockner@freenet.de>
Date:   Mon Jul 13 01:53:54 2020 +0200

    Sky: Code style and formatting fixes

    Differential Revision: https://developer.blender.org/D8091

commit 6a3c91f7ad
Author: Lukas Stockner <lukas.stockner@freenet.de>
Date:   Mon Jul 13 01:53:02 2020 +0200

    Cycles: Clamp Sky Texture altitude to avoid numerical issues

    Differential Revision: https://developer.blender.org/D8091

commit 7aacf2e119
Author: Lukas Stockner <lukas.stockner@freenet.de>
Date:   Mon Jul 13 01:52:07 2020 +0200

    Cycles: Account for Sky Texture mapping in the sun sampling code

    Differential Revision: https://developer.blender.org/D8091

commit 192bd2605f
Author: Lukas Stockner <lukas.stockner@freenet.de>
Date:   Mon Jul 13 01:51:13 2020 +0200

    Cycles: Change precomputed Sky Texture mapping to prioritize the horizon

    Differential Revision: https://developer.blender.org/D8091

commit 41e6f9bd43
Author: Lukas Stockner <lukas.stockner@freenet.de>
Date:   Mon Jul 13 01:49:25 2020 +0200

    Cycles: Add control for sun intensity in Sky Texture and change altitude to km

    Differential Revision: https://developer.blender.org/D8091

commit e2736afdbe
Author: Lukas Stockner <lukas.stockner@freenet.de>
Date:   Mon Jul 13 01:44:24 2020 +0200

    Cycles: Add versioning code for the new Sky Texture model

    Differential Revision: https://developer.blender.org/D8091

commit 77cd8182f8
Author: Lukas Stockner <lukas.stockner@freenet.de>
Date:   Mon Jul 13 01:40:47 2020 +0200

    Cycles: Remove Vector input on Sky texture when using the included sun

    When using the sun, we need to sun sampling logic to avoid excessive
    sampling map resolution, but that logic assumes that the Vector input
    comes from the view direction.
    That is the case in the vast majority of cases anyways, so the easiest
    solution is to just remove the input for that case.

    Differential Revision: https://developer.blender.org/D8091

commit 474dcbcf12
Author: Lukas Stockner <lukas.stockner@freenet.de>
Date:   Mon Jul 13 01:39:11 2020 +0200

    Cycles: Remove limits on the Sky texture's sun rotation

    For animation/driver purposes, being able to go outside of the 0-360
    range makes things easier.

    Differential Revision: https://developer.blender.org/D8091

commit f319eec881
Author: Jacques Lucke <jacques@blender.org>
Date:   Sun Jul 12 11:05:43 2020 +0200

    Cleanup: disable debug code

commit 30ed51d60a
Author: Jacques Lucke <jacques@blender.org>
Date:   Sun Jul 12 12:50:19 2020 +0200

    Cleanup: unused debug variable

commit 21b20ae5ec
Author: Jacques Lucke <jacques@blender.org>
Date:   Sun Jul 12 12:38:57 2020 +0200

    Particles: initial support for forces in simulation node trees

    The force node can now be used to control the behavior of particles.
    Forces can access particles attributes. Currently, there are three attributes:
    `Position` (vector), `Velocity` (vector) and `ID` (integer).

    Supported nodes are: Math, Vector Math, Separate Vector, Combine Vector and Value.

    Next, I'll have to split `simulation.cc` into multiple files and move
    some stuff out of blenkernel into another folder.

commit ebf9082e1c
Author: Jacques Lucke <jacques@blender.org>
Date:   Sun Jul 12 12:38:30 2020 +0200

    Nodes: support more implicit conversions in simulation node tree

commit 838b1742fb
Author: Jacques Lucke <jacques@blender.org>
Date:   Sun Jul 12 12:38:03 2020 +0200

    Functions: minor improvements

commit 404486e66c
Author: Jacques Lucke <jacques@blender.org>
Date:   Sun Jul 12 10:01:37 2020 +0200

    Functions: minor api improvements

commit ee5c2f6ead
Author: Antonio Vazquez <blendergit@gmail.com>
Date:   Sat Jul 11 20:41:21 2020 +0200

    GPencil: Replace "ShaderFX" with "Shader Effects" in RNA prop text

commit c7eada103c
Author: Jacques Lucke <jacques@blender.org>
Date:   Sat Jul 11 18:02:06 2020 +0200

    Nodes: support implicit conversions and incorrectly linked sockets

commit 06401157a6
Author: Jacques Lucke <jacques@blender.org>
Date:   Sat Jul 11 17:59:43 2020 +0200

    Fix: incorrect attribute type in network

commit 46b79b3d4a
Author: Jacques Lucke <jacques@blender.org>
Date:   Sat Jul 11 16:55:57 2020 +0200

    Nodes: support vector math node in simulation node tree

commit b920875893
Author: Jacques Lucke <jacques@blender.org>
Date:   Sat Jul 11 16:47:53 2020 +0200

    Nodes: support math node in simulation node tree

commit 8fae58ce0b
Author: Jacques Lucke <jacques@blender.org>
Date:   Sat Jul 11 16:39:17 2020 +0200

    Nodes: support Value node in simulation node tree

commit 16d4373158
Author: Jacques Lucke <jacques@blender.org>
Date:   Sat Jul 11 16:24:53 2020 +0200

    Nodes: move Math, Vector Math and Value shader nodes to c++ files

    This required a little bit of refactoring, because we were using c-only
    syntax for the gpu shader names. All tests are still passing.

commit 415d3ee05b
Author: Campbell Barton <ideasman42@gmail.com>
Date:   Sat Jul 11 22:03:27 2020 +1000

    UV: add path select operator that uses the selection

    Instead of using the mouse cursor position,
    this selects between existing selected elements.

    Access this since picking a selection path doesn't
    work from the menu.

commit 6e698653df
Author: Campbell Barton <ideasman42@gmail.com>
Date:   Sat Jul 11 20:34:17 2020 +1000

    Cleanup: remove unused function

commit 651db1b26f
Author: Campbell Barton <ideasman42@gmail.com>
Date:   Sat Jul 11 15:10:05 2020 +1000

    Cleanup: spelling

commit 020e0f11ff
Author: Campbell Barton <ideasman42@gmail.com>
Date:   Sat Jul 11 14:50:47 2020 +1000

    Docs: remove reference to PYTHONHOME

    This is no longer used by default, when '--python-use-system-env' is set
    there are many Python environment variables, don't list them in
    Blender's help message.

commit d2b910fafe
Author: Aaron Carlisle <carlisle.b3d@gmail.com>
Date:   Fri Jul 10 16:07:31 2020 -0400

    UI: UV: Add Select Shortest Path to menu

    This matches the 3D Viewport

commit 3dc0178390
Author: Brecht Van Lommel <brecht@blender.org>
Date:   Fri Jul 10 20:00:20 2020 +0200

    Fix T78662: Cycles baking fails if denoising is enabled, after recent changes

    This is not supported yet.

commit 6fbacd6048
Author: Brecht Van Lommel <brecht@blender.org>
Date:   Fri Jul 10 19:56:53 2020 +0200

    Fix build error building without OpenImageDenoise

commit 48f10319c6
Author: Brecht Van Lommel <brecht@blender.org>
Date:   Fri Jul 10 18:40:35 2020 +0200

    Fix T78801: Eevee missing setting to enable/disable freestyle per view layer

    This was only visible when Cycles was enabled.

commit 4e8fc15586
Author: Hans Goudey <h.goudey@me.com>
Date:   Fri Jul 10 12:21:32 2020 -0400

    UI: Improve transform constraint layout

      - Remove the "mapping" subpanel and moves the source axis
        selection ot the destination subpanel.
      - Rename "Source" and "Destination" to "Map From" and "Map To" to
        make the action more clear
      - Gray out source axes when their data isn't selected.

      These changes were discussed in D8041.

commit 3e4f49fe71
Author: Brecht Van Lommel <brecht@blender.org>
Date:   Fri Jul 10 18:02:51 2020 +0200

    Revert "Fix T78296: Performance - Use Binary Search for MDeformWeight"

    This reverts commit 39b525e0f0 and
    3121015dce as tests are failing.

commit d5208c45fa
Author: Antonio Vazquez <blendergit@gmail.com>
Date:   Fri Jul 10 17:56:05 2020 +0200

    GPencil: Fix unreported Use Falloff curve for active frame not working

    For the active frame it was using always a value of 1.0 and it was not using the curve.

commit 6eeb32706a
Author: Brecht Van Lommel <brecht@blender.org>
Date:   Thu Jul 9 12:20:07 2020 +0200

    Cycles: support OpenImageDenoise in final renders

    Performance is not great currently due to the API not seeming to support
    efficient denoising of multiple tiles at the same time. So in many cases
    only one or a few threads will actually be denoising at the same time.

    In renders with many samples this is not a big problem, but for faster
    renders it's a signficant overhead.

    We should try to optimize this still, possibly by batching denoising of
    a bigger neighborhood of multiple tiles at once.

commit 93791381fe
Author: Brecht Van Lommel <brecht@blender.org>
Date:   Thu Jul 9 20:01:22 2020 +0200

    Cleanup: reduce hardcoded numbers in denoising neighbor tiles code

commit e65c78cd43
Author: Brecht Van Lommel <brecht@blender.org>
Date:   Thu Jul 9 18:54:42 2020 +0200

    Cleanup: minor refactoring in Cycles update detection code

commit ad45b8d6a4
Author: Milan Jaros <jar091>
Date:   Fri Jul 10 11:49:52 2020 +0200

    Cycles: optimize camera inside volume tests

    Only run when there are volumes in the scene, and compute in parallel.

    Ref T56939

    Differential Revision: https://developer.blender.org/D8261

commit d8e648c352
Author: Brecht Van Lommel <brecht@blender.org>
Date:   Fri Jul 10 17:09:35 2020 +0200

    Fix T78776: Cycles OpenCL error after recent changes for holdouts

commit 9dbe9a753a
Author: Bastien Montagne <bastien@blender.org>
Date:   Fri Jul 10 16:50:26 2020 +0200

    Fix T78766: Blender crashes after deleting vertices with Custom Normals.

    Some core BMesh topology changing functions were not properly tagging
    custom normal runtime caches as dirty...

commit 5372924983
Author: Richard Antalik <richardantalik@gmail.com>
Date:   Fri Jul 10 16:14:10 2020 +0200

    Fix T78579: Proxy produces wrong preview when using Offset or Crop

    Make sure that proxy and original images are scaled to same size before
    applying offset or crop.

    During testing, I discovered, that raw cache will lose information whether
    this image was proxy or not. Because of this, proxy images will not create
    this cache type. It would be fairly easy to implement this functionality for
    cache, but I have decided to not do it now, because I did not want to pass yet
    another mostly hard-coded bool flag to cache system. Since image is proxy, it
    should be fast to read anyway.

    In case of using offset property, code was modified to make sure we scale
    image only once. I also tried to make code more readable and streamlined and
    cleaned up surrounding functions a bit.

    Reviewed By: brecht

    Differential Revision: https://developer.blender.org/D8203

commit 77f823a240
Author: Richard Antalik <richardantalik@gmail.com>
Date:   Fri Jul 10 15:57:28 2020 +0200

    Fix T78573: Crash when removing strips with prefetching

    Stop prefetching before changing content of seqbase.

    Reviewed By: brecht

    Differential Revision: https://developer.blender.org/D8256

commit 47e71f4623
Author: Richard Antalik <richardantalik@gmail.com>
Date:   Fri Jul 10 15:53:57 2020 +0200

    Fix T69440: Memory leak adding strips via python

    seq->strip was overwritten in python API function.

    Reviewed By: sergey

    Differential Revision: https://developer.blender.org/D8204

commit cbfedf2139
Author: Jacques Lucke <jacques@blender.org>
Date:   Fri Jul 10 15:53:36 2020 +0200

    BLI: add C++ random number generator

    This adds `blender::RandomNumberGenerator` in `BLI_rand.hh`.
    Furthermore, `RNG` is now implemented in terms of this new generator.
    No functional changes are expected, the generated random numbers
    are not changed by this commit.

    Reviewers: campbellbarton, brecht

    Differential Revision: https://developer.blender.org/D8259

commit c2304d2f02
Author: Bastien Montagne <bastien@blender.org>
Date:   Fri Jul 10 15:29:03 2020 +0200

    Expose override flags to python RNA properties definition.

    Time will tell whether we need to expose more RNA override flags here.

    Implements/Fix T78534.

    Differential Revision: https://developer.blender.org/D8250

commit 4d1c3c029e
Author: Jacques Lucke <jacques@blender.org>
Date:   Fri Jul 10 08:37:35 2020 +0200

    Cleanup: declaration and implementation function signature did not match

commit f93e0f1a9e
Author: Bastien Montagne <bastien@blender.org>
Date:   Fri Jul 10 15:23:52 2020 +0200

    Refactor override code to properly deal with runtime rna properties too.

    The triplet static RNA / runtime RNA / custom properties is a real pain to
    deal with...

    Using the new `PropertyRNAOrID` struct helps clarifying and properly
    dealing with all three cases.

    Note that this makes override of py-defined RNA properties working
    (support for that will be committed next).

    Differential Revision: https://developer.blender.org/D8249

commit 337e2c9029
Author: Bastien Montagne <bastien@blender.org>
Date:   Fri Jul 10 15:19:40 2020 +0200

    RNA: refactor how we get 'ensured' RNA properties.

    Introduce new PropertyRNAOrID structure, storing most useful data about
    an 'opaque' PropertyRNA in relation with a given PointerRNA struct.

    It deals with all the three cases (pure static RNA, runtime RNA where
    data is actually stored in IDProperties, and pure IDProperties, aka
    custom data.

commit 6c1157201a
Author: Campbell Barton <ideasman42@gmail.com>
Date:   Fri Jul 10 22:59:12 2020 +1000

    Cleanup: simplify platform define checks

    Platforms besides WIN32 were in a single else clause, use elif instead.

commit 45287f909c
Author: Campbell Barton <ideasman42@gmail.com>
Date:   Fri Jul 10 22:58:30 2020 +1000

    Fix for building on systems besides apple/windows/linux

commit 26d28ade26
Author: Jacques Lucke <jacques@blender.org>
Date:   Fri Jul 10 14:40:23 2020 +0200

    Cleanup: follow code style

commit c806db6313
Author: Jacques Lucke <jacques@blender.org>
Date:   Fri Jul 10 14:22:35 2020 +0200

    Functions: add utility to find dependencies of input sockets

commit 60133ff98d
Author: Jacques Lucke <jacques@blender.org>
Date:   Fri Jul 10 14:20:39 2020 +0200

    Functions: store derived node tree and network in map for future access

commit 295b3aefb0
Author: Jacques Lucke <jacques@blender.org>
Date:   Fri Jul 10 14:19:45 2020 +0200

    Functions: make constant folding work on unfinished networks

commit 7bae599232
Author: Jacques Lucke <jacques@blender.org>
Date:   Fri Jul 10 14:18:51 2020 +0200

    Nodes: add redundant name check in debug builds to prevent errors

commit 3121015dce
Author: Jeroen Bakker <jeroen@blender.org>
Date:   Fri Jul 10 13:37:12 2020 +0200

    Fix Crash due to recent changes

    {39b525e0f07fa25dcda54226ade789959b642dec} could write in unallocated
    space.

commit 00eb6a56aa
Author: Antonio Vazquez <blendergit@gmail.com>
Date:   Fri Jul 10 13:30:08 2020 +0200

    GPencil: Fix tooltip error

    The tooltip was copied by error from Lattice modifier.

commit 8fd65a2252
Author: Jacques Lucke <jacques@blender.org>
Date:   Fri Jul 10 12:56:57 2020 +0200

    Functions: use new is-equal and hash function of CPPType

commit 3edd2832b2
Author: Jacques Lucke <jacques@blender.org>
Date:   Fri Jul 10 12:54:19 2020 +0200

    Functions: make generic types hashable

commit f62204718b
Author: Jacques Lucke <jacques@blender.org>
Date:   Fri Jul 10 12:53:50 2020 +0200

    BLI: initial hash function for Color4b and float4x4

commit 8f6c0f2242
Author: Jacques Lucke <jacques@blender.org>
Date:   Fri Jul 10 12:41:51 2020 +0200

    Functions: make generic types equality comparable

commit 52636c3059
Author: Jacques Lucke <jacques@blender.org>
Date:   Fri Jul 10 12:36:06 2020 +0200

    Cleanup: various cleanups in for CPPType

commit 39b525e0f0
Author: Jeroen Bakker <jeroen@blender.org>
Date:   Fri Jul 10 12:05:31 2020 +0200

    Fix T78296: Performance - Use Binary Search for MDeformWeight

    Use binary search for querying deform weights.

    Spring 02_020_A.anim.blend on Ryzen 1700X goes from 12.4 to 12.7fps.

    During profiling it was detected that adding new items to the head was faster than adding to the tail.

    Reviewed By: Campbell Barton

    Differential Revision: https://developer.blender.org/D8127

commit 77a646279d
Author: Jacques Lucke <jacques@blender.org>
Date:   Fri Jul 10 12:04:32 2020 +0200

    Cleanup: structure CPPType according to code style guide

commit 9c25731781
Author: Bastien Montagne <bastien@blender.org>
Date:   Fri Jul 10 11:53:11 2020 +0200

    LibOverride: Fix improper tagging of more of the backward pointers in RNA nodetrees.

commit 582a0b7e5a
Author: Campbell Barton <ideasman42@gmail.com>
Date:   Fri Jul 10 19:02:18 2020 +1000

    Fix T78756: White UV drawing is displayed as Dashed

commit 7a9028cad1
Author: Campbell Barton <ideasman42@gmail.com>
Date:   Fri Jul 10 18:58:36 2020 +1000

    Fix UV rip failing to disable proportional edit-mode

commit a148c4676b
Author: Campbell Barton <ideasman42@gmail.com>
Date:   Fri Jul 10 16:04:09 2020 +1000

    Cleanup: spelling

commit 03f5acd445
Author: Campbell Barton <ideasman42@gmail.com>
Date:   Fri Jul 10 16:03:12 2020 +1000

    Cleanup: clang-format

commit 8b660ea0ec
Author: Campbell Barton <ideasman42@gmail.com>
Date:   Fri Jul 10 13:36:16 2020 +1000

    Fix UV path redo in vert/edge mode

    Redo was only working in some situations,
    some options were also not being forwarded.

commit 96068324cd
Author: Campbell Barton <ideasman42@gmail.com>
Date:   Fri Jul 10 13:35:44 2020 +1000

    Fix BM_loop_at_index_find lookup

commit 89cb41faa0
Author: Campbell Barton <ideasman42@gmail.com>
Date:   Fri Jul 10 12:55:59 2020 +1000

    UV: allow ripping face-regions

    This changes the behavior of rip when entire faces are selected.
    Now face regions are isolated and moved instead of ripping the edge-loop
    extracted from the selection boundary.

    This is a convenient alternative to separate selection & move.
    Resolves T78751.

commit 3fdd092649
Author: Campbell Barton <ideasman42@gmail.com>
Date:   Fri Jul 10 12:38:28 2020 +1000

    Cleanup: face-center mesh calculation

    Loop over faces and calculate their centers instead of zeroing the
    face center array and accumulating all faces vertex corners.

    Move subsurf face center extraction into it's own loop since it works
    differently.

commit b0378440ce
Author: Campbell Barton <ideasman42@gmail.com>
Date:   Fri Jul 10 12:18:43 2020 +1000

    Fix missing adjacent UV check for recent UV path select

    Path selection could cross UV islands if the destination element was
    on an island boundary.

commit 8f24ec2e26
Author: Campbell Barton <ideasman42@gmail.com>
Date:   Fri Jul 10 12:04:29 2020 +1000

    Cleanup: add BLI_linklist_find_last

    This makes adding to the end of a linked list simpler,
    In most cases we avoid this in favor of BLI_linklist_append.

    For one off operations it's OK.

commit 3dd460aa7f
Author: Campbell Barton <ideasman42@gmail.com>
Date:   Fri Jul 10 11:41:14 2020 +1000

    Cleanup: spelling

commit a0d3b60015
Author: Campbell Barton <ideasman42@gmail.com>
Date:   Fri Jul 10 11:46:26 2020 +1000

    Cleanup: use FLT_MAX for the maximum path selection cost

    A large number below FLT_MAX was used to avoid overflow,
    however this doesn't cause any problems.

commit 0b77e2f4c4
Author: Campbell Barton <ideasman42@gmail.com>
Date:   Fri Jul 10 11:31:41 2020 +1000

    Cleanup: variable names, use define for maximum path cost

commit 92bc277950
Author: Campbell Barton <ideasman42@gmail.com>
Date:   Fri Jul 10 11:40:38 2020 +1000

    Cleanup: undeclared warnings

commit 3623db7784
Author: Jacques Lucke <jacques@blender.org>
Date:   Thu Jul 9 19:03:50 2020 +0200

    BLI: add more operator overloads for float2

commit 03a00bda2b
Author: Pablo Dobarro <pablodp606@gmail.com>
Date:   Thu Jul 9 17:16:24 2020 +0200

    Sculpt: Make Sculpt Vertex Colors features experimental

    This disables all Sculpt Vertex Colors tools, operators, panels and rendering capabilities and puts them under the "Use Sculpt Vertex Colors" experimental option.

    Reviewed By: brecht

    Differential Revision: https://developer.blender.org/D8239

commit 1e3247c078
Author: Jacques Lucke <jacques@blender.org>
Date:   Thu Jul 9 18:19:39 2020 +0200

    Fix: add missing extern "C"

commit a90b69d065
Author: Brecht Van Lommel <brecht@blender.org>
Date:   Thu Jul 9 18:04:13 2020 +0200

    Build: add more libc compatibility functions for upcoming libraries update

    These are needed by the x264 library.

commit 6778949e01
Author: Pablo Dobarro <pablodp606@gmail.com>
Date:   Thu Jul 9 17:56:00 2020 +0200

    Fix repeated Face Sets IDs when joining meshes

    As Face Sets IDs start from 0 and increase by 1 each time a new face set
    is created in a mesh, when joining multiple meshes it could happen that
    the same ID is used by several unrelated areas in multiple objects. This
    checks the Face Sets IDs when joining meshes and ensures that they are
    not repeated between different objects when joining them, so in the
    resulting mesh all previous face sets will have different IDs.

    Reviewed By: sergey

    Differential Revision: https://developer.blender.org/D8224

commit 7b1c406b54
Author: Bastien Montagne <bastien@blender.org>
Date:   Thu Jul 9 15:33:34 2020 +0200

    Implement T77959: Never duplicate linked data during deep-copy.

    Note that this behavior is enforced on user level for now, but on code
    side it is controlled with a flag, which should make it easy to refine
    that behavior if needed.

    Only exception is when we duplicate a linked ID directly (then we assume
    user wants a local deep-copy of that linked data, and we always also
    duplicate linked sub-data-blocks).

    Note that this commit also slightly refactor the handling of actions of
    animdata, by simplifying `BKE_animdata_copy_id_action()` and adding an
    explicit new `BKE_animdata_duplicate_id_action()` to be used during ID
    duplication (deep copy).

    This also allows us to get rid of the special case for liboverrides.

commit 78b629a98f
Author: Pablo Dobarro <pablodp606@gmail.com>
Date:   Wed Jul 8 18:10:31 2020 +0200

    Sculpt: Skip fully hidden nodes in sculpt tools

    As tools iterators skip not visible vertices, fully hidden nodes can
    also be skipped and considered as masked.

    Reviewed By: sergey

    Differential Revision: https://developer.blender.org/D8244

commit 1fb667da01
Author: Pablo Dobarro <pablodp606@gmail.com>
Date:   Tue Jul 7 23:01:51 2020 +0200

    Fix wrong upate flag when updating the PBVH visibility

    This function was using the wrong flag to update the visibility state of
    the nodes, so I assume that most of the partially visible optimizations
    were not working.

    Reviewed By: sergey

    Differential Revision: https://developer.blender.org/D8243

commit e5ebaa9fd6
Author: Pablo Dobarro <pablodp606@gmail.com>
Date:   Wed Jul 8 17:22:11 2020 +0200

    Fix T78664: Implement Mesh and Face Set boundary automasking in Multires

    This implements the SCULPT_vertex_is_boundary and SCULPT_vertex_has_unique_face_set functions for PBVH_GRIDS, which makes features such as automasking now work in multires. It also fixes some other face sets related features in multires, like face set boundary smoothing.

    This uses the BKE_subdiv_ccg_coarse_mesh_adjacency_info_get function to get the vertex indicies in the base mesh from multires. This way the API functions can get topology or face set information directly from it. In the future, these vertex indices can be used to get any other information from the base mesh from multires, like seams, sharp edges, disconnected elements IDs...

    Reviewed By: sergey

    Maniphest Tasks: T78664

    Differential Revision: https://developer.blender.org/D8227

commit bd84b2cbcc
Author: Pablo Dobarro <pablodp606@gmail.com>
Date:   Sat Jul 4 18:28:40 2020 +0200

    Fix Sculpt Vertex Colors sample color changing brush alpha

    It is not practical to change the alpha of the paint color with the
    color picker as with the current brush design alpha is the main strength
    control for the brush.

    Reviewed By: sergey

    Differential Revision: https://developer.blender.org/D8208

commit 13b1374497
Author: Pablo Dobarro <pablodp606@gmail.com>
Date:   Thu Jul 9 17:41:04 2020 +0200

    Fix crash when using Mask by Color in Multires

    Reviewed By: sergey

    Differential Revision: https://developer.blender.org/D8207

commit 78d48343ae
Author: Sergey Sharybin <sergey.vfx@gmail.com>
Date:   Thu Jul 9 15:59:57 2020 +0200

    Make deps: Fix compilation error on CentOS

    There were two issues.

    First is related on ISPC's CMake configuration forcing C and C++
    compilers to be clang and clang++. This goes against of desired
    behavior when we use our own compiled clang compilers.

    The second issue was related on linker failure: CLang libraries
    are linked statically, and they need some of C++ 11 STL symbols
    which are coming from libstdc++.

    Differential Revision: https://developer.blender.org/D8258

commit 2be0ae7c99
Author: Brecht Van Lommel <brecht@blender.org>
Date:   Thu Jul 9 16:51:48 2020 +0200

    Fix Cycles unnecessary updates to camera in viewport render

    Problem identified by Milan Jaros.

commit 9de09220fc
Author: Szymon Ulatowski <szulat>
Date:   Thu Jul 9 17:19:52 2020 +0200

    EEVEE: Implement the missing Sky texture

    I'm not sure if the Sky was deliberately left out or was just waiting for a
    better moment, but so many I was disappointed that Sky in EEVEE is
    completely white.

    There are already 2 implementations (osl and gpu) so this is the third one.
    Looking at other cases it seems that we are not supposed to share sources
    between cycles and the rest? So the new util_sky_model files are just
    copies of what is already in cycles, except that the data file uses the RGB
    variant of the Hosek/Wilkie model, because we output RGB anyway (but can be
    easily changed to XYZ if desired - the results are nearly identical).
    I am not sure if it is okay to pass 3*9 float values as 3 mat4 uniforms (I
    wanted to use mat3 but it does not work).
    Also, should I cache the sky model data between renders if the parameters
    do not change?

    Reviewed By: fclem, brecht

    Differential Revision: https://developer.blender.org/D7108

commit 42c99ec15b
Author: Jacques Lucke <jacques@blender.org>
Date:   Thu Jul 9 16:37:44 2020 +0200

    BLI: rename rand.c to rand.cc

commit 580d50091c
Author: Jacques Lucke <jacques@blender.org>
Date:   Thu Jul 9 15:40:27 2020 +0200

    Particles: Create a simulation state for every Particle Simulation node

    Every Particle Simulation node has a name (or a path when it is in a node group).
    This name has to be used in the Simulation modifier on a point cloud to see
    the particles.

    Caching has been disabled for now, because it was holding back development
    a bit. To reset the simulation, go back to frame 1.

    Currently, there is no way to influence the simulation. There are just some
    randomly moving points. Changing that is the next step.

commit 31ad43a3c7
Author: Jacques Lucke <jacques@blender.org>
Date:   Thu Jul 9 15:29:25 2020 +0200

    Blenloader: make BLO_read_data_address work in C++

commit 544c435fdd
Author: Brecht Van Lommel <brecht@blender.org>
Date:   Thu Jul 9 12:20:07 2020 +0200

    Fix T78745: Cycles error baking with multiple materials

commit 8ddf7556a5
Author: Bastien Montagne <bastien@blender.org>
Date:   Thu Jul 9 11:44:11 2020 +0200

    Fix T78718: Crash when deleting particle system modifier with the X Shortcut.

    Duplication and deletion code of modifiers was totally wrong for
    particle system, that special weird thing needs its own custom
    management.

    Note that for now I chose not to duplicate the particle settings ID when
    duplicating the modifier...

commit ea5fe7abc1
Author: Campbell Barton <ideasman42@gmail.com>
Date:   Tue Jul 7 17:29:17 2020 +1000

    UV: path selection support

    This adds support for path selection for vertex edge & face selection
    modes, matching mesh editing behavior, useful with the UV rip tool.

    Region select & edge tagging are currently not supported,
    although they could be added eventually.

commit 0b8221683f
Author: Campbell Barton <ideasman42@gmail.com>
Date:   Thu Jul 9 18:23:16 2020 +1000

    BMesh: add utility functions

    - BM_edge_uv_share_vert_check
    - BM_face_uv_calc_center_median_weighted
    - BM_loop_at_index_find

commit 0b3bf69d3c
Author: Campbell Barton <ideasman42@gmail.com>
Date:   Thu Jul 9 13:33:15 2020 +1000

    Cleanup: move BMesh UV queries into their own file

commit 754c5d6a14
Author: Campbell Barton <ideasman42@gmail.com>
Date:   Thu Jul 9 13:29:48 2020 +1000

    Cleanup: clang-format

commit 31bc76ea4e
Author: Jacques Lucke <jacques@blender.org>
Date:   Wed Jul 8 22:29:10 2020 +0200

    Cleanup: remove unnecessary calls to as_span

    This uses the new implicit conversions and constructors
    that have been committed in the previous commit.

    I tested these changes on Linux with gcc and on Windows.

commit 403384998a
Author: Jacques Lucke <jacques@blender.org>
Date:   Wed Jul 8 22:27:25 2020 +0200

    BLI: improve constructors and conversions to span

    This allows us to avoid many calls to `as_span()` methods. I will
    remove those in the next commit. Furthermore, constructors
    of Vector and Array can convert from one type to another now.

    I tested these changes on Linux with gcc and on Windows.

commit 4b85ed819d
Author: Jacques Lucke <jacques@blender.org>
Date:   Wed Jul 8 20:41:00 2020 +0200

    Cleanup: remove unused function

    This is not necessary in C++17 anymore.

commit f7d5d4ee3b
Author: Jacques Lucke <jacques@blender.org>
Date:   Wed Jul 8 20:39:12 2020 +0200

    Cleanup: use c++17 helper variable templates

commit e4926c167b
Author: Bastien Montagne <bastien@blender.org>
Date:   Wed Jul 8 18:08:08 2020 +0200

    Fix T78718: Crash when deleting particle system modifier with the X Shortcut.

    Again those backward pointers not properly flagged in RNA, hence
    generating infinite loops.

commit f4a39cafa1
Author: Jacques Lucke <jacques@blender.org>
Date:   Wed Jul 8 17:05:40 2020 +0200

    Functions: add AttributesRef class

    This is the same as MutableAttributesRef, but the data in it cannot be changed.

commit 439c238bb4
Author: Jacques Lucke <jacques@blender.org>
Date:   Wed Jul 8 17:04:50 2020 +0200

    Cleanup: use different internal socket name

commit 05365d1376
Author: Jacques Lucke <jacques@blender.org>
Date:   Wed Jul 8 17:04:09 2020 +0200

    Functions: support hashing MFDataType and CPPType

commit 2de5de57c5
Author: Sergey Sharybin <sergey.vfx@gmail.com>
Date:   Wed Jul 8 15:03:06 2020 +0200

    Build: fix stack linker warning with ffmpeg on macOS

    The ff_cfhd_init_vlcs() function was using a lot of stack space, which
    made linker on macOS unhappy. Using heap allocation allows to silence
    the warning without causing other side-effects.

    Kept the patch enabled for all platforms to avoid difference in behavior
    and performance on different platforms, which could make certain types
    of investigation very tricky.

    Differential Revision: https://developer.blender.org/D8248

commit cb3c4218bf
Author: Bastien Montagne <bastien@blender.org>
Date:   Wed Jul 8 15:43:57 2020 +0200

    Minor cleanup in rna override code.

commit d1f4546a59
Author: Jacques Lucke <jacques@blender.org>
Date:   Wed Jul 8 15:10:24 2020 +0200

    Functions: implement common subnetwork elimination optimization

    This was the last of the three network optimizations I developed in
    the functions branch. Common subnetwork elimination and constant
    folding together can get rid of most unnecessary nodes.

commit e3e42c00cb
Author: Jacques Lucke <jacques@blender.org>
Date:   Wed Jul 8 15:06:32 2020 +0200

    Functions: Support getting MFSocket based on its id

commit 2b9d62b73a
Author: Jacques Lucke <jacques@blender.org>
Date:   Wed Jul 8 15:06:04 2020 +0200

    Functions: Support accessing socket index of MFSocket

commit 34d175f372
Author: Jacques Lucke <jacques@blender.org>
Date:   Wed Jul 8 15:04:28 2020 +0200

    Functions: initial hash/equals implementation for constant multi-functions

commit 840941215d
Author: Jacques Lucke <jacques@blender.org>
Date:   Wed Jul 8 15:02:47 2020 +0200

    Functions: allow multi-functions to override a hash and equals function

commit 36a547af7b
Author: Jacques Lucke <jacques@blender.org>
Date:   Wed Jul 8 15:01:33 2020 +0200

    Cleanup: add correct license header to tests

commit ff133bbd33
Author: Jacques Lucke <jacques@blender.org>
Date:   Wed Jul 8 14:57:31 2020 +0200

    BLI: add disjoint set data structure

    This can be used to find separate islands in meshes efficiently (as is
    done in cycles already). Furthermore, this helps to implement some
    algorithms on node trees more efficiently.

commit a8ff8b64dc
Author: Jacques Lucke <jacques@blender.org>
Date:   Wed Jul 8 14:40:34 2020 +0200

    BLI: add comparison operators and hash functions for float3, etc.

commit ff444da7c4
Author: Brecht Van Lommel <brecht@blender.org>
Date:   Thu Jul 2 12:28:57 2020 +0200

    macOS: upgrade minimum required version to 10.13 High Sierra

    C++17 does not work on 10.12, and Apple extended support ended for 10.12 in
    October 2019.

    Maniphest Tasks: T76783, T76184

    Differential Revision: https://developer.blender.org/D8179

commit 6435acd8f6
Author: Brecht Van Lommel <brecht@blender.org>
Date:   Wed Jul 8 12:57:59 2020 +0200

    Cycles: support shader transparency for holdout objects

    Now transparent areas of the object will render objects behind.

    Fixes T78728.

commit 643196cc37
Author: Sergey Sharybin <sergey.vfx@gmail.com>
Date:   Wed Jul 8 11:04:49 2020 +0200

    CMake: Fix spelling of Embree passed to find package

    The spelling and capitalization of package name passed to find_package()
    and find_package_handle_standard_args() needs to match.

    Silences CMake warning about mismatch.

    Differential Revision: https://developer.blender.org/D8247

commit 45004d82e0
Author: Jacques Lucke <jacques@blender.org>
Date:   Wed Jul 8 11:18:43 2020 +0200

    Functions: add dead node removal and constant folding optimization

    Those optimizations work on the multi-function network level.
    Not only will they make the network evaluation faster, but they also
    simplify the network a lot. That makes it easier to understand the
    exported dot graph.

commit 50d7c00d9c
Author: Jacques Lucke <jacques@blender.org>
Date:   Wed Jul 8 10:16:56 2020 +0200

    Cleanup: fix comment

commit 01c8aa12a1
Author: Alexander Gavrilov <angavrilov@gmail.com>
Date:   Wed Jul 1 17:38:07 2020 +0300

    Apply Modifier: support applying as shape key and keeping the modifier.

    This can be useful to save the result of a cloth simulation as a
    shape key without destroying the simulation, so it's possible to
    e.g. re-run it to get other shapes, or simply use the new shape
    key to start the simulation already in a draped state.

    It also makes sense to allow applying as shape key even when the
    mesh is shared, because the operation itself just adds a shape
    key. To support this, split the apply operator into Apply and
    Apply As Shapekey so that they can have different poll callbacks.

    Differential Revision: https://developer.blender.org/D8173

commit 7fcb6bc59c
Author: Lukas Stockner <lukas.stockner@freenet.de>
Date:   Wed Jul 8 02:10:02 2020 +0200

    Fix T78324: Different Sky Texture results between CPU and GPU

    The problem here was numerical precision: The code calculates the angle between
    sun and view direction, and the usual acos(dot(a, b)) approach for that has
    poor numerical performance for almost parallel angles.

    As a result, the generally tiny difference between floating point computation
    between CPU and GPU was enough to make the sun vanish at different radii,
    causing different results.

    The new version fixes the difference by making the computation much more robust
    on both platforms.

commit afcb41a0aa
Author: Jacques Lucke <jacques@blender.org>
Date:   Tue Jul 7 20:32:40 2020 +0200

    BLI: simplify copy constructor of Array

commit eb5fb1741d
Author: Jacques Lucke <jacques@blender.org>
Date:   Tue Jul 7 20:29:35 2020 +0200

    Cleanup: don't end description with a '.'

commit 8713109212
Author: Jacques Lucke <jacques@blender.org>
Date:   Tue Jul 7 20:27:34 2020 +0200

    Cleanup: fix typo

commit 902ee4d13c
Author: Jacques Lucke <jacques@blender.org>
Date:   Tue Jul 7 19:46:10 2020 +0200

    Functions: cleanup loop that traverses the MFNetwork

commit 22158162ef
Author: Jacques Lucke <jacques@blender.org>
Date:   Tue Jul 7 19:34:35 2020 +0200

    Functions: add generic functions that output constants

commit f4633cf46c
Author: Jacques Lucke <jacques@blender.org>
Date:   Tue Jul 7 19:16:31 2020 +0200

    BLI: simplify copy constructor of vector

commit 67042aa6a1
Author: Jacques Lucke <jacques@blender.org>
Date:   Tue Jul 7 18:45:34 2020 +0200

    Functions: extend multi-function network api

commit adfae89f96
Author: Jacques Lucke <jacques@blender.org>
Date:   Tue Jul 7 18:40:42 2020 +0200

    BLI: provide access to underlying node in dot exporter

commit a8627ea66d
Author: Jacques Lucke <jacques@blender.org>
Date:   Tue Jul 7 18:39:24 2020 +0200

    Functions: Add debug print and destruct callback to CPPType

commit 4990e4dd01
Author: Jacques Lucke <jacques@blender.org>
Date:   Tue Jul 7 18:23:33 2020 +0200

    Nodes: Generate multi-function network from node tree

    This adds new callbacks to `bNodeSocketType` and `bNodeType`.
    Those are used to generate a multi-function network from a node
    tree. Later, this network is evaluated on e.g. particle data.

    Reviewers: brecht

    Differential Revision: https://developer.blender.org/D8169

commit ff97545c50
Author: Clément Foucault <foucault.clem@gmail.com>
Date:   Tue Jul 7 18:37:35 2020 +0200

    Fix T75943 EEVEE: Cubemaps shows black

    Caused by faulty driver implementation. Force fallback method.

commit 1e2ff4f81b
Author: Hans Goudey <h.goudey@me.com>
Date:   Tue Jul 7 11:10:42 2020 -0400

    Cleanup: Add braces for clang tidy

commit 0edf2fc128
Author: Sergey Sharybin <sergey.vfx@gmail.com>
Date:   Tue Jul 7 16:51:03 2020 +0200

    BLI: Correct spin lock definition

    The MSVC atomic function is defined for an unsigned type.

    Not sure why this became an issue after switch to TBB by default,
    maybe some CFLAGS changed to be more strict after that.

commit dad3de89dc
Author: Germano Cavalcante <germano.costa@ig.com.br>
Date:   Tue Jul 7 11:27:09 2020 -0300

    Fix: remove accidental code

    `v1` and `v2` are already set.

commit d352902758
Author: Sergey Sharybin <sergey.vfx@gmail.com>
Date:   Tue Jul 7 11:16:31 2020 +0200

    Make deps: Use own nasm for ffmpeg and x264

    Fixes the warning: building for macOS, but linking in object file

    Differential Revision: https://developer.blender.org/D8235

commit 1e3c0b4b03
Author: Sergey Sharybin <sergey.vfx@gmail.com>
Date:   Tue Jul 7 10:47:09 2020 +0200

    Make deps: Compile own version of nasm for Apple

    The upstream version of nasm does not put version information to the
    generated object files, which makes linker to show the following
    warning:

      building for macOS, but linking in object file

    Using own patched version of nasm which puts required information to
    the object file, making linker happy.

    The plan is to either streamline the patch and provide it to the
    upstream, or, it that takes too long, get an independent fix from the
    upstream.

commit 202e7ccaae
Author: Jeroen Bakker <j.bakker@atmind.nl>
Date:   Mon Jul 6 14:33:59 2020 +0200

    Fix T77455: Blender Freezes when using the 3d Scale Gizmo

    Issue is reported on Linux ith Intel HD6xx iGPU. Inside
    `gpu_select_sample_query.c` the call to `glGetQueryObjectuiv` froze. After
    bisecting this lead to the polyline shader. When using a 3d color shader
    in stead of the polyline shader during selection seems to fix the issue.

    Other parts of blender might also be effective, but I wasn't able to
    freeze blender in these areas. When it does, we might want to add
    a similar work-around to button2d, cage2d, cage3d & move3d, navigate.

    Backport this patch to 2.83.

    Reviewed By: Clément Foucault

    Differential Revision: https://developer.blender.org/D8217

commit d1dcd2b464
Author: Sergey Sharybin <sergey.vfx@gmail.com>
Date:   Tue Jul 7 16:17:36 2020 +0200

    BLI: Fix mistake in SpinLock TBB migration

    Copy-paste mistake.

commit 20558848d3
Author: Germano Cavalcante <germano.costa@ig.com.br>
Date:   Tue Jul 7 09:45:53 2020 -0300

    Optimization: use `BLI_bvhtree_intersect_plane` to detect faces that will be affected by the knife tool

    The knife code currently calls the `BLI_bvhtree_overlap` function that
    tests the overlap between the mesh tree and an AABB that encompasses the
    points projected in the clip_start, clip_end and or clip_planes of the
    view.

    This resulted in many false positives since the AABB is very large.
    Often all the triangles "overlapped".

    The solution was to create a new function that actually tests the
    intersection of AABB with a plane.

    Even not considering the clip_planes of the view, this solution is more
    appropriate than using overlap.

    Differential Revision: https://developer.blender.org/D8229

commit 630c6226e2
Author: Clément Foucault <foucault.clem@gmail.com>
Date:   Tue Jul 7 16:26:01 2020 +0200

    Fix T78307 UI: Drawing artifacts in the Blender UI on macOS

    This was due to a bad driver which was not respecting this bit of the
    specification:

    `If the current primitive does not originate from an instanced draw command, the value of gl_InstanceID is zero.`

commit 737bd549b6
Author: Patrick Mours <pmours@nvidia.com>
Date:   Mon Jul 6 12:25:54 2020 +0200

    Cycles: Add support for native OptiX curve primitive

    This patch adds support for the curve primitive from OptiX to Cycles. It's currently hidden
    behind a debug option, since there can be some slight rendering differences still (because no
    backface culling is performed and something seems off with endcaps). The curve primitive
    was added with the OptiX 7.1 SDK and requires a r450 driver or newer, so this also updates
    the codebase to be able to build with the new SDK.

    Reviewed By: brecht

    Differential Revision: https://developer.blender.org/D8223

commit 95f0f31279
Author: Brecht Van Lommel <brecht@blender.org>
Date:   Tue Jul 7 14:45:31 2020 +0200

    Fix T78692: improve UI regarding the effect of the denoiser on denoising passes

    It wasn't obvious that the choice of Cycles denoiser also generates different
    denoising data passes for compositing.

commit a394aac8b4
Author: Brecht Van Lommel <brecht@blender.org>
Date:   Tue Jul 7 14:47:59 2020 +0200

    Fix T78666: Cycles non-uniformly scaled hair renders wrong for static objects

    Don't apply the matrix transform optimization in this case, curve points and
    radius can't represent non-uniform scale the way is possible with triangle
    meshes and vertices.

    This would cause abrupt change if objects had e.g. motion blur in one frame
    and not in the next.

commit 98bee41c8a
Author: Sybren A. Stüvel <sybren@blender.org>
Date:   Tue Jul 7 14:30:55 2020 +0200

    IO: Reversed persistent ID order in exports to Alembic and USD

    Each duplicated (a.k.a. instanced) object has a Persistent ID, which
    identifies a dupli within the context of its duplicator. This ID
    consists of several numbers when there are nested duplis (for example a
    mesh instancing empties on its vertices, where each empty instances a
    collection). When exporting to Alembic/USD, these are used to uniquely
    name the duplicated objects in the export.

    This commit reverses the order of the persistent ID numbers, so that the
    first number identifies the first level of recursion. This produces
    trees like this:

        ABC
         `--Triangle
             |--Triangle
             |--Empty-1
             |    `--Pole-1-0
             |        |--Pole
             |        `--Block-1-1
             |            `--Block
             |--Empty
             |    `--Pole-0
             |        |--Pole
             |        `--Block-1
             |            `--Block
             |--Empty-2
             |    `--Pole-2-0
             |        |--Pole
             |        `--Block-2-1
             |            `--Block
             `--Empty-0
                 `--Pole-0-0
                     |--Pole
                     `--Block-0-1
                         `--Block

    It is now clearer that `Pole-2-0` and `Block-2-1` are instanced by
    `Empty-2`. Before this commit, they would have been named `Pole-0-2` and
    `Block-1-2`.

commit 70b1c09d7a
Author: Sybren A. Stüvel <sybren@blender.org>
Date:   Tue Jul 7 12:45:30 2020 +0200

    IO: Fix bug exporting dupli parent/child relations

    Exporting a scene to USD or Alembic would fail when there are multiple
    duplicates of parent & child objects, duplicated by the same object. For
    example, this happens when such a hierarchy of objects is contained in a
    collection, and that collection is instanced multiple times by mesh
    vertices. The problem here is that the 'parent' pointer of each
    duplicated object points to the real parent; Blender would not figure
    out properly which duplicated parent should be used.

    This is now resolved by keeping track of the persistent ID of each
    duplicated instance, which makes it possible to reconstruct the
    parent-child relations of duplicated objects. This does use up some
    memory for each dupli, so it could be heavy to export a Spring scene
    (with all the pebbles and leaves), but it's only a small addition on top
    of the USD/Alembic writer objects that have to be created anyway. At
    least with this patch, they're created correctly.

    Code-wise, the following changes are made:

    - The export graph (that maps export parent to its export children) used
      to have as its key (Object, Duplicator). This is insufficient to
      correctly distinguish between multiple duplis of the same object by
      the same duplicator, so this is now extended to (Object, Duplicator,
      Persistent ID). To make this possible, new classes `ObjectIdentifier`
      and `PersistentID` are introduced.
    - Finding the parent of a duplicated object is done via its persistent
      ID. In Python notation, the code first tries to find the parent
      instance where `child_persistent_id[1:] == parent_persistent_id[1:]`.
      If that fails, the dupli with persistent ID `child_persistent_id[1:]`
      is used as parent.

    Reviewed By: sergey

    Differential Revision: https://developer.blender.org/D8233

commit f2175e06a7
Author: Sergey Sharybin <sergey.vfx@gmail.com>
Date:   Tue Jul 7 12:43:18 2020 +0200

    Mae deps: Ensure Brotli is disabled for FreeType

    We don't need it and it was optionally enabled, causing Blender to fail
    to link on certain configuration (when Brotli is installed via Homebrew
    for example).

commit 02cd159539
Author: Jacques Lucke <jacques@blender.org>
Date:   Tue Jul 7 12:31:10 2020 +0200

    Cleanup: add comment explaining operator delete

commit cc311e4a52
Author: Sybren A. Stüvel <sybren@blender.org>
Date:   Tue Jun 30 15:13:54 2020 +0200

    IO: print export name instead of object name in debug export graph output

    This is just a change in `AbstractHierarchyIterator::debug_print_export_graph()`
    to aid in debugging. It'll make it possible to distinguish between
    different duplicates of the same object.

    No functional changes to Blender itself.

commit 5761cb9ee2
Author: Jacques Lucke <jacques@blender.org>
Date:   Tue Jul 7 11:52:45 2020 +0200

    Guarded Allocator: add missing operator delete

    This resolves warning C4291 on windows.

commit 80fe5e1b15
Author: Johan Walles <walles>
Date:   Tue Jul 7 11:09:31 2020 +0200

    UI: Add units to motion tracking solve errors

    The unit being "pixels".

    Before this change the solve errors were unitless in the UI.

    With this change in place, the UI is now clear on that the unit of the
    reprojection errors is pixels (px).

    Differential Revision: https://developer.blender.org/D8000

commit 6d9a6f12b3
Author: Sergey Sharybin <sergey.vfx@gmail.com>
Date:   Tue Jul 7 10:06:14 2020 +0200

    Make deps: Fix compilation error of Python on macOS

    The configuration was confused about gettext installed via Homebrew
    and isysroot passed to Python's compilation but not to test programs.

    After this change `import gettext` still works, but it is unclear how
    to test it further,

    Differential Revision: https://developer.blender.org/D8231

commit 955abbeff2
Author: Jacques Lucke <jacques@blender.org>
Date:   Tue Jul 7 09:01:01 2020 +0200

    Fix sign conversion error

commit e233ee1c1f
Author: Philipp Oeser <info@graphics-engineer.com>
Date:   Thu Jun 25 14:37:22 2020 +0200

    Fix T78186: Dyntopo panel error with tools that dont have a brush

    Maniphest Tasks: T78186

    Differential Revision: https://developer.blender.org/D8120

commit 19d4e265b6
Author: Jacques Lucke <jacques@blender.org>
Date:   Tue Jul 7 10:35:28 2020 +0200

    Cleanup: remove redundant comments

    Searching in these files for "_as" will reveal a comment at the
    top, that explains what these methods are for. There is no need
    to duplicate that knowledge all over the place.

commit 6e609f0eb0
Author: Campbell Barton <ideasman42@gmail.com>
Date:   Tue Jul 7 17:50:33 2020 +1000

    Cleanup: use doxy comments

commit 62774baded
Author: Campbell Barton <ideasman42@gmail.com>
Date:   Tue Jul 7 16:06:05 2020 +1000

    UI: add merge/split menus

    This makes the menus and keymap match the edit-mesh
    (M for merge, Alt-M for split).

commit d212b3dc43
Author: Sergey Sharybin <sergey.vfx@gmail.com>
Date:   Mon Jul 6 15:28:19 2020 +0200

    Make deps: Fixes for macOS platform

    Set of fixes which had to be made in order to have dependencies built
    on own laptop:

    - Require bison as a dependent software. It is required by ISPC.

      On macOS it is required to be installed via Homebrew. This is because
      Bison from Xcode toolchain is too old.

    - Made sure Boost is compiled using clang.

      Without this gcc was used, and some unsupported command line argument
      was passed to it.

    - Modify OGG in a way which does in fact pull fixed sized types.
      They are defined in stdint.h.

      Without this fix FFmpeg will not detect presence of OGG because the
      test program fails to compile.

    - Force disable zstd compression and make wepb optional for the TIFF
      library. Without this TIFF might pick up development libraries from
      Homebrew.

    Differential Revision: https://developer.blender.org/D8221

commit b28683b8b5
Author: Campbell Barton <ideasman42@gmail.com>
Date:   Tue Jul 7 16:03:26 2020 +1000

    Cleanup: remove unused arguments

commit 0c58970da7
Author: Campbell Barton <ideasman42@gmail.com>
Date:   Tue Jul 7 12:44:47 2020 +1000

    Cleanup: spelling

commit ad0edc626d
Author: Campbell Barton <ideasman42@gmail.com>
Date:   Tue Jul 7 12:43:45 2020 +1000

    Cleanup: unused World struct members linfac, logfac

commit e20171e59f
Author: Hans Goudey <h.goudey@me.com>
Date:   Mon Jul 6 16:39:28 2020 -0400

    Fix build error with tests for removed functions

    These GHash functions were removed in 12817083ec,
    so the tests should be removed too.

commit d557f05502
Author: Hans Goudey <h.goudey@me.com>
Date:   Mon Jul 6 16:07:54 2020 -0400

    Cleanup: Use bool instead of int

commit 053e0c0af3
Author: Hans Goudey <h.goudey@me.com>
Date:   Mon Jul 6 15:35:21 2020 -0400

    UI: Add shortcuts for shader effect panels

    Only the delete shortcut applies here, although the move up and down
    operators can optionally be assigned in the keymap.

    See rB1fa40c9f8a81 for more details and rB5d2005cbb54b for the
    grease pencil modifier panel implementation, which is the same.

commit 12817083ec
Author: Germano Cavalcante <germano.costa@ig.com.br>
Date:   Mon Jul 6 14:44:30 2020 -0300

    Cleanup: Use the BLI_edgehash API in the sewing simulation of cloths

    Also remove the code in the ghash that is no longer used.

    This change simplifies the existing code.

    Differential Revision: https://developer.blender.org/D8219

commit a856de700b
Author: Hans Goudey <h.goudey@me.com>
Date:   Mon Jul 6 13:17:07 2020 -0400

    Fix T77730: ShaderFx Missing Update Notifier

    This adds a notification type for shaderfx so the properties editor can
    be properly notified to redraw.

    Another possible solution would be to also redraw the shaderfx tab
     with a ND_MODIFIER update, but this solution allows us to avoid
     some unecessary redraws too. There were no existing cases of
    ND_OBJECT | NC_MODIFIER updates, so those cases were
    removed from buttons_area_listener.

    Differential Revision: https://developer.blender.org/D8159

commit f6f4043924
Author: Jacques Lucke <jacques@blender.org>
Date:   Mon Jul 6 17:59:04 2020 +0200

    BLI: add methods to lookup a stored key in a set

commit 1562c9f031
Author: Patrick Mours <pmours@nvidia.com>
Date:   Mon Jul 6 17:32:32 2020 +0200

    Fix OptiX viewport denoising not working when rendering scene (without OptiX) that uses unsupported features

    Denoising devices do not need to load the full feature set of kernels, so only activate the denoising
    feature for them (so that it is possible to use features that are supported by the render devices, but
    not the denoising devices).

commit aabfd2fb9b
Author: Bastien Montagne <bastien@blender.org>
Date:   Mon Jul 6 16:55:00 2020 +0200

    Cleanup: readfile: remove old deprecated OldNewMap for runtime caches.

commit ee3eba902a
Author: Bastien Montagne <bastien@blender.org>
Date:   Mon Jul 6 16:21:41 2020 +0200

    Runtime cache preservation during undo: add support for nodes and embedded IDs.

commit bfc644dcfb
Author: Sybren A. Stüvel <sybren@blender.org>
Date:   Mon Jul 6 16:52:28 2020 +0200

    Reduce `DupliObject::persistent_id` from 16 to 8 items

    For historical reasons, `DupliObject::persistent_id` was of size
    `2*MAX_DUPLI_RECUR`. These reasons are now gone, and the persistent ID
    always gets exactly one array element for every dupli-recursion.

    Differential Revision: https://developer.blender.org/D8222

    Reviewed by: brecht

commit 0b07f9b717
Author: Bastien Montagne <bastien@blender.org>
Date:   Mon Jul 6 15:07:12 2020 +0200

    Fix T78608: Memory leak in Material properties: "Data from SCE".

    Caused by recent own refactor of cache presevation handling in readfile,
    EEVEE's lightcache are weird birds that can also be saved in .blend
    files, need a special handling for those 'persistent' caches...

commit 99feb10b8b
Author: Campbell Barton <ideasman42@gmail.com>
Date:   Mon Jul 6 23:01:36 2020 +1000

    Cleanup: warning, spelling

commit 20446f07f6
Author: Campbell Barton <ideasman42@gmail.com>
Date:   Mon Jul 6 22:52:29 2020 +1000

    Docs: reference bl_rna_get_subclass_py instead of bl_rna_get_subclass

    bl_rna_get_subclass only works for Nodes at the moment.

commit ffaf294c3f
Author: Sergey Sharybin <sergey.vfx@gmail.com>
Date:   Mon Jul 6 14:53:39 2020 +0200

    Fix alignment/size issue on ARM/RPi architecture

    Addresses 964305 from Debian bug tracker.

commit 924578ce19
Author: Germano Cavalcante <germano.costa@ig.com.br>
Date:   Mon Jul 6 09:49:00 2020 -0300

    Optimization: Don't compute the snap to face on the knife tool twice

    Both `knife_find_closest_vert` and `knife_find_closest_edge` call
    `knife_find_closest_face`. Thus, running the raycast twice and setting
    values like `kcd->curr.bmface` and `kcd->curr.is_space` repeatedly.

    So:
    - separate `knife_find_closest_face` from `knife_find_closest_vert` and `knife_find_closest_edge`.
    - rename `knife_find_closest_vert` to `knife_find_closest_vert_of_face`
    - rename `knife_find_closest_edge `to `knife_find_closest_edge_of_face`.
    - do not set parameters previously set.

    Differential Revision: https://developer.blender.org/D8198

commit 073c426900
Author: Germano Cavalcante <germano.costa@ig.com.br>
Date:   Mon Jul 6 09:03:33 2020 -0300

    Fix faces disappearing when AutoMerge & Split

commit c632cf9ccd
Author: Campbell Barton <ideasman42@gmail.com>
Date:   Mon Jul 6 21:23:35 2020 +1000

    Fix UV select separate not refreshing the display

commit 2c0cab03ca
Author: Campbell Barton <ideasman42@gmail.com>
Date:   Mon Jul 6 21:14:12 2020 +1000

    UV: add rip region to toolbar

commit dbe171fb26
Author: Campbell Barton <ideasman42@gmail.com>
Date:   Mon Jul 6 21:03:45 2020 +1000

    Cleanup: spelling, comments

commit 18b6c49a90
Author: Jacques Lucke <jacques@blender.org>
Date:   Mon Jul 6 12:37:11 2020 +0200

    Cleanup: rename namespace TimeIt to timeit

    According to our style guide, namespaces should have
    lower case names.

commit 572c48cf98
Author: Jacques Lucke <jacques@blender.org>
Date:   Mon Jul 6 09:08:53 2020 +0200

    BLI: improve exception safety of memory utils

    Even if we do not use exception in many places in Blender, our core C++ library
    should become exception safe. Otherwise, we don't even have the option
    to work with exceptions if we decide to do so.

commit 703a73fa84
Author: Jacques Lucke <jacques@blender.org>
Date:   Mon Jul 6 10:56:26 2020 +0200

    BLI: refactor how buffers for small object optimization are stored

    Previously, there was an error when operator-> was returning an
    invalid type. See error C2839.

commit 80393a0eba
Author: Campbell Barton <ideasman42@gmail.com>
Date:   Mon Jul 6 17:41:36 2020 +1000

    UV: add rip tool

    New rip tool matching edit-mesh rip functionality.

    Useful as disconnecting UV's, especially for loops is inconvenient
    without this.

    This uses 'V' to rip, changing stitch to 'Alt-V'.

commit 9353477383
Author: Campbell Barton <ideasman42@gmail.com>
Date:   Mon Jul 6 17:41:17 2020 +1000

    BMesh: add BM_face_calc_uv_cross

commit b51b893df8
Author: Campbell Barton <ideasman42@gmail.com>
Date:   Mon Jul 6 17:40:55 2020 +1000

    BMesh: add BM_loop_other_vert_loop_by_edge

commit 705015e0a4
Author: Jeroen Bakker <j.bakker@atmind.nl>
Date:   Mon Jul 6 10:21:14 2020 +0200

    Fix T78481: Workbench Shadow effects XRay

    When in XRay some effects (shadow, cavity & depth of field) aren't supported.
    This patch makes sure that these effects aren't enabled.

commit 4f3045999d
Author: Campbell Barton <ideasman42@gmail.com>
Date:   Mon Jul 6 17:35:41 2020 +1000

    Cleanup: warnings, spelling

commit 0f617cd67e
Author: Jeroen Bakker <j.bakker@atmind.nl>
Date:   Mon Jul 6 07:45:10 2020 +0200

    GPU: Remove local shaders workaround for Intel/Windows

    It has been tested that local shaders workaround isn't needed for the
    latest Windows/Intel 6xx GPU's.

    Currently the local shaders workaround doesn't work anymore during the
    investigation it was detected that the intel drivers didn't need it
    anymore.

    Local shaders should still be fixed as it is also used for some legacy
    iGPU's. The current work around crashes when doing preview renders in
    EEVEE as the default materials aren't available but for the work around
    they should. (See T77346 for more information)

commit baf124c753
Author: Aaron Carlisle <carlisle.b3d@gmail.com>
Date:   Sun Jul 5 16:45:56 2020 -0400

    RNA Manual Reference: Update links

commit 247a28f242
Author: Jacques Lucke <jacques@blender.org>
Date:   Sun Jul 5 15:08:26 2020 +0200

    Revert "BLI: refactor how buffers for small object optimization are stored"

    This reverts commit 5d79f9f276.

    This was introducing build errors in windows. Need a bit more time to check it.

commit 5d79f9f276
Author: Jacques Lucke <jacques@blender.org>
Date:   Sun Jul 5 16:30:26 2020 +0200

    BLI: refactor how buffers for small object optimization are stored

commit 464aaf2701
Author: Antonio Vazquez <blendergit@gmail.com>
Date:   Sat Jul 4 17:31:02 2020 +0200

    Fix T78603: GPencil Noise modifier Vertex Group influence filter missing

    This was removed by error during the last refactor of modiifers.

commit 169bb4b9ce
Author: Jacques Lucke <jacques@blender.org>
Date:   Sat Jul 4 17:28:05 2020 +0200

    BLI: fix mistake in move constructor of Stack

commit 8e97694c8a
Author: Julian Eisel <julian@blender.org>
Date:   Sat Jul 4 17:06:57 2020 +0200

    Fix T78588: Material preview not visible in selection list

    Logic to determine if the library icon should be used was too general.

commit 9168ea8aab
Author: Antonio Vazquez <blendergit@gmail.com>
Date:   Sat Jul 4 11:15:11 2020 +0200

    Cleanup: Fix small typo error

commit 17603816f2
Author: Antonio Vazquez <blendergit@gmail.com>
Date:   Sat Jul 4 11:04:21 2020 +0200

    GPencil: Cleanup some comments typo

commit b0da78084b
Author: Clément Foucault <foucault.clem@gmail.com>
Date:   Sat Jul 4 01:27:12 2020 +0200

    UI: Attempt to fix OSX widget shader issue

    Some OSX GL driver implementation needs a dummy vbo read. This fixed issues
    with the Hair shaders in the past.

    Related to T78307

commit cad98923d0
Author: Richard Antalik <richardantalik@gmail.com>
Date:   Sat Jul 4 01:02:54 2020 +0200

    Cleanup: spelling

commit ea65c6a153
Author: Richard Antalik <richardantalik@gmail.com>
Date:   Sat Jul 4 00:59:09 2020 +0200

    Fix T78433: Adding Fade Generates Python Exception

    This was caused by typo in rB67a822e08684.

commit 4bf56b37ca
Author: Nathan Craddock <nzcraddock@gmail.com>
Date:   Fri Jul 3 13:31:42 2020 -0600

    Cleanup: Use C-style comments in outliner files

    No functional changes. Convert all C++ style comments to C comments.
    Also capitalize and add full stops.

    The comments themselves were not cleaned up. Some could be removed or
    reworded.

commit 59ef43147e
Author: Nathan Craddock <nzcraddock@gmail.com>
Date:   Fri Jul 3 12:48:00 2020 -0600

    Cleanup: Remove unused outliner activation code

    No functional changes. Remove commented calls to extern_set_butspace
    and unused text activation code.

commit 57a48bd0ca
Author: Nathan Craddock <nzcraddock@gmail.com>
Date:   Fri Jul 3 12:36:09 2020 -0600

    Cleanup: Use _fn suffix for outliner button callbacks

    No functional changes. Use _fn instead of _cb.

commit d7dbf90a02
Author: Sebastian Parborg <darkdefende@gmail.com>
Date:   Fri Jul 3 21:22:41 2020 +0200

    Clang-tidy: Enable braces-around-statements warning

commit 185fe9cd8b
Author: Brecht Van Lommel <brecht@blender.org>
Date:   Fri Jul 3 18:55:32 2020 +0200

    Cleanup: compiler warning

commit 46fcc12e83
Author: Brecht Van Lommel <brecht@blender.org>
Date:   Fri Jul 3 18:54:04 2020 +0200

    Fix error in new Hair data type file reading

commit d2db481dc7
Author: Sybren A. Stüvel <sybren@blender.org>
Date:   Fri Jul 3 18:04:40 2020 +0200

    Cleanup: Blendkernel, Clang-Tidy else-after-return fixes (incomplete)

    This addresses warnings from Clang-Tidy's `readability-else-after-return`
    rule in the `source/blender/blenkernel` module. Not all warnings are
    addressed in this commit.

    No functional changes.

commit a21cb22f8b
Author: Hans Goudey <h.goudey@me.com>
Date:   Fri Jul 3 11:58:43 2020 -0400

    Cleanup: Deduplicate code for finding context object

    Instead of manually checking the pinned object, use the existing
    ED_object_active_context function. This requires adding const
    to the context in that function.

commit 33a74941c5
Author: Sybren A. Stüvel <sybren@blender.org>
Date:   Fri Jul 3 17:30:31 2020 +0200

    Cleanup: Editors, Clang-Tidy else-after-return fixes

    This addresses warnings from Clang-Tidy's `readability-else-after-return`
    rule in the `source/blender/editors` module.

    No functional changes.

commit 367034f210
Author: Sybren A. Stüvel <sybren@blender.org>
Date:   Fri Jul 3 17:30:09 2020 +0200

    Cleanup: Editors/Space/UV-Edit, Clang-Tidy else-after-return fixes

    This addresses warnings from Clang-Tidy's `readability-else-after-return`
    rule in the `source/blender/editors/uv_edit` module.

    No functional changes.

commit 651d1aa7c8
Author: Sybren A. Stüvel <sybren@blender.org>
Date:   Fri Jul 3 17:25:04 2020 +0200

    Cleanup: Editors/Transform, Clang-Tidy else-after-return fixes

    This addresses warnings from Clang-Tidy's `readability-else-after-return`
    rule in the `source/blender/editors/transform` module.

    No functional changes.

commit 35ce16939c
Author: Sybren A. Stüvel <sybren@blender.org>
Date:   Fri Jul 3 17:20:58 2020 +0200

    Cleanup: Editors/Space/sequencer, Clang-Tidy else-after-return fixes

    This addresses warnings from Clang-Tidy's `readability-else-after-return`
    rule in the `source/blender/editors/space_sequencer` module.

    No functional changes.

commit a201020cd3
Author: Sybren A. Stüvel <sybren@blender.org>
Date:   Fri Jul 3 17:20:41 2020 +0200

    Cleanup: Editors/Space/Clip, Clang-Tidy else-after-return fixes

    This addresses warnings from Clang-Tidy's `readability-else-after-return`
    rule in the `source/blender/editors/space_clip` module.

    No functional changes.

commit f254f66587
Author: Sybren A. Stüvel <sybren@blender.org>
Date:   Fri Jul 3 17:20:22 2020 +0200

    Cleanup: Editors/Space/Outliner, Clang-Tidy else-after-return fixes

    This addresses warnings from Clang-Tidy's `readability-else-after-return`
    rule in the `source/blender/editors/space_outliner` module.

    No functional changes.

commit 3aa53b361d
Author: Sybren A. Stüvel <sybren@blender.org>
Date:   Fri Jul 3 17:20:08 2020 +0200

    Cleanup: Editors/Space/Node, Clang-Tidy else-after-return fixes

    This addresses warnings from Clang-Tidy's `readability-else-after-return`
    rule in the `source/blender/editors/space_node` module.

    No functional changes.

commit bf532b1106
Author: Sybren A. Stüvel <sybren@blender.org>
Date:   Fri Jul 3 17:19:13 2020 +0200

    Cleanup: Editors/Space/Text, Clang-Tidy else-after-return fixes

    This addresses warnings from Clang-Tidy's `readability-else-after-return`
    rule in the `source/blender/editors/space_text` module.

    No functional changes.

commit 2f6fc5a7e8
Author: Sybren A. Stüvel <sybren@blender.org>
Date:   Fri Jul 3 17:18:56 2020 +0200

    Cleanup: Editors/Space/View3D, Clang-Tidy else-after-return fixes

    This addresses warnings from Clang-Tidy's `readability-else-after-return`
    rule in the `source/blender/editors/space_view3d` module.

    No functional changes.

commit b61ecb785c
Author: Sybren A. Stüvel <sybren@blender.org>
Date:   Fri Jul 3 16:34:57 2020 +0200

    Cleanup: Explicit return in each `else if` block in `buttons_context()`

    This is a similar change as in rB4283da83cc9.

    No functional changes.

commit f43fedd400
Author: Jacques Lucke <jacques@blender.org>
Date:   Fri Jul 3 17:35:31 2020 +0200

    Cleanup: remove side effect in assertion

commit 4a48939f04
Author: Hans Goudey <h.goudey@me.com>
Date:   Fri Jul 3 11:18:24 2020 -0400

    UI: Fix bevel modifier not showing vertex group

commit cad2d32be6
Author: Sergey Sharybin <sergey.vfx@gmail.com>
Date:   Fri Jul 3 17:09:24 2020 +0200

    Clang-Tidy: Enable bugprone-misplaced-widening-cast

commit 4a5389816b
Author: Jacques Lucke <jacques@blender.org>
Date:   Fri Jul 3 17:07:01 2020 +0200

    Clang-Tidy: enable readability-named-parameter

commit fac2e63bc0
Author: Bastien Montagne <bastien@blender.org>
Date:   Fri Jul 3 16:57:55 2020 +0200

    Fix utterly broken code regarding GPUtextures of MovieClip in readfile.c

    Treat those as pure runtime code, reset to NULL by reading code, for
    now.

    Think those could be handled like Image gputextures (i.e. considered
    runtime cache and preserved across undo steps), but probably not
    critical for now.

commit 1bdabd7b4f
Author: Bastien Montagne <bastien@blender.org>
Date:   Fri Jul 3 16:55:13 2020 +0200

    Move MovieClip to new undo cache management system.

commit 1019c9f582
Author: Jacques Lucke <jacques@blender.org>
Date:   Fri Jul 3 16:54:08 2020 +0200

    Clang-Tidy: enable bugprone-too-small-loop-variable

commit 883f9dd6e5
Author: Jacques Lucke <jacques@blender.org>
Date:   Fri Jul 3 16:48:04 2020 +0200

    Clang-Tidy: enable bugprone-assert-side-effect

    Looks like we have no assertions with side effects.

commit 9739fc4d1b
Author: Sergey Sharybin <sergey.vfx@gmail.com>
Date:   Fri Jul 3 16:44:46 2020 +0200

    Clang-Tidy: More fixed of redundant check before delete

    For some reason got unnoticed in the original cleanup pass.

commit 14fd91e7e8
Author: Jacques Lucke <jacques@blender.org>
Date:   Fri Jul 3 16:38:01 2020 +0200

    Clang-Tidy: enable bugprone-argument-comment

    It was called `inverted` in the header.

commit f4fdb8efc5
Author: Hans Goudey <h.goudey@me.com>
Date:   Fri Jul 3 10:38:49 2020 -0400

    Cleanup: Remove redundant logic

commit f66aafa391
Author: Hans Goudey <h.goudey@me.com>
Date:   Fri Jul 3 10:37:58 2020 -0400

    Fix memory leak when dragging shaderfx

commit f891d4e2ad
Author: Sergey Sharybin <sergey.vfx@gmail.com>
Date:   Fri Jul 3 16:32:12 2020 +0200

    Clang-Tidy: Fix readability-delete-null-pointer warnings

    Also enable it in the configuration.

commit 53d41e1a6f
Author: Hans Goudey <h.goudey@me.com>
Date:   Fri Jul 3 10:28:13 2020 -0400

    UI: Use sliders and [0, 1] ranges in ocean modifier

    The ocean modifier has two properties that use a [0, 10] hard min and
    hard max. The values act as factors though, so it makes more sense to
    use sliders and a 0 to 1 range.

    This commit also bumps the file subversion to avoid repeatedly applying
    the change to the properties' range.

    Differential Revision: https://developer.blender.org/D8186

commit 2a39b34a09
Author: Sybren A. Stüvel <sybren@blender.org>
Date:   Fri Jul 3 16:09:51 2020 +0200

    Cleanup: Editors/Sculpt/Paint, Clang-Tidy else-after-return fixes

    This addresses warnings from Clang-Tidy's `readability-else-after-return`
    rule in the `source/blender/editors/sculpt_paint` module.

    No functional changes.

commit fd5b093f84
Author: Sybren A. Stüvel <sybren@blender.org>
Date:   Fri Jul 3 16:01:15 2020 +0200

    Cleanup: Editors/Screen, Clang-Tidy else-after-return fixes

    This addresses warnings from Clang-Tidy's `readability-else-after-return`
    rule in the `source/blender/editors/screen` module.

    No functional changes.

commit 4283da83cc
Author: Sybren A. Stüvel <sybren@blender.org>
Date:   Fri Jul 3 15:59:48 2020 +0200

    Cleanup: Explicit return in each `else if` block in `ed_screen_context()`

    The `ed_screen_context()` function is approximately 700 lines long, and
    its main structure is a huge chain of `else if` statements. Some of the
    bodies did not return, but rather fell through and relied on the `return
    -1;` at the bottom of the function. This means that in order to truly
    understand what is going on in one of those `else if` blocks, it could
    be required to scroll past all the following `else if` blocks,
    double-checking that they all had an `else`, and then see what happens
    below.

    By adding explicit `return -1;` everywhere this happened, this is all
    avoided, increasing local understandability of the code. Furthermore, it
    makes the upcoming cleanup with the Clang-Tidy rule
    `readability-else-after-return` a lot easier to do.

    No functional changes.

commit de7c9f41e6
Author: Sybren A. Stüvel <sybren@blender.org>
Date:   Fri Jul 3 15:42:22 2020 +0200

    Cleanup: Editors/Object, Clang-Tidy else-after-return fixes

    This addresses warnings from Clang-Tidy's `readability-else-after-return`
    rule in the `source/blender/editors/object` module.

    No functional changes.

commit 19483125f8
Author: Sybren A. Stüvel <sybren@blender.org>
Date:   Fri Jul 3 15:19:52 2020 +0200

    Cleanup: Editors/Mesh, Clang-Tidy else-after-return fixes

    This addresses warnings from Clang-Tidy's `readability-else-after-return`
    rule in the `source/blender/editors/mesh` module.

    No functional changes.

commit 7d0a0b8a6d
Author: Sybren A. Stüvel <sybren@blender.org>
Date:   Fri Jul 3 14:52:32 2020 +0200

    Cleanup: Editors/Armature, Clang-Tidy else-after-return fixes

    This addresses warnings from Clang-Tidy's `readability-else-after-return`
    rule in the `source/blender/editors/armature` module.

    No functional changes.

commit f82e52ebc8
Author: Sybren A. Stüvel <sybren@blender.org>
Date:   Fri Jul 3 14:51:19 2020 +0200

    Cleanup: Editors/Animation, Clang-Tidy else-after-return fixes

    This addresses warnings from Clang-Tidy's `readability-else-after-return`
    rule in the `source/blender/editors/animation` module.

    No functional changes.

commit 17ba566018
Author: Pablo Dobarro <pablodp606@gmail.com>
Date:   Fri Jul 3 02:15:54 2020 +0200

    Fix Pose Brush crashing after disabling connected only in FK mode

    This function was returning the ik_chain before disabling the
    fake_neighbors, so when the brush was used again with fake neighbors
    disabled after rebuilding the PBVH and free them, they were still
    enabled in the SculptSession, causing a the crash.

    Reviewed By: sergey

    Differential Revision: https://developer.blender.org/D8195

commit 3a59c184b9
Author: Bastien Montagne <bastien@blender.org>
Date:   Fri Jul 3 16:09:58 2020 +0200

    Move Scene's cache management during undo to new system.

commit a33756d783
Author: Hans Goudey <h.goudey@me.com>
Date:   Fri Jul 3 10:09:19 2020 -0400

    Cleanup: Unused variables in non-debug build

commit 6a58e15548
Author: Hans Goudey <h.goudey@me.com>
Date:   Fri Jul 3 10:03:16 2020 -0400

    Cleanup: Remove obsolete code in interface_panel.c

    Some code delt with panel merging in earlier versions of Blender,
    which is no longer needed. Other code delt with controls that aren't
    used anymore, and in some cases have region-level equivalents.

    There's a surprising amount of this unused code in this file, so removing it
    will be helpful for the future.

    Differential Revision: https://developer.blender.org/D7938

commit 88d358902f
Author: Jacques Lucke <jacques@blender.org>
Date:   Fri Jul 3 15:54:55 2020 +0200

    Clang-Tidy: Enable readability-redundant-string-cstr

commit 405e6c6cc9
Author: Antonio Vazquez <blendergit@gmail.com>
Date:   Fri Jul 3 15:53:44 2020 +0200

    Fix T78555: GPencil bake animation operator loose frame setting

    The values were reset for each run

commit 19ff145e66
Author: Hans Goudey <h.goudey@me.com>
Date:   Fri Jul 3 09:41:55 2020 -0400

    Clang-Tidy: Enable readability-redundant-control-flow

commit ffef562bf7
Author: Sergey Sharybin <sergey.vfx@gmail.com>
Date:   Fri Jul 3 15:31:23 2020 +0200

    Disable clang-tidy for code-generated RNA files

    This needs some extra care, which is probably easier once the initial
    pass over integration is done.

commit c9975088a9
Author: Bastien Montagne <bastien@blender.org>
Date:   Fri Jul 3 15:27:12 2020 +0200

    Move volume to new cache management system for undo.

commit 1e255ce031
Author: Jacques Lucke <jacques@blender.org>
Date:   Fri Jul 3 15:27:02 2020 +0200

    Fix T72214: Fluids: noise does not work with negative frame numbers

    The issue is duplicated code. There are two functions that zero-fill
    the frame number. They worked the same for positive frames numbers, but
    behaved differently for negative ones.

    On frame `-100`, `BLI_path_frame` outputs `-0100` and
    `fluid_cache_get_framenr_formatted_$ID$` outputted `-100`.

    I changed the behavior of the latter, because we depend on the behavior
    of the former for much longer already.

    Reviewers: sebbas

    Differential Revision: https://developer.blender.org/D8107
2020-07-17 21:40:09 -04:00
cd9b38005e Performance tuning: early rejection of trivial intersections.
Starting to use floating filters to avoid expensive gmp operations
when possible. These changes speed up the sphere-sphere test with
n=64 to 5s (now 17 times slower than BMesh on this test, down from
100 times slower. But answer is correct.
Also make format.
2020-07-16 22:23:18 -04:00
7148f31a3a Reverse the operand order for Difference to match old boolean. 2020-07-14 20:49:03 -04:00
8541b335cb Hooked up new boolean to boolean modifier. 2020-07-14 20:29:39 -04:00
f86b49d710 Comment out an assert prevents running profiler on Mac.
Not sure why this assert is not known to the compiler used
when profiling.
2020-07-14 17:16:07 -04:00
ad81b1993e Speedup, using BVH tree to limit number of tri-tri intersect tests.
Intersection of my spheresphere test with n=16 (two uvspheres
with 16 rings and 32 segments overlapping), time went from
12.8 seconds to 2.3 seconds on my Mac. The n=32 test went from
195.1s to 8.9s.
2020-07-14 08:01:50 -04:00
b10b38d386 Add a mesh intersect sphere-sphere test for performance tuning. 2020-07-13 07:24:43 -04:00
0024605194 Fix a test that needs a new kind of initializer. 2020-07-12 21:45:53 -04:00
a6c80378aa Merge Master, then fixes of problems caused by that.
commit 622aa7bc5015cc3b85deb0eb13b7b315169569b4
Author: Howard Trickey <howard.trickey@gmail.com>
Date:   Sun Jul 12 21:09:59 2020 -0400

    Provided noexcept move contructors for many types.

    Needed because now a static assert trips when making Arrays
    or Vectors of these types.

commit 7a7dd53bca36506fb51788cad0444dcb491b3c13
Merge: 74c56382b8 f319eec881
Author: Howard Trickey <howard.trickey@gmail.com>
Date:   Sun Jul 12 19:22:24 2020 -0400

    Merge branch 'master' into boolmerge

commit f319eec881
Author: Jacques Lucke <jacques@blender.org>
Date:   Sun Jul 12 11:05:43 2020 +0200

    Cleanup: disable debug code

commit 30ed51d60a
Author: Jacques Lucke <jacques@blender.org>
Date:   Sun Jul 12 12:50:19 2020 +0200

    Cleanup: unused debug variable

commit 21b20ae5ec
Author: Jacques Lucke <jacques@blender.org>
Date:   Sun Jul 12 12:38:57 2020 +0200

    Particles: initial support for forces in simulation node trees

    The force node can now be used to control the behavior of particles.
    Forces can access particles attributes. Currently, there are three attributes:
    `Position` (vector), `Velocity` (vector) and `ID` (integer).

    Supported nodes are: Math, Vector Math, Separate Vector, Combine Vector and Value.

    Next, I'll have to split `simulation.cc` into multiple files and move
    some stuff out of blenkernel into another folder.

commit ebf9082e1c
Author: Jacques Lucke <jacques@blender.org>
Date:   Sun Jul 12 12:38:30 2020 +0200

    Nodes: support more implicit conversions in simulation node tree

commit 838b1742fb
Author: Jacques Lucke <jacques@blender.org>
Date:   Sun Jul 12 12:38:03 2020 +0200

    Functions: minor improvements

commit 404486e66c
Author: Jacques Lucke <jacques@blender.org>
Date:   Sun Jul 12 10:01:37 2020 +0200

    Functions: minor api improvements

commit ee5c2f6ead
Author: Antonio Vazquez <blendergit@gmail.com>
Date:   Sat Jul 11 20:41:21 2020 +0200

    GPencil: Replace "ShaderFX" with "Shader Effects" in RNA prop text

commit c7eada103c
Author: Jacques Lucke <jacques@blender.org>
Date:   Sat Jul 11 18:02:06 2020 +0200

    Nodes: support implicit conversions and incorrectly linked sockets

commit 06401157a6
Author: Jacques Lucke <jacques@blender.org>
Date:   Sat Jul 11 17:59:43 2020 +0200

    Fix: incorrect attribute type in network

commit 46b79b3d4a
Author: Jacques Lucke <jacques@blender.org>
Date:   Sat Jul 11 16:55:57 2020 +0200

    Nodes: support vector math node in simulation node tree

commit b920875893
Author: Jacques Lucke <jacques@blender.org>
Date:   Sat Jul 11 16:47:53 2020 +0200

    Nodes: support math node in simulation node tree

commit 8fae58ce0b
Author: Jacques Lucke <jacques@blender.org>
Date:   Sat Jul 11 16:39:17 2020 +0200

    Nodes: support Value node in simulation node tree

commit 16d4373158
Author: Jacques Lucke <jacques@blender.org>
Date:   Sat Jul 11 16:24:53 2020 +0200

    Nodes: move Math, Vector Math and Value shader nodes to c++ files

    This required a little bit of refactoring, because we were using c-only
    syntax for the gpu shader names. All tests are still passing.

commit 415d3ee05b
Author: Campbell Barton <ideasman42@gmail.com>
Date:   Sat Jul 11 22:03:27 2020 +1000

    UV: add path select operator that uses the selection

    Instead of using the mouse cursor position,
    this selects between existing selected elements.

    Access this since picking a selection path doesn't
    work from the menu.

commit 6e698653df
Author: Campbell Barton <ideasman42@gmail.com>
Date:   Sat Jul 11 20:34:17 2020 +1000

    Cleanup: remove unused function

commit 651db1b26f
Author: Campbell Barton <ideasman42@gmail.com>
Date:   Sat Jul 11 15:10:05 2020 +1000

    Cleanup: spelling

commit 020e0f11ff
Author: Campbell Barton <ideasman42@gmail.com>
Date:   Sat Jul 11 14:50:47 2020 +1000

    Docs: remove reference to PYTHONHOME

    This is no longer used by default, when '--python-use-system-env' is set
    there are many Python environment variables, don't list them in
    Blender's help message.

commit d2b910fafe
Author: Aaron Carlisle <carlisle.b3d@gmail.com>
Date:   Fri Jul 10 16:07:31 2020 -0400

    UI: UV: Add Select Shortest Path to menu

    This matches the 3D Viewport

commit 3dc0178390
Author: Brecht Van Lommel <brecht@blender.org>
Date:   Fri Jul 10 20:00:20 2020 +0200

    Fix T78662: Cycles baking fails if denoising is enabled, after recent changes

    This is not supported yet.

commit 6fbacd6048
Author: Brecht Van Lommel <brecht@blender.org>
Date:   Fri Jul 10 19:56:53 2020 +0200

    Fix build error building without OpenImageDenoise

commit 48f10319c6
Author: Brecht Van Lommel <brecht@blender.org>
Date:   Fri Jul 10 18:40:35 2020 +0200

    Fix T78801: Eevee missing setting to enable/disable freestyle per view layer

    This was only visible when Cycles was enabled.

commit 4e8fc15586
Author: Hans Goudey <h.goudey@me.com>
Date:   Fri Jul 10 12:21:32 2020 -0400

    UI: Improve transform constraint layout

      - Remove the "mapping" subpanel and moves the source axis
        selection ot the destination subpanel.
      - Rename "Source" and "Destination" to "Map From" and "Map To" to
        make the action more clear
      - Gray out source axes when their data isn't selected.

      These changes were discussed in D8041.

commit 3e4f49fe71
Author: Brecht Van Lommel <brecht@blender.org>
Date:   Fri Jul 10 18:02:51 2020 +0200

    Revert "Fix T78296: Performance - Use Binary Search for MDeformWeight"

    This reverts commit 39b525e0f0 and
    3121015dce as tests are failing.

commit d5208c45fa
Author: Antonio Vazquez <blendergit@gmail.com>
Date:   Fri Jul 10 17:56:05 2020 +0200

    GPencil: Fix unreported Use Falloff curve for active frame not working

    For the active frame it was using always a value of 1.0 and it was not using the curve.

commit 6eeb32706a
Author: Brecht Van Lommel <brecht@blender.org>
Date:   Thu Jul 9 12:20:07 2020 +0200

    Cycles: support OpenImageDenoise in final renders

    Performance is not great currently due to the API not seeming to support
    efficient denoising of multiple tiles at the same time. So in many cases
    only one or a few threads will actually be denoising at the same time.

    In renders with many samples this is not a big problem, but for faster
    renders it's a signficant overhead.

    We should try to optimize this still, possibly by batching denoising of
    a bigger neighborhood of multiple tiles at once.

commit 93791381fe
Author: Brecht Van Lommel <brecht@blender.org>
Date:   Thu Jul 9 20:01:22 2020 +0200

    Cleanup: reduce hardcoded numbers in denoising neighbor tiles code

commit e65c78cd43
Author: Brecht Van Lommel <brecht@blender.org>
Date:   Thu Jul 9 18:54:42 2020 +0200

    Cleanup: minor refactoring in Cycles update detection code

commit ad45b8d6a4
Author: Milan Jaros <jar091>
Date:   Fri Jul 10 11:49:52 2020 +0200

    Cycles: optimize camera inside volume tests

    Only run when there are volumes in the scene, and compute in parallel.

    Ref T56939

    Differential Revision: https://developer.blender.org/D8261

commit d8e648c352
Author: Brecht Van Lommel <brecht@blender.org>
Date:   Fri Jul 10 17:09:35 2020 +0200

    Fix T78776: Cycles OpenCL error after recent changes for holdouts

commit 9dbe9a753a
Author: Bastien Montagne <bastien@blender.org>
Date:   Fri Jul 10 16:50:26 2020 +0200

    Fix T78766: Blender crashes after deleting vertices with Custom Normals.

    Some core BMesh topology changing functions were not properly tagging
    custom normal runtime caches as dirty...

commit 5372924983
Author: Richard Antalik <richardantalik@gmail.com>
Date:   Fri Jul 10 16:14:10 2020 +0200

    Fix T78579: Proxy produces wrong preview when using Offset or Crop

    Make sure that proxy and original images are scaled to same size before
    applying offset or crop.

    During testing, I discovered, that raw cache will lose information whether
    this image was proxy or not. Because of this, proxy images will not create
    this cache type. It would be fairly easy to implement this functionality for
    cache, but I have decided to not do it now, because I did not want to pass yet
    another mostly hard-coded bool flag to cache system. Since image is proxy, it
    should be fast to read anyway.

    In case of using offset property, code was modified to make sure we scale
    image only once. I also tried to make code more readable and streamlined and
    cleaned up surrounding functions a bit.

    Reviewed By: brecht

    Differential Revision: https://developer.blender.org/D8203

commit 77f823a240
Author: Richard Antalik <richardantalik@gmail.com>
Date:   Fri Jul 10 15:57:28 2020 +0200

    Fix T78573: Crash when removing strips with prefetching

    Stop prefetching before changing content of seqbase.

    Reviewed By: brecht

    Differential Revision: https://developer.blender.org/D8256

commit 47e71f4623
Author: Richard Antalik <richardantalik@gmail.com>
Date:   Fri Jul 10 15:53:57 2020 +0200

    Fix T69440: Memory leak adding strips via python

    seq->strip was overwritten in python API function.

    Reviewed By: sergey

    Differential Revision: https://developer.blender.org/D8204

commit cbfedf2139
Author: Jacques Lucke <jacques@blender.org>
Date:   Fri Jul 10 15:53:36 2020 +0200

    BLI: add C++ random number generator

    This adds `blender::RandomNumberGenerator` in `BLI_rand.hh`.
    Furthermore, `RNG` is now implemented in terms of this new generator.
    No functional changes are expected, the generated random numbers
    are not changed by this commit.

    Reviewers: campbellbarton, brecht

    Differential Revision: https://developer.blender.org/D8259

commit c2304d2f02
Author: Bastien Montagne <bastien@blender.org>
Date:   Fri Jul 10 15:29:03 2020 +0200

    Expose override flags to python RNA properties definition.

    Time will tell whether we need to expose more RNA override flags here.

    Implements/Fix T78534.

    Differential Revision: https://developer.blender.org/D8250

commit 4d1c3c029e
Author: Jacques Lucke <jacques@blender.org>
Date:   Fri Jul 10 08:37:35 2020 +0200

    Cleanup: declaration and implementation function signature did not match

commit f93e0f1a9e
Author: Bastien Montagne <bastien@blender.org>
Date:   Fri Jul 10 15:23:52 2020 +0200

    Refactor override code to properly deal with runtime rna properties too.

    The triplet static RNA / runtime RNA / custom properties is a real pain to
    deal with...

    Using the new `PropertyRNAOrID` struct helps clarifying and properly
    dealing with all three cases.

    Note that this makes override of py-defined RNA properties working
    (support for that will be committed next).

    Differential Revision: https://developer.blender.org/D8249

commit 337e2c9029
Author: Bastien Montagne <bastien@blender.org>
Date:   Fri Jul 10 15:19:40 2020 +0200

    RNA: refactor how we get 'ensured' RNA properties.

    Introduce new PropertyRNAOrID structure, storing most useful data about
    an 'opaque' PropertyRNA in relation with a given PointerRNA struct.

    It deals with all the three cases (pure static RNA, runtime RNA where
    data is actually stored in IDProperties, and pure IDProperties, aka
    custom data.

commit 6c1157201a
Author: Campbell Barton <ideasman42@gmail.com>
Date:   Fri Jul 10 22:59:12 2020 +1000

    Cleanup: simplify platform define checks

    Platforms besides WIN32 were in a single else clause, use elif instead.

commit 45287f909c
Author: Campbell Barton <ideasman42@gmail.com>
Date:   Fri Jul 10 22:58:30 2020 +1000

    Fix for building on systems besides apple/windows/linux

commit 26d28ade26
Author: Jacques Lucke <jacques@blender.org>
Date:   Fri Jul 10 14:40:23 2020 +0200

    Cleanup: follow code style

commit c806db6313
Author: Jacques Lucke <jacques@blender.org>
Date:   Fri Jul 10 14:22:35 2020 +0200

    Functions: add utility to find dependencies of input sockets

commit 60133ff98d
Author: Jacques Lucke <jacques@blender.org>
Date:   Fri Jul 10 14:20:39 2020 +0200

    Functions: store derived node tree and network in map for future access

commit 295b3aefb0
Author: Jacques Lucke <jacques@blender.org>
Date:   Fri Jul 10 14:19:45 2020 +0200

    Functions: make constant folding work on unfinished networks

commit 7bae599232
Author: Jacques Lucke <jacques@blender.org>
Date:   Fri Jul 10 14:18:51 2020 +0200

    Nodes: add redundant name check in debug builds to prevent errors

commit 3121015dce
Author: Jeroen Bakker <jeroen@blender.org>
Date:   Fri Jul 10 13:37:12 2020 +0200

    Fix Crash due to recent changes

    {39b525e0f07fa25dcda54226ade789959b642dec} could write in unallocated
    space.

commit 00eb6a56aa
Author: Antonio Vazquez <blendergit@gmail.com>
Date:   Fri Jul 10 13:30:08 2020 +0200

    GPencil: Fix tooltip error

    The tooltip was copied by error from Lattice modifier.

commit 8fd65a2252
Author: Jacques Lucke <jacques@blender.org>
Date:   Fri Jul 10 12:56:57 2020 +0200

    Functions: use new is-equal and hash function of CPPType

commit 3edd2832b2
Author: Jacques Lucke <jacques@blender.org>
Date:   Fri Jul 10 12:54:19 2020 +0200

    Functions: make generic types hashable

commit f62204718b
Author: Jacques Lucke <jacques@blender.org>
Date:   Fri Jul 10 12:53:50 2020 +0200

    BLI: initial hash function for Color4b and float4x4

commit 8f6c0f2242
Author: Jacques Lucke <jacques@blender.org>
Date:   Fri Jul 10 12:41:51 2020 +0200

    Functions: make generic types equality comparable

commit 52636c3059
Author: Jacques Lucke <jacques@blender.org>
Date:   Fri Jul 10 12:36:06 2020 +0200

    Cleanup: various cleanups in for CPPType

commit 39b525e0f0
Author: Jeroen Bakker <jeroen@blender.org>
Date:   Fri Jul 10 12:05:31 2020 +0200

    Fix T78296: Performance - Use Binary Search for MDeformWeight

    Use binary search for querying deform weights.

    Spring 02_020_A.anim.blend on Ryzen 1700X goes from 12.4 to 12.7fps.

    During profiling it was detected that adding new items to the head was faster than adding to the tail.

    Reviewed By: Campbell Barton

    Differential Revision: https://developer.blender.org/D8127

commit 77a646279d
Author: Jacques Lucke <jacques@blender.org>
Date:   Fri Jul 10 12:04:32 2020 +0200

    Cleanup: structure CPPType according to code style guide

commit 9c25731781
Author: Bastien Montagne <bastien@blender.org>
Date:   Fri Jul 10 11:53:11 2020 +0200

    LibOverride: Fix improper tagging of more of the backward pointers in RNA nodetrees.

commit 582a0b7e5a
Author: Campbell Barton <ideasman42@gmail.com>
Date:   Fri Jul 10 19:02:18 2020 +1000

    Fix T78756: White UV drawing is displayed as Dashed

commit 7a9028cad1
Author: Campbell Barton <ideasman42@gmail.com>
Date:   Fri Jul 10 18:58:36 2020 +1000

    Fix UV rip failing to disable proportional edit-mode

commit a148c4676b
Author: Campbell Barton <ideasman42@gmail.com>
Date:   Fri Jul 10 16:04:09 2020 +1000

    Cleanup: spelling

commit 03f5acd445
Author: Campbell Barton <ideasman42@gmail.com>
Date:   Fri Jul 10 16:03:12 2020 +1000

    Cleanup: clang-format

commit 8b660ea0ec
Author: Campbell Barton <ideasman42@gmail.com>
Date:   Fri Jul 10 13:36:16 2020 +1000

    Fix UV path redo in vert/edge mode

    Redo was only working in some situations,
    some options were also not being forwarded.

commit 96068324cd
Author: Campbell Barton <ideasman42@gmail.com>
Date:   Fri Jul 10 13:35:44 2020 +1000

    Fix BM_loop_at_index_find lookup

commit 89cb41faa0
Author: Campbell Barton <ideasman42@gmail.com>
Date:   Fri Jul 10 12:55:59 2020 +1000

    UV: allow ripping face-regions

    This changes the behavior of rip when entire faces are selected.
    Now face regions are isolated and moved instead of ripping the edge-loop
    extracted from the selection boundary.

    This is a convenient alternative to separate selection & move.
    Resolves T78751.

commit 3fdd092649
Author: Campbell Barton <ideasman42@gmail.com>
Date:   Fri Jul 10 12:38:28 2020 +1000

    Cleanup: face-center mesh calculation

    Loop over faces and calculate their centers instead of zeroing the
    face center array and accumulating all faces vertex corners.

    Move subsurf face center extraction into it's own loop since it works
    differently.

commit b0378440ce
Author: Campbell Barton <ideasman42@gmail.com>
Date:   Fri Jul 10 12:18:43 2020 +1000

    Fix missing adjacent UV check for recent UV path select

    Path selection could cross UV islands if the destination element was
    on an island boundary.

commit 8f24ec2e26
Author: Campbell Barton <ideasman42@gmail.com>
Date:   Fri Jul 10 12:04:29 2020 +1000

    Cleanup: add BLI_linklist_find_last

    This makes adding to the end of a linked list simpler,
    In most cases we avoid this in favor of BLI_linklist_append.

    For one off operations it's OK.

commit 3dd460aa7f
Author: Campbell Barton <ideasman42@gmail.com>
Date:   Fri Jul 10 11:41:14 2020 +1000

    Cleanup: spelling

commit a0d3b60015
Author: Campbell Barton <ideasman42@gmail.com>
Date:   Fri Jul 10 11:46:26 2020 +1000

    Cleanup: use FLT_MAX for the maximum path selection cost

    A large number below FLT_MAX was used to avoid overflow,
    however this doesn't cause any problems.

commit 0b77e2f4c4
Author: Campbell Barton <ideasman42@gmail.com>
Date:   Fri Jul 10 11:31:41 2020 +1000

    Cleanup: variable names, use define for maximum path cost

commit 92bc277950
Author: Campbell Barton <ideasman42@gmail.com>
Date:   Fri Jul 10 11:40:38 2020 +1000

    Cleanup: undeclared warnings

commit 3623db7784
Author: Jacques Lucke <jacques@blender.org>
Date:   Thu Jul 9 19:03:50 2020 +0200

    BLI: add more operator overloads for float2

commit 03a00bda2b
Author: Pablo Dobarro <pablodp606@gmail.com>
Date:   Thu Jul 9 17:16:24 2020 +0200

    Sculpt: Make Sculpt Vertex Colors features experimental

    This disables all Sculpt Vertex Colors tools, operators, panels and rendering capabilities and puts them under the "Use Sculpt Vertex Colors" experimental option.

    Reviewed By: brecht

    Differential Revision: https://developer.blender.org/D8239

commit 1e3247c078
Author: Jacques Lucke <jacques@blender.org>
Date:   Thu Jul 9 18:19:39 2020 +0200

    Fix: add missing extern "C"

commit a90b69d065
Author: Brecht Van Lommel <brecht@blender.org>
Date:   Thu Jul 9 18:04:13 2020 +0200

    Build: add more libc compatibility functions for upcoming libraries update

    These are needed by the x264 library.

commit 6778949e01
Author: Pablo Dobarro <pablodp606@gmail.com>
Date:   Thu Jul 9 17:56:00 2020 +0200

    Fix repeated Face Sets IDs when joining meshes

    As Face Sets IDs start from 0 and increase by 1 each time a new face set
    is created in a mesh, when joining multiple meshes it could happen that
    the same ID is used by several unrelated areas in multiple objects. This
    checks the Face Sets IDs when joining meshes and ensures that they are
    not repeated between different objects when joining them, so in the
    resulting mesh all previous face sets will have different IDs.

    Reviewed By: sergey

    Differential Revision: https://developer.blender.org/D8224

commit 7b1c406b54
Author: Bastien Montagne <bastien@blender.org>
Date:   Thu Jul 9 15:33:34 2020 +0200

    Implement T77959: Never duplicate linked data during deep-copy.

    Note that this behavior is enforced on user level for now, but on code
    side it is controlled with a flag, which should make it easy to refine
    that behavior if needed.

    Only exception is when we duplicate a linked ID directly (then we assume
    user wants a local deep-copy of that linked data, and we always also
    duplicate linked sub-data-blocks).

    Note that this commit also slightly refactor the handling of actions of
    animdata, by simplifying `BKE_animdata_copy_id_action()` and adding an
    explicit new `BKE_animdata_duplicate_id_action()` to be used during ID
    duplication (deep copy).

    This also allows us to get rid of the special case for liboverrides.

commit 78b629a98f
Author: Pablo Dobarro <pablodp606@gmail.com>
Date:   Wed Jul 8 18:10:31 2020 +0200

    Sculpt: Skip fully hidden nodes in sculpt tools

    As tools iterators skip not visible vertices, fully hidden nodes can
    also be skipped and considered as masked.

    Reviewed By: sergey

    Differential Revision: https://developer.blender.org/D8244

commit 1fb667da01
Author: Pablo Dobarro <pablodp606@gmail.com>
Date:   Tue Jul 7 23:01:51 2020 +0200

    Fix wrong upate flag when updating the PBVH visibility

    This function was using the wrong flag to update the visibility state of
    the nodes, so I assume that most of the partially visible optimizations
    were not working.

    Reviewed By: sergey

    Differential Revision: https://developer.blender.org/D8243

commit e5ebaa9fd6
Author: Pablo Dobarro <pablodp606@gmail.com>
Date:   Wed Jul 8 17:22:11 2020 +0200

    Fix T78664: Implement Mesh and Face Set boundary automasking in Multires

    This implements the SCULPT_vertex_is_boundary and SCULPT_vertex_has_unique_face_set functions for PBVH_GRIDS, which makes features such as automasking now work in multires. It also fixes some other face sets related features in multires, like face set boundary smoothing.

    This uses the BKE_subdiv_ccg_coarse_mesh_adjacency_info_get function to get the vertex indicies in the base mesh from multires. This way the API functions can get topology or face set information directly from it. In the future, these vertex indices can be used to get any other information from the base mesh from multires, like seams, sharp edges, disconnected elements IDs...

    Reviewed By: sergey

    Maniphest Tasks: T78664

    Differential Revision: https://developer.blender.org/D8227

commit bd84b2cbcc
Author: Pablo Dobarro <pablodp606@gmail.com>
Date:   Sat Jul 4 18:28:40 2020 +0200

    Fix Sculpt Vertex Colors sample color changing brush alpha

    It is not practical to change the alpha of the paint color with the
    color picker as with the current brush design alpha is the main strength
    control for the brush.

    Reviewed By: sergey

    Differential Revision: https://developer.blender.org/D8208

commit 13b1374497
Author: Pablo Dobarro <pablodp606@gmail.com>
Date:   Thu Jul 9 17:41:04 2020 +0200

    Fix crash when using Mask by Color in Multires

    Reviewed By: sergey

    Differential Revision: https://developer.blender.org/D8207

commit 78d48343ae
Author: Sergey Sharybin <sergey.vfx@gmail.com>
Date:   Thu Jul 9 15:59:57 2020 +0200

    Make deps: Fix compilation error on CentOS

    There were two issues.

    First is related on ISPC's CMake configuration forcing C and C++
    compilers to be clang and clang++. This goes against of desired
    behavior when we use our own compiled clang compilers.

    The second issue was related on linker failure: CLang libraries
    are linked statically, and they need some of C++ 11 STL symbols
    which are coming from libstdc++.

    Differential Revision: https://developer.blender.org/D8258

commit 2be0ae7c99
Author: Brecht Van Lommel <brecht@blender.org>
Date:   Thu Jul 9 16:51:48 2020 +0200

    Fix Cycles unnecessary updates to camera in viewport render

    Problem identified by Milan Jaros.

commit 9de09220fc
Author: Szymon Ulatowski <szulat>
Date:   Thu Jul 9 17:19:52 2020 +0200

    EEVEE: Implement the missing Sky texture

    I'm not sure if the Sky was deliberately left out or was just waiting for a
    better moment, but so many I was disappointed that Sky in EEVEE is
    completely white.

    There are already 2 implementations (osl and gpu) so this is the third one.
    Looking at other cases it seems that we are not supposed to share sources
    between cycles and the rest? So the new util_sky_model files are just
    copies of what is already in cycles, except that the data file uses the RGB
    variant of the Hosek/Wilkie model, because we output RGB anyway (but can be
    easily changed to XYZ if desired - the results are nearly identical).
    I am not sure if it is okay to pass 3*9 float values as 3 mat4 uniforms (I
    wanted to use mat3 but it does not work).
    Also, should I cache the sky model data between renders if the parameters
    do not change?

    Reviewed By: fclem, brecht

    Differential Revision: https://developer.blender.org/D7108

commit 42c99ec15b
Author: Jacques Lucke <jacques@blender.org>
Date:   Thu Jul 9 16:37:44 2020 +0200

    BLI: rename rand.c to rand.cc

commit 580d50091c
Author: Jacques Lucke <jacques@blender.org>
Date:   Thu Jul 9 15:40:27 2020 +0200

    Particles: Create a simulation state for every Particle Simulation node

    Every Particle Simulation node has a name (or a path when it is in a node group).
    This name has to be used in the Simulation modifier on a point cloud to see
    the particles.

    Caching has been disabled for now, because it was holding back development
    a bit. To reset the simulation, go back to frame 1.

    Currently, there is no way to influence the simulation. There are just some
    randomly moving points. Changing that is the next step.

commit 31ad43a3c7
Author: Jacques Lucke <jacques@blender.org>
Date:   Thu Jul 9 15:29:25 2020 +0200

    Blenloader: make BLO_read_data_address work in C++

commit 544c435fdd
Author: Brecht Van Lommel <brecht@blender.org>
Date:   Thu Jul 9 12:20:07 2020 +0200

    Fix T78745: Cycles error baking with multiple materials

commit 8ddf7556a5
Author: Bastien Montagne <bastien@blender.org>
Date:   Thu Jul 9 11:44:11 2020 +0200

    Fix T78718: Crash when deleting particle system modifier with the X Shortcut.

    Duplication and deletion code of modifiers was totally wrong for
    particle system, that special weird thing needs its own custom
    management.

    Note that for now I chose not to duplicate the particle settings ID when
    duplicating the modifier...

commit ea5fe7abc1
Author: Campbell Barton <ideasman42@gmail.com>
Date:   Tue Jul 7 17:29:17 2020 +1000

    UV: path selection support

    This adds support for path selection for vertex edge & face selection
    modes, matching mesh editing behavior, useful with the UV rip tool.

    Region select & edge tagging are currently not supported,
    although they could be added eventually.

commit 0b8221683f
Author: Campbell Barton <ideasman42@gmail.com>
Date:   Thu Jul 9 18:23:16 2020 +1000

    BMesh: add utility functions

    - BM_edge_uv_share_vert_check
    - BM_face_uv_calc_center_median_weighted
    - BM_loop_at_index_find

commit 0b3bf69d3c
Author: Campbell Barton <ideasman42@gmail.com>
Date:   Thu Jul 9 13:33:15 2020 +1000

    Cleanup: move BMesh UV queries into their own file

commit 754c5d6a14
Author: Campbell Barton <ideasman42@gmail.com>
Date:   Thu Jul 9 13:29:48 2020 +1000

    Cleanup: clang-format

commit 31bc76ea4e
Author: Jacques Lucke <jacques@blender.org>
Date:   Wed Jul 8 22:29:10 2020 +0200

    Cleanup: remove unnecessary calls to as_span

    This uses the new implicit conversions and constructors
    that have been committed in the previous commit.

    I tested these changes on Linux with gcc and on Windows.

commit 403384998a
Author: Jacques Lucke <jacques@blender.org>
Date:   Wed Jul 8 22:27:25 2020 +0200

    BLI: improve constructors and conversions to span

    This allows us to avoid many calls to `as_span()` methods. I will
    remove those in the next commit. Furthermore, constructors
    of Vector and Array can convert from one type to another now.

    I tested these changes on Linux with gcc and on Windows.

commit 4b85ed819d
Author: Jacques Lucke <jacques@blender.org>
Date:   Wed Jul 8 20:41:00 2020 +0200

    Cleanup: remove unused function

    This is not necessary in C++17 anymore.

commit f7d5d4ee3b
Author: Jacques Lucke <jacques@blender.org>
Date:   Wed Jul 8 20:39:12 2020 +0200

    Cleanup: use c++17 helper variable templates

commit e4926c167b
Author: Bastien Montagne <bastien@blender.org>
Date:   Wed Jul 8 18:08:08 2020 +0200

    Fix T78718: Crash when deleting particle system modifier with the X Shortcut.

    Again those backward pointers not properly flagged in RNA, hence
    generating infinite loops.

commit f4a39cafa1
Author: Jacques Lucke <jacques@blender.org>
Date:   Wed Jul 8 17:05:40 2020 +0200

    Functions: add AttributesRef class

    This is the same as MutableAttributesRef, but the data in it cannot be changed.

commit 439c238bb4
Author: Jacques Lucke <jacques@blender.org>
Date:   Wed Jul 8 17:04:50 2020 +0200

    Cleanup: use different internal socket name

commit 05365d1376
Author: Jacques Lucke <jacques@blender.org>
Date:   Wed Jul 8 17:04:09 2020 +0200

    Functions: support hashing MFDataType and CPPType

commit 2de5de57c5
Author: Sergey Sharybin <sergey.vfx@gmail.com>
Date:   Wed Jul 8 15:03:06 2020 +0200

    Build: fix stack linker warning with ffmpeg on macOS

    The ff_cfhd_init_vlcs() function was using a lot of stack space, which
    made linker on macOS unhappy. Using heap allocation allows to silence
    the warning without causing other side-effects.

    Kept the patch enabled for all platforms to avoid difference in behavior
    and performance on different platforms, which could make certain types
    of investigation very tricky.

    Differential Revision: https://developer.blender.org/D8248

commit cb3c4218bf
Author: Bastien Montagne <bastien@blender.org>
Date:   Wed Jul 8 15:43:57 2020 +0200

    Minor cleanup in rna override code.

commit d1f4546a59
Author: Jacques Lucke <jacques@blender.org>
Date:   Wed Jul 8 15:10:24 2020 +0200

    Functions: implement common subnetwork elimination optimization

    This was the last of the three network optimizations I developed in
    the functions branch. Common subnetwork elimination and constant
    folding together can get rid of most unnecessary nodes.

commit e3e42c00cb
Author: Jacques Lucke <jacques@blender.org>
Date:   Wed Jul 8 15:06:32 2020 +0200

    Functions: Support getting MFSocket based on its id

commit 2b9d62b73a
Author: Jacques Lucke <jacques@blender.org>
Date:   Wed Jul 8 15:06:04 2020 +0200

    Functions: Support accessing socket index of MFSocket

commit 34d175f372
Author: Jacques Lucke <jacques@blender.org>
Date:   Wed Jul 8 15:04:28 2020 +0200

    Functions: initial hash/equals implementation for constant multi-functions

commit 840941215d
Author: Jacques Lucke <jacques@blender.org>
Date:   Wed Jul 8 15:02:47 2020 +0200

    Functions: allow multi-functions to override a hash and equals function

commit 36a547af7b
Author: Jacques Lucke <jacques@blender.org>
Date:   Wed Jul 8 15:01:33 2020 +0200

    Cleanup: add correct license header to tests

commit ff133bbd33
Author: Jacques Lucke <jacques@blender.org>
Date:   Wed Jul 8 14:57:31 2020 +0200

    BLI: add disjoint set data structure

    This can be used to find separate islands in meshes efficiently (as is
    done in cycles already). Furthermore, this helps to implement some
    algorithms on node trees more efficiently.

commit a8ff8b64dc
Author: Jacques Lucke <jacques@blender.org>
Date:   Wed Jul 8 14:40:34 2020 +0200

    BLI: add comparison operators and hash functions for float3, etc.

commit ff444da7c4
Author: Brecht Van Lommel <brecht@blender.org>
Date:   Thu Jul 2 12:28:57 2020 +0200

    macOS: upgrade minimum required version to 10.13 High Sierra

    C++17 does not work on 10.12, and Apple extended support ended for 10.12 in
    October 2019.

    Maniphest Tasks: T76783, T76184

    Differential Revision: https://developer.blender.org/D8179

commit 6435acd8f6
Author: Brecht Van Lommel <brecht@blender.org>
Date:   Wed Jul 8 12:57:59 2020 +0200

    Cycles: support shader transparency for holdout objects

    Now transparent areas of the object will render objects behind.

    Fixes T78728.

commit 643196cc37
Author: Sergey Sharybin <sergey.vfx@gmail.com>
Date:   Wed Jul 8 11:04:49 2020 +0200

    CMake: Fix spelling of Embree passed to find package

    The spelling and capitalization of package name passed to find_package()
    and find_package_handle_standard_args() needs to match.

    Silences CMake warning about mismatch.

    Differential Revision: https://developer.blender.org/D8247

commit 45004d82e0
Author: Jacques Lucke <jacques@blender.org>
Date:   Wed Jul 8 11:18:43 2020 +0200

    Functions: add dead node removal and constant folding optimization

    Those optimizations work on the multi-function network level.
    Not only will they make the network evaluation faster, but they also
    simplify the network a lot. That makes it easier to understand the
    exported dot graph.

commit 50d7c00d9c
Author: Jacques Lucke <jacques@blender.org>
Date:   Wed Jul 8 10:16:56 2020 +0200

    Cleanup: fix comment

commit 01c8aa12a1
Author: Alexander Gavrilov <angavrilov@gmail.com>
Date:   Wed Jul 1 17:38:07 2020 +0300

    Apply Modifier: support applying as shape key and keeping the modifier.

    This can be useful to save the result of a cloth simulation as a
    shape key without destroying the simulation, so it's possible to
    e.g. re-run it to get other shapes, or simply use the new shape
    key to start the simulation already in a draped state.

    It also makes sense to allow applying as shape key even when the
    mesh is shared, because the operation itself just adds a shape
    key. To support this, split the apply operator into Apply and
    Apply As Shapekey so that they can have different poll callbacks.

    Differential Revision: https://developer.blender.org/D8173

commit 7fcb6bc59c
Author: Lukas Stockner <lukas.stockner@freenet.de>
Date:   Wed Jul 8 02:10:02 2020 +0200

    Fix T78324: Different Sky Texture results between CPU and GPU

    The problem here was numerical precision: The code calculates the angle between
    sun and view direction, and the usual acos(dot(a, b)) approach for that has
    poor numerical performance for almost parallel angles.

    As a result, the generally tiny difference between floating point computation
    between CPU and GPU was enough to make the sun vanish at different radii,
    causing different results.

    The new version fixes the difference by making the computation much more robust
    on both platforms.

commit afcb41a0aa
Author: Jacques Lucke <jacques@blender.org>
Date:   Tue Jul 7 20:32:40 2020 +0200

    BLI: simplify copy constructor of Array

commit eb5fb1741d
Author: Jacques Lucke <jacques@blender.org>
Date:   Tue Jul 7 20:29:35 2020 +0200

    Cleanup: don't end description with a '.'

commit 8713109212
Author: Jacques Lucke <jacques@blender.org>
Date:   Tue Jul 7 20:27:34 2020 +0200

    Cleanup: fix typo

commit 902ee4d13c
Author: Jacques Lucke <jacques@blender.org>
Date:   Tue Jul 7 19:46:10 2020 +0200

    Functions: cleanup loop that traverses the MFNetwork

commit 22158162ef
Author: Jacques Lucke <jacques@blender.org>
Date:   Tue Jul 7 19:34:35 2020 +0200

    Functions: add generic functions that output constants

commit f4633cf46c
Author: Jacques Lucke <jacques@blender.org>
Date:   Tue Jul 7 19:16:31 2020 +0200

    BLI: simplify copy constructor of vector

commit 67042aa6a1
Author: Jacques Lucke <jacques@blender.org>
Date:   Tue Jul 7 18:45:34 2020 +0200

    Functions: extend multi-function network api

commit adfae89f96
Author: Jacques Lucke <jacques@blender.org>
Date:   Tue Jul 7 18:40:42 2020 +0200

    BLI: provide access to underlying node in dot exporter

commit a8627ea66d
Author: Jacques Lucke <jacques@blender.org>
Date:   Tue Jul 7 18:39:24 2020 +0200

    Functions: Add debug print and destruct callback to CPPType

commit 4990e4dd01
Author: Jacques Lucke <jacques@blender.org>
Date:   Tue Jul 7 18:23:33 2020 +0200

    Nodes: Generate multi-function network from node tree

    This adds new callbacks to `bNodeSocketType` and `bNodeType`.
    Those are used to generate a multi-function network from a node
    tree. Later, this network is evaluated on e.g. particle data.

    Reviewers: brecht

    Differential Revision: https://developer.blender.org/D8169

commit ff97545c50
Author: Clément Foucault <foucault.clem@gmail.com>
Date:   Tue Jul 7 18:37:35 2020 +0200

    Fix T75943 EEVEE: Cubemaps shows black

    Caused by faulty driver implementation. Force fallback method.

commit 1e2ff4f81b
Author: Hans Goudey <h.goudey@me.com>
Date:   Tue Jul 7 11:10:42 2020 -0400

    Cleanup: Add braces for clang tidy

commit 0edf2fc128
Author: Sergey Sharybin <sergey.vfx@gmail.com>
Date:   Tue Jul 7 16:51:03 2020 +0200

    BLI: Correct spin lock definition

    The MSVC atomic function is defined for an unsigned type.

    Not sure why this became an issue after switch to TBB by default,
    maybe some CFLAGS changed to be more strict after that.

commit dad3de89dc
Author: Germano Cavalcante <germano.costa@ig.com.br>
Date:   Tue Jul 7 11:27:09 2020 -0300

    Fix: remove accidental code

    `v1` and `v2` are already set.

commit d352902758
Author: Sergey Sharybin <sergey.vfx@gmail.com>
Date:   Tue Jul 7 11:16:31 2020 +0200

    Make deps: Use own nasm for ffmpeg and x264

    Fixes the warning: building for macOS, but linking in object file

    Differential Revision: https://developer.blender.org/D8235

commit 1e3c0b4b03
Author: Sergey Sharybin <sergey.vfx@gmail.com>
Date:   Tue Jul 7 10:47:09 2020 +0200

    Make deps: Compile own version of nasm for Apple

    The upstream version of nasm does not put version information to the
    generated object files, which makes linker to show the following
    warning:

      building for macOS, but linking in object file

    Using own patched version of nasm which puts required information to
    the object file, making linker happy.

    The plan is to either streamline the patch and provide it to the
    upstream, or, it that takes too long, get an independent fix from the
    upstream.

commit 202e7ccaae
Author: Jeroen Bakker <j.bakker@atmind.nl>
Date:   Mon Jul 6 14:33:59 2020 +0200

    Fix T77455: Blender Freezes when using the 3d Scale Gizmo

    Issue is reported on Linux ith Intel HD6xx iGPU. Inside
    `gpu_select_sample_query.c` the call to `glGetQueryObjectuiv` froze. After
    bisecting this lead to the polyline shader. When using a 3d color shader
    in stead of the polyline shader during selection seems to fix the issue.

    Other parts of blender might also be effective, but I wasn't able to
    freeze blender in these areas. When it does, we might want to add
    a similar work-around to button2d, cage2d, cage3d & move3d, navigate.

    Backport this patch to 2.83.

    Reviewed By: Clément Foucault

    Differential Revision: https://developer.blender.org/D8217

commit d1dcd2b464
Author: Sergey Sharybin <sergey.vfx@gmail.com>
Date:   Tue Jul 7 16:17:36 2020 +0200

    BLI: Fix mistake in SpinLock TBB migration

    Copy-paste mistake.

commit 20558848d3
Author: Germano Cavalcante <germano.costa@ig.com.br>
Date:   Tue Jul 7 09:45:53 2020 -0300

    Optimization: use `BLI_bvhtree_intersect_plane` to detect faces that will be affected by the knife tool

    The knife code currently calls the `BLI_bvhtree_overlap` function that
    tests the overlap between the mesh tree and an AABB that encompasses the
    points projected in the clip_start, clip_end and or clip_planes of the
    view.

    This resulted in many false positives since the AABB is very large.
    Often all the triangles "overlapped".

    The solution was to create a new function that actually tests the
    intersection of AABB with a plane.

    Even not considering the clip_planes of the view, this solution is more
    appropriate than using overlap.

    Differential Revision: https://developer.blender.org/D8229

commit 630c6226e2
Author: Clément Foucault <foucault.clem@gmail.com>
Date:   Tue Jul 7 16:26:01 2020 +0200

    Fix T78307 UI: Drawing artifacts in the Blender UI on macOS

    This was due to a bad driver which was not respecting this bit of the
    specification:

    `If the current primitive does not originate from an instanced draw command, the value of gl_InstanceID is zero.`

commit 737bd549b6
Author: Patrick Mours <pmours@nvidia.com>
Date:   Mon Jul 6 12:25:54 2020 +0200

    Cycles: Add support for native OptiX curve primitive

    This patch adds support for the curve primitive from OptiX to Cycles. It's currently hidden
    behind a debug option, since there can be some slight rendering differences still (because no
    backface culling is performed and something seems off with endcaps). The curve primitive
    was added with the OptiX 7.1 SDK and requires a r450 driver or newer, so this also updates
    the codebase to be able to build with the new SDK.

    Reviewed By: brecht

    Differential Revision: https://developer.blender.org/D8223

commit 95f0f31279
Author: Brecht Van Lommel <brecht@blender.org>
Date:   Tue Jul 7 14:45:31 2020 +0200

    Fix T78692: improve UI regarding the effect of the denoiser on denoising passes

    It wasn't obvious that the choice of Cycles denoiser also generates different
    denoising data passes for compositing.

commit a394aac8b4
Author: Brecht Van Lommel <brecht@blender.org>
Date:   Tue Jul 7 14:47:59 2020 +0200

    Fix T78666: Cycles non-uniformly scaled hair renders wrong for static objects

    Don't apply the matrix transform optimization in this case, curve points and
    radius can't represent non-uniform scale the way is possible with triangle
    meshes and vertices.

    This would cause abrupt change if objects had e.g. motion blur in one frame
    and not in the next.

commit 98bee41c8a
Author: Sybren A. Stüvel <sybren@blender.org>
Date:   Tue Jul 7 14:30:55 2020 +0200

    IO: Reversed persistent ID order in exports to Alembic and USD

    Each duplicated (a.k.a. instanced) object has a Persistent ID, which
    identifies a dupli within the context of its duplicator. This ID
    consists of several numbers when there are nested duplis (for example a
    mesh instancing empties on its vertices, where each empty instances a
    collection). When exporting to Alembic/USD, these are used to uniquely
    name the duplicated objects in the export.

    This commit reverses the order of the persistent ID numbers, so that the
    first number identifies the first level of recursion. This produces
    trees like this:

        ABC
         `--Triangle
             |--Triangle
             |--Empty-1
             |    `--Pole-1-0
             |        |--Pole
             |        `--Block-1-1
             |            `--Block
             |--Empty
             |    `--Pole-0
             |        |--Pole
             |        `--Block-1
             |            `--Block
             |--Empty-2
             |    `--Pole-2-0
             |        |--Pole
             |        `--Block-2-1
             |            `--Block
             `--Empty-0
                 `--Pole-0-0
                     |--Pole
                     `--Block-0-1
                         `--Block

    It is now clearer that `Pole-2-0` and `Block-2-1` are instanced by
    `Empty-2`. Before this commit, they would have been named `Pole-0-2` and
    `Block-1-2`.

commit 70b1c09d7a
Author: Sybren A. Stüvel <sybren@blender.org>
Date:   Tue Jul 7 12:45:30 2020 +0200

    IO: Fix bug exporting dupli parent/child relations

    Exporting a scene to USD or Alembic would fail when there are multiple
    duplicates of parent & child objects, duplicated by the same object. For
    example, this happens when such a hierarchy of objects is contained in a
    collection, and that collection is instanced multiple times by mesh
    vertices. The problem here is that the 'parent' pointer of each
    duplicated object points to the real parent; Blender would not figure
    out properly which duplicated parent should be used.

    This is now resolved by keeping track of the persistent ID of each
    duplicated instance, which makes it possible to reconstruct the
    parent-child relations of duplicated objects. This does use up some
    memory for each dupli, so it could be heavy to export a Spring scene
    (with all the pebbles and leaves), but it's only a small addition on top
    of the USD/Alembic writer objects that have to be created anyway. At
    least with this patch, they're created correctly.

    Code-wise, the following changes are made:

    - The export graph (that maps export parent to its export children) used
      to have as its key (Object, Duplicator). This is insufficient to
      correctly distinguish between multiple duplis of the same object by
      the same duplicator, so this is now extended to (Object, Duplicator,
      Persistent ID). To make this possible, new classes `ObjectIdentifier`
      and `PersistentID` are introduced.
    - Finding the parent of a duplicated object is done via its persistent
      ID. In Python notation, the code first tries to find the parent
      instance where `child_persistent_id[1:] == parent_persistent_id[1:]`.
      If that fails, the dupli with persistent ID `child_persistent_id[1:]`
      is used as parent.

    Reviewed By: sergey

    Differential Revision: https://developer.blender.org/D8233

commit f2175e06a7
Author: Sergey Sharybin <sergey.vfx@gmail.com>
Date:   Tue Jul 7 12:43:18 2020 +0200

    Mae deps: Ensure Brotli is disabled for FreeType

    We don't need it and it was optionally enabled, causing Blender to fail
    to link on certain configuration (when Brotli is installed via Homebrew
    for example).

commit 02cd159539
Author: Jacques Lucke <jacques@blender.org>
Date:   Tue Jul 7 12:31:10 2020 +0200

    Cleanup: add comment explaining operator delete

commit cc311e4a52
Author: Sybren A. Stüvel <sybren@blender.org>
Date:   Tue Jun 30 15:13:54 2020 +0200

    IO: print export name instead of object name in debug export graph output

    This is just a change in `AbstractHierarchyIterator::debug_print_export_graph()`
    to aid in debugging. It'll make it possible to distinguish between
    different duplicates of the same object.

    No functional changes to Blender itself.

commit 5761cb9ee2
Author: Jacques Lucke <jacques@blender.org>
Date:   Tue Jul 7 11:52:45 2020 +0200

    Guarded Allocator: add missing operator delete

    This resolves warning C4291 on windows.

commit 80fe5e1b15
Author: Johan Walles <walles>
Date:   Tue Jul 7 11:09:31 2020 +0200

    UI: Add units to motion tracking solve errors

    The unit being "pixels".

    Before this change the solve errors were unitless in the UI.

    With this change in place, the UI is now clear on that the unit of the
    reprojection errors is pixels (px).

    Differential Revision: https://developer.blender.org/D8000

commit 6d9a6f12b3
Author: Sergey Sharybin <sergey.vfx@gmail.com>
Date:   Tue Jul 7 10:06:14 2020 +0200

    Make deps: Fix compilation error of Python on macOS

    The configuration was confused about gettext installed via Homebrew
    and isysroot passed to Python's compilation but not to test programs.

    After this change `import gettext` still works, but it is unclear how
    to test it further,

    Differential Revision: https://developer.blender.org/D8231

commit 955abbeff2
Author: Jacques Lucke <jacques@blender.org>
Date:   Tue Jul 7 09:01:01 2020 +0200

    Fix sign conversion error

commit e233ee1c1f
Author: Philipp Oeser <info@graphics-engineer.com>
Date:   Thu Jun 25 14:37:22 2020 +0200

    Fix T78186: Dyntopo panel error with tools that dont have a brush

    Maniphest Tasks: T78186

    Differential Revision: https://developer.blender.org/D8120

commit 19d4e265b6
Author: Jacques Lucke <jacques@blender.org>
Date:   Tue Jul 7 10:35:28 2020 +0200

    Cleanup: remove redundant comments

    Searching in these files for "_as" will reveal a comment at the
    top, that explains what these methods are for. There is no need
    to duplicate that knowledge all over the place.

commit 6e609f0eb0
Author: Campbell Barton <ideasman42@gmail.com>
Date:   Tue Jul 7 17:50:33 2020 +1000

    Cleanup: use doxy comments

commit 62774baded
Author: Campbell Barton <ideasman42@gmail.com>
Date:   Tue Jul 7 16:06:05 2020 +1000

    UI: add merge/split menus

    This makes the menus and keymap match the edit-mesh
    (M for merge, Alt-M for split).

commit d212b3dc43
Author: Sergey Sharybin <sergey.vfx@gmail.com>
Date:   Mon Jul 6 15:28:19 2020 +0200

    Make deps: Fixes for macOS platform

    Set of fixes which had to be made in order to have dependencies built
    on own laptop:

    - Require bison as a dependent software. It is required by ISPC.

      On macOS it is required to be installed via Homebrew. This is because
      Bison from Xcode toolchain is too old.

    - Made sure Boost is compiled using clang.

      Without this gcc was used, and some unsupported command line argument
      was passed to it.

    - Modify OGG in a way which does in fact pull fixed sized types.
      They are defined in stdint.h.

      Without this fix FFmpeg will not detect presence of OGG because the
      test program fails to compile.

    - Force disable zstd compression and make wepb optional for the TIFF
      library. Without this TIFF might pick up development libraries from
      Homebrew.

    Differential Revision: https://developer.blender.org/D8221

commit b28683b8b5
Author: Campbell Barton <ideasman42@gmail.com>
Date:   Tue Jul 7 16:03:26 2020 +1000

    Cleanup: remove unused arguments

commit 0c58970da7
Author: Campbell Barton <ideasman42@gmail.com>
Date:   Tue Jul 7 12:44:47 2020 +1000

    Cleanup: spelling

commit ad0edc626d
Author: Campbell Barton <ideasman42@gmail.com>
Date:   Tue Jul 7 12:43:45 2020 +1000

    Cleanup: unused World struct members linfac, logfac

commit e20171e59f
Author: Hans Goudey <h.goudey@me.com>
Date:   Mon Jul 6 16:39:28 2020 -0400

    Fix build error with tests for removed functions

    These GHash functions were removed in 12817083ec,
    so the tests should be removed too.

commit d557f05502
Author: Hans Goudey <h.goudey@me.com>
Date:   Mon Jul 6 16:07:54 2020 -0400

    Cleanup: Use bool instead of int

commit 053e0c0af3
Author: Hans Goudey <h.goudey@me.com>
Date:   Mon Jul 6 15:35:21 2020 -0400

    UI: Add shortcuts for shader effect panels

    Only the delete shortcut applies here, although the move up and down
    operators can optionally be assigned in the keymap.

    See rB1fa40c9f8a81 for more details and rB5d2005cbb54b for the
    grease pencil modifier panel implementation, which is the same.

commit 12817083ec
Author: Germano Cavalcante <germano.costa@ig.com.br>
Date:   Mon Jul 6 14:44:30 2020 -0300

    Cleanup: Use the BLI_edgehash API in the sewing simulation of cloths

    Also remove the code in the ghash that is no longer used.

    This change simplifies the existing code.

    Differential Revision: https://developer.blender.org/D8219

commit a856de700b
Author: Hans Goudey <h.goudey@me.com>
Date:   Mon Jul 6 13:17:07 2020 -0400

    Fix T77730: ShaderFx Missing Update Notifier

    This adds a notification type for shaderfx so the properties editor can
    be properly notified to redraw.

    Another possible solution would be to also redraw the shaderfx tab
     with a ND_MODIFIER update, but this solution allows us to avoid
     some unecessary redraws too. There were no existing cases of
    ND_OBJECT | NC_MODIFIER updates, so those cases were
    removed from buttons_area_listener.

    Differential Revision: https://developer.blender.org/D8159

commit f6f4043924
Author: Jacques Lucke <jacques@blender.org>
Date:   Mon Jul 6 17:59:04 2020 +0200

    BLI: add methods to lookup a stored key in a set

commit 1562c9f031
Author: Patrick Mours <pmours@nvidia.com>
Date:   Mon Jul 6 17:32:32 2020 +0200

    Fix OptiX viewport denoising not working when rendering scene (without OptiX) that uses unsupported features

    Denoising devices do not need to load the full feature set of kernels, so only activate the denoising
    feature for them (so that it is possible to use features that are supported by the render devices, but
    not the denoising devices).

commit aabfd2fb9b
Author: Bastien Montagne <bastien@blender.org>
Date:   Mon Jul 6 16:55:00 2020 +0200

    Cleanup: readfile: remove old deprecated OldNewMap for runtime caches.

commit ee3eba902a
Author: Bastien Montagne <bastien@blender.org>
Date:   Mon Jul 6 16:21:41 2020 +0200

    Runtime cache preservation during undo: add support for nodes and embedded IDs.

commit bfc644dcfb
Author: Sybren A. Stüvel <sybren@blender.org>
Date:   Mon Jul 6 16:52:28 2020 +0200

    Reduce `DupliObject::persistent_id` from 16 to 8 items

    For historical reasons, `DupliObject::persistent_id` was of size
    `2*MAX_DUPLI_RECUR`. These reasons are now gone, and the persistent ID
    always gets exactly one array element for every dupli-recursion.

    Differential Revision: https://developer.blender.org/D8222

    Reviewed by: brecht

commit 0b07f9b717
Author: Bastien Montagne <bastien@blender.org>
Date:   Mon Jul 6 15:07:12 2020 +0200

    Fix T78608: Memory leak in Material properties: "Data from SCE".

    Caused by recent own refactor of cache presevation handling in readfile,
    EEVEE's lightcache are weird birds that can also be saved in .blend
    files, need a special handling for those 'persistent' caches...

commit 99feb10b8b
Author: Campbell Barton <ideasman42@gmail.com>
Date:   Mon Jul 6 23:01:36 2020 +1000

    Cleanup: warning, spelling

commit 20446f07f6
Author: Campbell Barton <ideasman42@gmail.com>
Date:   Mon Jul 6 22:52:29 2020 +1000

    Docs: reference bl_rna_get_subclass_py instead of bl_rna_get_subclass

    bl_rna_get_subclass only works for Nodes at the moment.

commit ffaf294c3f
Author: Sergey Sharybin <sergey.vfx@gmail.com>
Date:   Mon Jul 6 14:53:39 2020 +0200

    Fix alignment/size issue on ARM/RPi architecture

    Addresses 964305 from Debian bug tracker.

commit 924578ce19
Author: Germano Cavalcante <germano.costa@ig.com.br>
Date:   Mon Jul 6 09:49:00 2020 -0300

    Optimization: Don't compute the snap to face on the knife tool twice

    Both `knife_find_closest_vert` and `knife_find_closest_edge` call
    `knife_find_closest_face`. Thus, running the raycast twice and setting
    values like `kcd->curr.bmface` and `kcd->curr.is_space` repeatedly.

    So:
    - separate `knife_find_closest_face` from `knife_find_closest_vert` and `knife_find_closest_edge`.
    - rename `knife_find_closest_vert` to `knife_find_closest_vert_of_face`
    - rename `knife_find_closest_edge `to `knife_find_closest_edge_of_face`.
    - do not set parameters previously set.

    Differential Revision: https://developer.blender.org/D8198

commit 073c426900
Author: Germano Cavalcante <germano.costa@ig.com.br>
Date:   Mon Jul 6 09:03:33 2020 -0300

    Fix faces disappearing when AutoMerge & Split

commit c632cf9ccd
Author: Campbell Barton <ideasman42@gmail.com>
Date:   Mon Jul 6 21:23:35 2020 +1000

    Fix UV select separate not refreshing the display

commit 2c0cab03ca
Author: Campbell Barton <ideasman42@gmail.com>
Date:   Mon Jul 6 21:14:12 2020 +1000

    UV: add rip region to toolbar

commit dbe171fb26
Author: Campbell Barton <ideasman42@gmail.com>
Date:   Mon Jul 6 21:03:45 2020 +1000

    Cleanup: spelling, comments

commit 18b6c49a90
Author: Jacques Lucke <jacques@blender.org>
Date:   Mon Jul 6 12:37:11 2020 +0200

    Cleanup: rename namespace TimeIt to timeit

    According to our style guide, namespaces should have
    lower case names.

commit 572c48cf98
Author: Jacques Lucke <jacques@blender.org>
Date:   Mon Jul 6 09:08:53 2020 +0200

    BLI: improve exception safety of memory utils

    Even if we do not use exception in many places in Blender, our core C++ library
    should become exception safe. Otherwise, we don't even have the option
    to work with exceptions if we decide to do so.

commit 703a73fa84
Author: Jacques Lucke <jacques@blender.org>
Date:   Mon Jul 6 10:56:26 2020 +0200

    BLI: refactor how buffers for small object optimization are stored

    Previously, there was an error when operator-> was returning an
    invalid type. See error C2839.

commit 80393a0eba
Author: Campbell Barton <ideasman42@gmail.com>
Date:   Mon Jul 6 17:41:36 2020 +1000

    UV: add rip tool

    New rip tool matching edit-mesh rip functionality.

    Useful as disconnecting UV's, especially for loops is inconvenient
    without this.

    This uses 'V' to rip, changing stitch to 'Alt-V'.

commit 9353477383
Author: Campbell Barton <ideasman42@gmail.com>
Date:   Mon Jul 6 17:41:17 2020 +1000

    BMesh: add BM_face_calc_uv_cross

commit b51b893df8
Author: Campbell Barton <ideasman42@gmail.com>
Date:   Mon Jul 6 17:40:55 2020 +1000

    BMesh: add BM_loop_other_vert_loop_by_edge

commit 705015e0a4
Author: Jeroen Bakker <j.bakker@atmind.nl>
Date:   Mon Jul 6 10:21:14 2020 +0200

    Fix T78481: Workbench Shadow effects XRay

    When in XRay some effects (shadow, cavity & depth of field) aren't supported.
    This patch makes sure that these effects aren't enabled.

commit 4f3045999d
Author: Campbell Barton <ideasman42@gmail.com>
Date:   Mon Jul 6 17:35:41 2020 +1000

    Cleanup: warnings, spelling

commit 0f617cd67e
Author: Jeroen Bakker <j.bakker@atmind.nl>
Date:   Mon Jul 6 07:45:10 2020 +0200

    GPU: Remove local shaders workaround for Intel/Windows

    It has been tested that local shaders workaround isn't needed for the
    latest Windows/Intel 6xx GPU's.

    Currently the local shaders workaround doesn't work anymore during the
    investigation it was detected that the intel drivers didn't need it
    anymore.

    Local shaders should still be fixed as it is also used for some legacy
    iGPU's. The current work around crashes when doing preview renders in
    EEVEE as the default materials aren't available but for the work around
    they should. (See T77346 for more information)

commit baf124c753
Author: Aaron Carlisle <carlisle.b3d@gmail.com>
Date:   Sun Jul 5 16:45:56 2020 -0400

    RNA Manual Reference: Update links

commit 247a28f242
Author: Jacques Lucke <jacques@blender.org>
Date:   Sun Jul 5 15:08:26 2020 +0200

    Revert "BLI: refactor how buffers for small object optimization are stored"

    This reverts commit 5d79f9f276.

    This was introducing build errors in windows. Need a bit more time to check it.

commit 5d79f9f276
Author: Jacques Lucke <jacques@blender.org>
Date:   Sun Jul 5 16:30:26 2020 +0200

    BLI: refactor how buffers for small object optimization are stored

commit 464aaf2701
Author: Antonio Vazquez <blendergit@gmail.com>
Date:   Sat Jul 4 17:31:02 2020 +0200

    Fix T78603: GPencil Noise modifier Vertex Group influence filter missing

    This was removed by error during the last refactor of modiifers.

commit 169bb4b9ce
Author: Jacques Lucke <jacques@blender.org>
Date:   Sat Jul 4 17:28:05 2020 +0200

    BLI: fix mistake in move constructor of Stack

commit 8e97694c8a
Author: Julian Eisel <julian@blender.org>
Date:   Sat Jul 4 17:06:57 2020 +0200

    Fix T78588: Material preview not visible in selection list

    Logic to determine if the library icon should be used was too general.

commit 9168ea8aab
Author: Antonio Vazquez <blendergit@gmail.com>
Date:   Sat Jul 4 11:15:11 2020 +0200

    Cleanup: Fix small typo error

commit 17603816f2
Author: Antonio Vazquez <blendergit@gmail.com>
Date:   Sat Jul 4 11:04:21 2020 +0200

    GPencil: Cleanup some comments typo

commit b0da78084b
Author: Clément Foucault <foucault.clem@gmail.com>
Date:   Sat Jul 4 01:27:12 2020 +0200

    UI: Attempt to fix OSX widget shader issue

    Some OSX GL driver implementation needs a dummy vbo read. This fixed issues
    with the Hair shaders in the past.

    Related to T78307

commit cad98923d0
Author: Richard Antalik <richardantalik@gmail.com>
Date:   Sat Jul 4 01:02:54 2020 +0200

    Cleanup: spelling

commit ea65c6a153
Author: Richard Antalik <richardantalik@gmail.com>
Date:   Sat Jul 4 00:59:09 2020 +0200

    Fix T78433: Adding Fade Generates Python Exception

    This was caused by typo in rB67a822e08684.

commit 4bf56b37ca
Author: Nathan Craddock <nzcraddock@gmail.com>
Date:   Fri Jul 3 13:31:42 2020 -0600

    Cleanup: Use C-style comments in outliner files

    No functional changes. Convert all C++ style comments to C comments.
    Also capitalize and add full stops.

    The comments themselves were not cleaned up. Some could be removed or
    reworded.

commit 59ef43147e
Author: Nathan Craddock <nzcraddock@gmail.com>
Date:   Fri Jul 3 12:48:00 2020 -0600

    Cleanup: Remove unused outliner activation code

    No functional changes. Remove commented calls to extern_set_butspace
    and unused text activation code.

commit 57a48bd0ca
Author: Nathan Craddock <nzcraddock@gmail.com>
Date:   Fri Jul 3 12:36:09 2020 -0600

    Cleanup: Use _fn suffix for outliner button callbacks

    No functional changes. Use _fn instead of _cb.

commit d7dbf90a02
Author: Sebastian Parborg <darkdefende@gmail.com>
Date:   Fri Jul 3 21:22:41 2020 +0200

    Clang-tidy: Enable braces-around-statements warning

commit 185fe9cd8b
Author: Brecht Van Lommel <brecht@blender.org>
Date:   Fri Jul 3 18:55:32 2020 +0200

    Cleanup: compiler warning

commit 46fcc12e83
Author: Brecht Van Lommel <brecht@blender.org>
Date:   Fri Jul 3 18:54:04 2020 +0200

    Fix error in new Hair data type file reading

commit d2db481dc7
Author: Sybren A. Stüvel <sybren@blender.org>
Date:   Fri Jul 3 18:04:40 2020 +0200

    Cleanup: Blendkernel, Clang-Tidy else-after-return fixes (incomplete)

    This addresses warnings from Clang-Tidy's `readability-else-after-return`
    rule in the `source/blender/blenkernel` module. Not all warnings are
    addressed in this commit.

    No functional changes.

commit a21cb22f8b
Author: Hans Goudey <h.goudey@me.com>
Date:   Fri Jul 3 11:58:43 2020 -0400

    Cleanup: Deduplicate code for finding context object

    Instead of manually checking the pinned object, use the existing
    ED_object_active_context function. This requires adding const
    to the context in that function.

commit 33a74941c5
Author: Sybren A. Stüvel <sybren@blender.org>
Date:   Fri Jul 3 17:30:31 2020 +0200

    Cleanup: Editors, Clang-Tidy else-after-return fixes

    This addresses warnings from Clang-Tidy's `readability-else-after-return`
    rule in the `source/blender/editors` module.

    No functional changes.

commit 367034f210
Author: Sybren A. Stüvel <sybren@blender.org>
Date:   Fri Jul 3 17:30:09 2020 +0200

    Cleanup: Editors/Space/UV-Edit, Clang-Tidy else-after-return fixes

    This addresses warnings from Clang-Tidy's `readability-else-after-return`
    rule in the `source/blender/editors/uv_edit` module.

    No functional changes.

commit 651d1aa7c8
Author: Sybren A. Stüvel <sybren@blender.org>
Date:   Fri Jul 3 17:25:04 2020 +0200

    Cleanup: Editors/Transform, Clang-Tidy else-after-return fixes

    This addresses warnings from Clang-Tidy's `readability-else-after-return`
    rule in the `source/blender/editors/transform` module.

    No functional changes.

commit 35ce16939c
Author: Sybren A. Stüvel <sybren@blender.org>
Date:   Fri Jul 3 17:20:58 2020 +0200

    Cleanup: Editors/Space/sequencer, Clang-Tidy else-after-return fixes

    This addresses warnings from Clang-Tidy's `readability-else-after-return`
    rule in the `source/blender/editors/space_sequencer` module.

    No functional changes.

commit a201020cd3
Author: Sybren A. Stüvel <sybren@blender.org>
Date:   Fri Jul 3 17:20:41 2020 +0200

    Cleanup: Editors/Space/Clip, Clang-Tidy else-after-return fixes

    This addresses warnings from Clang-Tidy's `readability-else-after-return`
    rule in the `source/blender/editors/space_clip` module.

    No functional changes.

commit f254f66587
Author: Sybren A. Stüvel <sybren@blender.org>
Date:   Fri Jul 3 17:20:22 2020 +0200

    Cleanup: Editors/Space/Outliner, Clang-Tidy else-after-return fixes

    This addresses warnings from Clang-Tidy's `readability-else-after-return`
    rule in the `source/blender/editors/space_outliner` module.

    No functional changes.

commit 3aa53b361d
Author: Sybren A. Stüvel <sybren@blender.org>
Date:   Fri Jul 3 17:20:08 2020 +0200

    Cleanup: Editors/Space/Node, Clang-Tidy else-after-return fixes

    This addresses warnings from Clang-Tidy's `readability-else-after-return`
    rule in the `source/blender/editors/space_node` module.

    No functional changes.

commit bf532b1106
Author: Sybren A. Stüvel <sybren@blender.org>
Date:   Fri Jul 3 17:19:13 2020 +0200

    Cleanup: Editors/Space/Text, Clang-Tidy else-after-return fixes

    This addresses warnings from Clang-Tidy's `readability-else-after-return`
    rule in the `source/blender/editors/space_text` module.

    No functional changes.

commit 2f6fc5a7e8
Author: Sybren A. Stüvel <sybren@blender.org>
Date:   Fri Jul 3 17:18:56 2020 +0200

    Cleanup: Editors/Space/View3D, Clang-Tidy else-after-return fixes

    This addresses warnings from Clang-Tidy's `readability-else-after-return`
    rule in the `source/blender/editors/space_view3d` module.

    No functional changes.

commit b61ecb785c
Author: Sybren A. Stüvel <sybren@blender.org>
Date:   Fri Jul 3 16:34:57 2020 +0200

    Cleanup: Explicit return in each `else if` block in `buttons_context()`

    This is a similar change as in rB4283da83cc9.

    No functional changes.

commit f43fedd400
Author: Jacques Lucke <jacques@blender.org>
Date:   Fri Jul 3 17:35:31 2020 +0200

    Cleanup: remove side effect in assertion

commit 4a48939f04
Author: Hans Goudey <h.goudey@me.com>
Date:   Fri Jul 3 11:18:24 2020 -0400

    UI: Fix bevel modifier not showing vertex group

commit cad2d32be6
Author: Sergey Sharybin <sergey.vfx@gmail.com>
Date:   Fri Jul 3 17:09:24 2020 +0200

    Clang-Tidy: Enable bugprone-misplaced-widening-cast

commit 4a5389816b
Author: Jacques Lucke <jacques@blender.org>
Date:   Fri Jul 3 17:07:01 2020 +0200

    Clang-Tidy: enable readability-named-parameter

commit fac2e63bc0
Author: Bastien Montagne <bastien@blender.org>
Date:   Fri Jul 3 16:57:55 2020 +0200

    Fix utterly broken code regarding GPUtextures of MovieClip in readfile.c

    Treat those as pure runtime code, reset to NULL by reading code, for
    now.

    Think those could be handled like Image gputextures (i.e. considered
    runtime cache and preserved across undo steps), but probably not
    critical for now.

commit 1bdabd7b4f
Author: Bastien Montagne <bastien@blender.org>
Date:   Fri Jul 3 16:55:13 2020 +0200

    Move MovieClip to new undo cache management system.

commit 1019c9f582
Author: Jacques Lucke <jacques@blender.org>
Date:   Fri Jul 3 16:54:08 2020 +0200

    Clang-Tidy: enable bugprone-too-small-loop-variable

commit 883f9dd6e5
Author: Jacques Lucke <jacques@blender.org>
Date:   Fri Jul 3 16:48:04 2020 +0200

    Clang-Tidy: enable bugprone-assert-side-effect

    Looks like we have no assertions with side effects.

commit 9739fc4d1b
Author: Sergey Sharybin <sergey.vfx@gmail.com>
Date:   Fri Jul 3 16:44:46 2020 +0200

    Clang-Tidy: More fixed of redundant check before delete

    For some reason got unnoticed in the original cleanup pass.

commit 14fd91e7e8
Author: Jacques Lucke <jacques@blender.org>
Date:   Fri Jul 3 16:38:01 2020 +0200

    Clang-Tidy: enable bugprone-argument-comment

    It was called `inverted` in the header.

commit f4fdb8efc5
Author: Hans Goudey <h.goudey@me.com>
Date:   Fri Jul 3 10:38:49 2020 -0400

    Cleanup: Remove redundant logic

commit f66aafa391
Author: Hans Goudey <h.goudey@me.com>
Date:   Fri Jul 3 10:37:58 2020 -0400

    Fix memory leak when dragging shaderfx

commit f891d4e2ad
Author: Sergey Sharybin <sergey.vfx@gmail.com>
Date:   Fri Jul 3 16:32:12 2020 +0200

    Clang-Tidy: Fix readability-delete-null-pointer warnings

    Also enable it in the configuration.

commit 53d41e1a6f
Author: Hans Goudey <h.goudey@me.com>
Date:   Fri Jul 3 10:28:13 2020 -0400

    UI: Use sliders and [0, 1] ranges in ocean modifier

    The ocean modifier has two properties that use a [0, 10] hard min and
    hard max. The values act as factors though, so it makes more sense to
    use sliders and a 0 to 1 range.

    This commit also bumps the file subversion to avoid repeatedly applying
    the change to the properties' range.

    Differential Revision: https://developer.blender.org/D8186

commit 2a39b34a09
Author: Sybren A. Stüvel <sybren@blender.org>
Date:   Fri Jul 3 16:09:51 2020 +0200

    Cleanup: Editors/Sculpt/Paint, Clang-Tidy else-after-return fixes

    This addresses warnings from Clang-Tidy's `readability-else-after-return`
    rule in the `source/blender/editors/sculpt_paint` module.

    No functional changes.

commit fd5b093f84
Author: Sybren A. Stüvel <sybren@blender.org>
Date:   Fri Jul 3 16:01:15 2020 +0200

    Cleanup: Editors/Screen, Clang-Tidy else-after-return fixes

    This addresses warnings from Clang-Tidy's `readability-else-after-return`
    rule in the `source/blender/editors/screen` module.

    No functional changes.

commit 4283da83cc
Author: Sybren A. Stüvel <sybren@blender.org>
Date:   Fri Jul 3 15:59:48 2020 +0200

    Cleanup: Explicit return in each `else if` block in `ed_screen_context()`

    The `ed_screen_context()` function is approximately 700 lines long, and
    its main structure is a huge chain of `else if` statements. Some of the
    bodies did not return, but rather fell through and relied on the `return
    -1;` at the bottom of the function. This means that in order to truly
    understand what is going on in one of those `else if` blocks, it could
    be required to scroll past all the following `else if` blocks,
    double-checking that they all had an `else`, and then see what happens
    below.

    By adding explicit `return -1;` everywhere this happened, this is all
    avoided, increasing local understandability of the code. Furthermore, it
    makes the upcoming cleanup with the Clang-Tidy rule
    `readability-else-after-return` a lot easier to do.

    No functional changes.

commit de7c9f41e6
Author: Sybren A. Stüvel <sybren@blender.org>
Date:   Fri Jul 3 15:42:22 2020 +0200

    Cleanup: Editors/Object, Clang-Tidy else-after-return fixes

    This addresses warnings from Clang-Tidy's `readability-else-after-return`
    rule in the `source/blender/editors/object` module.

    No functional changes.

commit 19483125f8
Author: Sybren A. Stüvel <sybren@blender.org>
Date:   Fri Jul 3 15:19:52 2020 +0200

    Cleanup: Editors/Mesh, Clang-Tidy else-after-return fixes

    This addresses warnings from Clang-Tidy's `readability-else-after-return`
    rule in the `source/blender/editors/mesh` module.

    No functional changes.

commit 7d0a0b8a6d
Author: Sybren A. Stüvel <sybren@blender.org>
Date:   Fri Jul 3 14:52:32 2020 +0200

    Cleanup: Editors/Armature, Clang-Tidy else-after-return fixes

    This addresses warnings from Clang-Tidy's `readability-else-after-return`
    rule in the `source/blender/editors/armature` module.

    No functional changes.

commit f82e52ebc8
Author: Sybren A. Stüvel <sybren@blender.org>
Date:   Fri Jul 3 14:51:19 2020 +0200

    Cleanup: Editors/Animation, Clang-Tidy else-after-return fixes

    This addresses warnings from Clang-Tidy's `readability-else-after-return`
    rule in the `source/blender/editors/animation` module.

    No functional changes.

commit 17ba566018
Author: Pablo Dobarro <pablodp606@gmail.com>
Date:   Fri Jul 3 02:15:54 2020 +0200

    Fix Pose Brush crashing after disabling connected only in FK mode

    This function was returning the ik_chain before disabling the
    fake_neighbors, so when the brush was used again with fake neighbors
    disabled after rebuilding the PBVH and free them, they were still
    enabled in the SculptSession, causing a the crash.

    Reviewed By: sergey

    Differential Revision: https://developer.blender.org/D8195

commit 3a59c184b9
Author: Bastien Montagne <bastien@blender.org>
Date:   Fri Jul 3 16:09:58 2020 +0200

    Move Scene's cache management during undo to new system.

commit a33756d783
Author: Hans Goudey <h.goudey@me.com>
Date:   Fri Jul 3 10:09:19 2020 -0400

    Cleanup: Unused variables in non-debug build

commit 6a58e15548
Author: Hans Goudey <h.goudey@me.com>
Date:   Fri Jul 3 10:03:16 2020 -0400

    Cleanup: Remove obsolete code in interface_panel.c

    Some code delt with panel merging in earlier versions of Blender,
    which is no longer needed. Other code delt with controls that aren't
    used anymore, and in some cases have region-level equivalents.

    There's a surprising amount of this unused code in this file, so removing it
    will be helpful for the future.

    Differential Revision: https://developer.blender.org/D7938

commit 88d358902f
Author: Jacques Lucke <jacques@blender.org>
Date:   Fri Jul 3 15:54:55 2020 +0200

    Clang-Tidy: Enable readability-redundant-string-cstr

commit 405e6c6cc9
Author: Antonio Vazquez <blendergit@gmail.com>
Date:   Fri Jul 3 15:53:44 2020 +0200

    Fix T78555: GPencil bake animation operator loose frame setting

    The values were reset for each run

commit 19ff145e66
Author: Hans Goudey <h.goudey@me.com>
Date:   Fri Jul 3 09:41:55 2020 -0400

    Clang-Tidy: Enable readability-redundant-control-flow

commit ffef562bf7
Author: Sergey Sharybin <sergey.vfx@gmail.com>
Date:   Fri Jul 3 15:31:23 2020 +0200

    Disable clang-tidy for code-generated RNA files

    This needs some extra care, which is probably easier once the initial
    pass over integration is done.

commit c9975088a9
Author: Bastien Montagne <bastien@blender.org>
Date:   Fri Jul 3 15:27:12 2020 +0200

    Move volume to new cache management system for undo.

commit 1e255ce031
Author: Jacques Lucke <jacques@blender.org>
Date:   Fri Jul 3 15:27:02 2020 +0200

    Fix T72214: Fluids: noise does not work with negative frame numbers

    The issue is duplicated code. There are two functions that zero-fill
    the frame number. They worked the same for positive frames numbers, but
    behaved differently for negative ones.

    On frame `-100`, `BLI_path_frame` outputs `-0100` and
    `fluid_cache_get_framenr_formatted_$ID$` outputted `-100`.

    I changed the behavior of the latter, because we depend on the behavior
    of the former for much longer already.

    Reviewers: sebbas

    Differential Revision: https://developer.blender.org/D8107
2020-07-12 21:12:27 -04:00
74c56382b8 A large refactor of newboolean to perpare for performance tuning.
Many changes aimed at, broadly, more sharing and less copying;
and having coordinates stored simultaneously in double and multiprecision,
as that will be needed for floating predicate filtering.
Biggest change is that faces are represented by arrays of pointers to
Verts instead of as integer indices into a vertex array.
2020-07-12 16:27:57 -04:00
ad3dcb7bb9 Got rid of clang-tidy errors. 2020-07-03 13:31:01 -04:00
e459c26413 Fixed violations of new Blender C++ style rules. 2020-07-03 11:03:26 -04:00
141d3400a7 Merge branch 'master' into newboolean 2020-07-03 09:08:26 -04:00
15ebad8c6e Added two more tests for boolean. 2020-07-02 12:55:05 -04:00
6633d6d7d0 Made two functions static to silence a warning. 2020-07-02 11:15:28 -04:00
956005f9dd First coplanar boolean test passes.
Implemented sorting of coplanar triangles.
Also, make format.
2020-07-02 10:13:19 -04:00
7776909026 Change boolean blenlib interface to be purely C++. 2020-07-01 12:42:04 -04:00
590ce6817d Change bmesh_boolean.c into a C++ file and start using PolyMesh interface.
Also, use BLI_math_mpq.hh everywhere instead of gmpxx.h.
2020-07-01 09:15:17 -04:00
a62bca844c Fix problem after master merge with Optional -> optional migration.
On Mac, there's an error re using the value() member of std::optional.
Working around it for now.
2020-06-30 15:31:00 -04:00
028f8b5b64 Merge branch 'master' into newboolean 2020-06-30 14:54:19 -04:00
66f511018e Dissolving triangulation edges and verts passes first test. 2020-06-30 14:46:08 -04:00
4d58e68565 First test with dissolve of triangulation edges is passing.
Still lots to do. And this includes a horribly inefficient way
of finding which edges are dissolvable -- to be fixed later.
2020-06-28 18:47:08 -04:00
ce37092668 Merge branch 'master' into newboolean 2020-06-26 08:36:23 -04:00
f80378cc66 Continued work on getting triangulation edges removed from output. 2020-06-19 15:53:56 -04:00
59805fa7e0 Merge branch 'master' into newboolean 2020-06-17 08:58:20 -04:00
d40819946b Start of PolyMesh interface for boolean.
Also refactored delaunay to put the 2d mesh representation into
an externally visible CDTArrangement class. Not sure yet whether
I will use this; if I end up not using it, will move that part of
the header back into the implementation file.
2020-06-17 08:55:05 -04:00
95da735c59 Fixed bug for some binary boolean ops. Fixed a memory leak.
Now the basic binary booleans work from the tool (not the modifier).
Still to do: (1) coplanar and non-connected-component cases;
(2) dissolve triangulation lines and new verts due only to them;
(3) properly transfer mesh attributes from old to new;
(4) hook up to modifier;
(5) attention to and tuning of performance.
2020-06-14 07:58:31 -04:00
7a775b8088 Made binary version of boolean and hooked up to Boolean tool.
Union seems to work. Other ops are flaky because I haven't
quite got the winding number propagation right yet.
2020-06-13 19:54:17 -04:00
2307f4f05d More boolean tests pass.
Fixed bug re confusion of how to sort triangles around an edge.
Fixed bug in first tettet test (inconsistent normals in input).
2020-06-13 11:11:02 -04:00
b0f9d093a6 Proper implementation of finding ambient cell.
Also fixed bug in boolean test where passed wrong output
to the obj writer.
2020-06-12 10:50:08 -04:00
cd6447fe03 First real boolean union output test works. 2020-06-11 20:37:17 -04:00
5cc3f006b5 Quient some warnings on Linux. 2020-06-11 18:46:02 -04:00
3917661753 After merge from master, updated for changes to BLI.
Mainly namespace changes, BLI -> blender, so I changed my
own namespaces to follow that pattern.
ArrayRef -> Span.
Now can have hash() as member of data structures rather
that having to make a DefaultHash for them.
Fixed a bad assumption about Arrays of bool being initialized to false.
2020-06-11 13:47:20 -04:00
d7b3d0aa27 Merge branch 'master' into newboolean 2020-06-11 05:44:10 -04:00
f1e7f42f9d Format previous commit. 2020-06-11 05:41:43 -04:00
16e3e9f3e2 A lot of progress towards working boolean library function.
The code to partition space into cells is mostly done.
The code to propagate winding numbers and flag cells according to the
boolean function is mostly done.
Only final extraction code is left, and a few other things.
2020-06-10 22:00:08 -04:00
9105af1b39 Added code that partitions triangle mesh into patches.
A patch is a set of triangles connected only by manifold edges.
Each patch will either appear or not appear in the boolean output
as a whole.
2020-06-07 16:19:44 -04:00
d985aa7117 Ran make format. 2020-06-07 06:02:01 -04:00
e4c25b0ab7 Move to exact arithmetic for new boolean implementation.
This is a regression in functionality from the previous version,
as I have not yet got anything beyond intersection working (and
that only for triangulated meshes). But want to get this into
the repository now while I continue to work on the functionality,
and then, the performance.
2020-06-06 18:46:06 -04:00
61ae661103 Merge branch 'master' into newboolean. 2020-06-06 18:31:12 -04:00
3353d6f8ee Merge branch 'master' into newboolean 2020-04-21 08:39:02 -04:00
1b93b09f6d Fixed Newboolean bug: how face sides were tracked.
Also, being more paranoid about new BMesh elements changing
positions in their tables after creating new elements, so
copying them all first.
2020-04-20 17:38:09 -04:00
3622e831ba Merge branch 'master' into newboolean 2020-04-04 15:26:14 -04:00
7a6224f76c Fix crash in debug newboolean due to repeated vertex. 2020-03-11 08:06:21 -04:00
73a0368d19 Boolean: fixed case where example came from new edge.
The code keeps track of which edges are to be used for examples,
and missed a case where the split edge was a new one so shouldn't
have an example.
2020-03-08 15:32:35 -04:00
5fdada4019 Merge branch 'master' into newboolean 2020-03-08 11:06:47 -04:00
bd59ad1602 Turn off debug in repository for newboolean. 2020-03-03 09:08:45 -05:00
6237dc70b3 Merge branch 'master' into newboolean 2020-03-03 08:46:30 -05:00
f747651698 Merge branch 'master' into newboolean 2020-03-01 19:11:59 -05:00
dfcb2a8865 Silence some unused warnings. 2020-03-01 10:54:24 -05:00
43051e5770 Update for new flag needed for BLI_delaunay_2d_cdt_calc, 2020-02-29 16:12:03 -05:00
e19aa157cd Merge branch 'master' into newboolean 2020-02-29 15:49:58 -05:00
9c6c299c7f Merge branch 'master' into newboolean 2020-01-28 12:20:20 -05:00
22faf7696c Merge branch 'master' into newboolean 2019-12-16 07:41:17 -05:00
d7b36d55d4 More consistent face-face intersections.
Changed the part-part intersect algorithm so that the same calculation
is done whenever a particular edge intersects a plane.
2019-12-12 14:19:54 -05:00
6724aa5478 Merge branch 'master' into newboolean 2019-12-06 07:02:31 -05:00
8009ff01db Removed #pragma marks -- didn't work on Windows.
Also a few tweaks to debugging output.
2019-12-06 06:48:36 -05:00
fed631a2d2 Merge branch 'master' into newboolean 2019-12-03 07:00:31 -05:00
dd3ea78bc8 Some fixes for some small epsilon cases.
Also changed default epsilon to 1e-5 from 1e-6, as the latter
is too close to hairy edge and anyway produceds really tiny faces
and edges that I doubt users really want. There's even a case for
it being 1e-4 by default.
2019-12-02 08:29:28 -05:00
b877aff607 Initial work on making modifier work. Debugging still. 2019-12-02 07:15:59 -05:00
c1c6eb15c9 Use arrays in MeshAdd for faster access. 2019-12-02 07:15:59 -05:00
20748f1639 Added stuff to make MeshAdd access faster. 2019-12-02 07:15:59 -05:00
19b1c64459 Faster find_coplanar_parts. 2019-12-02 07:15:59 -05:00
70f2025e9b Fixed memory leak of bvh trees. 2019-12-02 07:15:59 -05:00
ff4f28e15d Use BVH for partset pair intersection tests.
All regression tests pass.
2019-12-02 07:15:59 -05:00
b24e83be74 Added kdtree for faster coplanar. 2019-12-02 07:15:59 -05:00
97ac88df51 Stashing progress. 2019-12-02 07:15:59 -05:00
27f1452d0a Fixed gwn (atan2 instead of atan), and some perf speedups. 2019-12-02 07:15:59 -05:00
a3ca50c7b3 Boolean coplanar cone-on-cube works.
Needed some work on coplanar faces that may have
reversed normals from projection.
2019-12-02 07:15:59 -05:00
1632e55b11 Attempt to do boolean with coplanar faces - doesn't work yet. 2019-12-02 07:15:59 -05:00
aae3b4b67a Forgot to initialize an intset. 2019-12-02 07:15:59 -05:00
d3a8855da3 Plumbed through faces that are on both sides of boolean op. 2019-12-02 07:15:59 -05:00
6945602ae3 Keep track of other orig faces besides eg for a face. 2019-12-02 07:15:59 -05:00
8ea588043c Regression tests 0-25 all pass.
Code was working but had commented out actual apply of meshchange.
2019-12-02 07:15:59 -05:00
65021f8746 clang-format 2019-12-02 07:15:59 -05:00
9c4b18597d Most regression tests now pass.
Put in option checkbox in UI so can choose old or new method.
2019-12-02 07:15:59 -05:00
f5622630c2 Stash changes. 2019-12-02 07:15:59 -05:00
230ff38946 Coplanar case works except CDT makes a face with repeated vert. 2019-12-02 07:15:59 -05:00
c66cfa01a9 Changes to master for this branch. 2019-12-02 07:15:59 -05:00
e4b24e6e0c All tri-tri non-coplanar tests work. 2019-12-02 07:15:59 -05:00
52 changed files with 17616 additions and 6435 deletions

View File

@@ -188,6 +188,7 @@ if(APPLE)
else()
option(WITH_XR_OPENXR "Enable VR features through the OpenXR specification" ON)
endif()
option(WITH_GMP "Enable features depending on GMP (Exact Boolean)" ON)
# Compositor
option(WITH_COMPOSITOR "Enable the tile based nodal compositor" ON)
@@ -1739,6 +1740,7 @@ if(FIRST_RUN)
info_cfg_option(WITH_QUADRIFLOW)
info_cfg_option(WITH_USD)
info_cfg_option(WITH_TBB)
info_cfg_option(WITH_GMP)
info_cfg_text("Compiler Options:")
info_cfg_option(WITH_BUILDINFO)

View File

@@ -120,6 +120,7 @@ endif()
if(NOT WIN32 OR ENABLE_MINGW64)
include(cmake/gmp.cmake)
include(cmake/openjpeg.cmake)
include(cmake/gmp.cmake)
if(NOT WIN32 OR BUILD_MODE STREQUAL Release)
if(WIN32)
include(cmake/zlib_mingw.cmake)

View File

@@ -70,6 +70,9 @@ macro(BLENDER_SRC_GTEST_EX)
if(WITH_TBB)
target_link_libraries(${TARGET_NAME} ${TBB_LIBRARIES})
endif()
if(WITH_GMP)
target_link_libraries(${TARGET_NAME} ${GMP_LIBRARIES})
endif()
get_property(GENERATOR_IS_MULTI_CONFIG GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG)
if(GENERATOR_IS_MULTI_CONFIG)

View File

@@ -20,6 +20,7 @@ set(WITH_LIBMV ON CACHE BOOL "" FORCE)
set(WITH_LIBMV_SCHUR_SPECIALIZATIONS ON CACHE BOOL "" FORCE)
set(WITH_COMPOSITOR ON CACHE BOOL "" FORCE)
set(WITH_FREESTYLE ON CACHE BOOL "" FORCE)
set(WITH_GMP ON CACHE BOOL "" FORCE)
set(WITH_IK_SOLVER ON CACHE BOOL "" FORCE)
set(WITH_IK_ITASC ON CACHE BOOL "" FORCE)
set(WITH_IMAGE_CINEON ON CACHE BOOL "" FORCE)

View File

@@ -25,6 +25,7 @@ set(WITH_LIBMV OFF CACHE BOOL "" FORCE)
set(WITH_LLVM OFF CACHE BOOL "" FORCE)
set(WITH_COMPOSITOR OFF CACHE BOOL "" FORCE)
set(WITH_FREESTYLE OFF CACHE BOOL "" FORCE)
set(WITH_GMP OFF CACHE BOOL "" FORCE)
set(WITH_IK_SOLVER OFF CACHE BOOL "" FORCE)
set(WITH_IK_ITASC OFF CACHE BOOL "" FORCE)
set(WITH_IMAGE_CINEON OFF CACHE BOOL "" FORCE)

View File

@@ -21,6 +21,7 @@ set(WITH_LIBMV ON CACHE BOOL "" FORCE)
set(WITH_LIBMV_SCHUR_SPECIALIZATIONS ON CACHE BOOL "" FORCE)
set(WITH_COMPOSITOR ON CACHE BOOL "" FORCE)
set(WITH_FREESTYLE ON CACHE BOOL "" FORCE)
set(WITH_GMP ON CACHE BOOL "" FORCE)
set(WITH_IK_SOLVER ON CACHE BOOL "" FORCE)
set(WITH_IK_ITASC ON CACHE BOOL "" FORCE)
set(WITH_IMAGE_CINEON ON CACHE BOOL "" FORCE)

View File

@@ -496,6 +496,10 @@ function(SETUP_LIBDIRS)
link_directories(${ALEMBIC_LIBPATH})
endif()
if(WITH_GMP)
link_directories(${GMP_LIBPATH})
endif()
if(WITH_GHOST_WAYLAND)
link_directories(
${wayland-client_LIBRARY_DIRS}

View File

@@ -407,6 +407,15 @@ if(WITH_TBB)
find_package(TBB)
endif()
if(WITH_GMP)
find_package(GMP)
if(NOT GMP_FOUND)
set(WITH_GMP OFF)
message(STATUS "GMP not found")
endif()
endif()
# CMake FindOpenMP doesn't know about AppleClang before 3.12, so provide custom flags.
if(WITH_OPENMP)
if(CMAKE_C_COMPILER_ID MATCHES "AppleClang" AND CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL "7.0")

View File

@@ -427,6 +427,15 @@ if(WITH_TBB)
find_package_wrapper(TBB)
endif()
if(WITH_GMP)
find_package(GMP)
if(NOT GMP_FOUND)
set(WITH_GMP OFF)
message(STATUS "GMP not found")
endif()
endif()
if(WITH_XR_OPENXR)
find_package(XR_OpenXR_SDK)
if(NOT XR_OPENXR_SDK_FOUND)

View File

@@ -18,6 +18,9 @@
/** \file
* \ingroup bli
*
* This header file contains both a C interface and a C++ interface
* to the 2D Constrained Delaunay Triangulation library routine.
*/
#ifdef __cplusplus
@@ -107,11 +110,6 @@ extern "C" {
* If zero is supplied for epsilon, an internal value of 1e-8 used
* instead, since this code will not work correctly if it is not allowed
* to merge "too near" vertices.
*
* Normally, if epsilon is non-zero, there is an "input modify" pass which
* checks to see if some vertices are within epsilon of other edges, and
* snapping them to those edges if so. You can skip this pass by setting
* skip_input_modify to true. (This is also useful in some unit tests.)
*/
typedef struct CDT_input {
int verts_len;
@@ -123,7 +121,6 @@ typedef struct CDT_input {
int *faces_start_table;
int *faces_len_table;
float epsilon;
bool skip_input_modify;
} CDT_input;
/**
@@ -150,12 +147,9 @@ typedef struct CDT_input {
* - faces_orig, faces_orig_start_table, faces_orig_len_table
*
* For edges, the edges_orig triple can also say which original face
* edge is part of a given output edge. If an index in edges_orig
* is greater than the input's edges_len, then subtract input's edges_len
* from it to some number i: then the face edge that starts from the
* input vertex at input's faces[i] is the corresponding face edge.
* for convenience, face_edge_offset in the result will be the input's
* edges_len, so that this conversion can be easily done by the caller.
* edge is part of a given output edge. See the comment below
* on the C++ interface for how to decode the entries in the edges_orig
* table.
*/
typedef struct CDT_result {
int verts_len;
@@ -207,4 +201,69 @@ void BLI_delaunay_2d_cdt_free(CDT_result *result);
#ifdef __cplusplus
}
#endif
/* C++ Interface. */
# include "BLI_array.hh"
# include "BLI_double2.hh"
# include "BLI_math_mpq.hh"
# include "BLI_mpq2.hh"
# include "BLI_vector.hh"
namespace blender::meshintersect {
/* vec2<Arith_t> is a 2d vector with Arith_t as the type for coordinates. */
template<typename Arith_t> struct vec2_impl;
template<> struct vec2_impl<double> {
typedef double2 type;
};
# ifdef WITH_GMP
template<> struct vec2_impl<mpq_class> {
typedef mpq2 type;
};
# endif
template<typename Arith_t> using vec2 = typename vec2_impl<Arith_t>::type;
template<typename Arith_t> class CDT_input {
public:
Array<vec2<Arith_t>> vert;
Array<std::pair<int, int>> edge;
Array<Vector<int>> face;
Arith_t epsilon{0};
};
template<typename Arith_t> class CDT_result {
public:
Array<vec2<Arith_t>> vert;
Array<std::pair<int, int>> edge;
Array<Vector<int>> face;
/** For each output vert, which input verts correspond to it? */
Array<Vector<int>> vert_orig;
/**
* For each output edge, which input edges does it overlap?
* The input edge ids are encoded as follows:
* if the value is less than face_edge_offset, then it is
* an index into the input edge[] array.
* else let (a, b) = the quotient and remainder of dividing
* the edge index by face_edge_offset; "a" will be the input face + 1,
* and "b" will be a position within that face.
*/
Array<Vector<int>> edge_orig;
/** For each output face, which original faces does it overlap? */
Array<Vector<int>> face_orig;
/** Used to encode edge_orig (see above). */
int face_edge_offset;
};
CDT_result<double> delaunay_2d_calc(const CDT_input<double> &input, CDT_output_type output_type);
# ifdef WITH_GMP
CDT_result<mpq_class> delaunay_2d_calc(const CDT_input<mpq_class> &input,
CDT_output_type output_type);
# endif
} /* namespace blender::meshintersect */
#endif /* __cplusplus */

View File

@@ -0,0 +1,143 @@
/*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
#pragma once
/** \file
* \ingroup bli
*/
#include "BLI_double3.hh"
namespace blender {
struct double2 {
double x, y;
double2() = default;
double2(const double *ptr) : x{ptr[0]}, y{ptr[1]}
{
}
double2(double x, double y) : x(x), y(y)
{
}
double2(const double3 &other) : x(other.x), y(other.y)
{
}
operator double *()
{
return &x;
}
operator const double *() const
{
return &x;
}
float length() const
{
return len_v2_db(*this);
}
friend double2 operator+(const double2 &a, const double2 &b)
{
return {a.x + b.x, a.y + b.y};
}
friend double2 operator-(const double2 &a, const double2 &b)
{
return {a.x - b.x, a.y - b.y};
}
friend double2 operator*(const double2 &a, double b)
{
return {a.x * b, a.y * b};
}
friend double2 operator/(const double2 &a, double b)
{
BLI_assert(b != 0.0);
return {a.x / b, a.y / b};
}
friend double2 operator*(double a, const double2 &b)
{
return b * a;
}
friend bool operator==(const double2 &a, const double2 &b)
{
return a.x == b.x && a.y == b.y;
}
friend bool operator!=(const double2 &a, const double2 &b)
{
return a.x != b.x || a.y != b.y;
}
friend std::ostream &operator<<(std::ostream &stream, const double2 &v)
{
stream << "(" << v.x << ", " << v.y << ")";
return stream;
}
static double dot(const double2 &a, const double2 &b)
{
return a.x * b.x + a.y * b.y;
}
static double2 interpolate(const double2 &a, const double2 &b, double t)
{
return a * (1 - t) + b * t;
}
static double2 abs(const double2 &a)
{
return double2(fabs(a.x), fabs(a.y));
}
static double distance(const double2 &a, const double2 &b)
{
return (a - b).length();
}
static double distance_squared(const double2 &a, const double2 &b)
{
return double2::dot(a, b);
}
struct isect_result {
enum {
LINE_LINE_COLINEAR = -1,
LINE_LINE_NONE = 0,
LINE_LINE_EXACT = 1,
LINE_LINE_CROSS = 2,
} kind;
double lambda;
double mu;
};
static isect_result isect_seg_seg(const double2 &v1,
const double2 &v2,
const double2 &v3,
const double2 &v4);
};
} // namespace blender

View File

@@ -0,0 +1,245 @@
/*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
#pragma once
/** \file
* \ingroup bli
*/
#include <iostream>
#include "BLI_math_vector.h"
#include "BLI_span.hh"
namespace blender {
struct double3 {
double x, y, z;
double3() = default;
double3(const double *ptr) : x{ptr[0]}, y{ptr[1]}, z{ptr[2]}
{
}
double3(const double (*ptr)[3]) : double3((const double *)ptr)
{
}
explicit double3(double value) : x(value), y(value), z(value)
{
}
explicit double3(int value) : x(value), y(value), z(value)
{
}
double3(double x, double y, double z) : x{x}, y{y}, z{z}
{
}
operator const double *() const
{
return &x;
}
operator double *()
{
return &x;
}
double normalize_and_get_length()
{
return normalize_v3_db(*this);
}
double3 normalized() const
{
double3 result;
normalize_v3_v3_db(result, *this);
return result;
}
double length() const
{
return len_v3_db(*this);
}
double length_squared() const
{
return len_squared_v3_db(*this);
}
void reflect(const double3 &normal)
{
*this = this->reflected(normal);
}
double3 reflected(const double3 &normal) const
{
double3 result;
reflect_v3_v3v3_db(result, *this, normal);
return result;
}
static double3 safe_divide(const double3 &a, const double3 &b)
{
double3 result;
result.x = (b.x == 0.0) ? 0.0 : a.x / b.x;
result.y = (b.y == 0.0) ? 0.0 : a.y / b.y;
result.z = (b.z == 0.0) ? 0.0 : a.z / b.z;
return result;
}
void invert()
{
x = -x;
y = -y;
z = -z;
}
friend double3 operator+(const double3 &a, const double3 &b)
{
return {a.x + b.x, a.y + b.y, a.z + b.z};
}
void operator+=(const double3 &b)
{
this->x += b.x;
this->y += b.y;
this->z += b.z;
}
friend double3 operator-(const double3 &a, const double3 &b)
{
return {a.x - b.x, a.y - b.y, a.z - b.z};
}
friend double3 operator-(const double3 &a)
{
return {-a.x, -a.y, -a.z};
}
void operator-=(const double3 &b)
{
this->x -= b.x;
this->y -= b.y;
this->z -= b.z;
}
void operator*=(const double &scalar)
{
this->x *= scalar;
this->y *= scalar;
this->z *= scalar;
}
void operator*=(const double3 &other)
{
this->x *= other.x;
this->y *= other.y;
this->z *= other.z;
}
friend double3 operator*(const double3 &a, const double3 &b)
{
return {a.x * b.x, a.y * b.y, a.z * b.z};
}
friend double3 operator*(const double3 &a, const double &b)
{
return {a.x * b, a.y * b, a.z * b};
}
friend double3 operator*(const double &a, const double3 &b)
{
return b * a;
}
friend double3 operator/(const double3 &a, const double &b)
{
BLI_assert(b != 0.0);
return {a.x / b, a.y / b, a.z / b};
}
friend bool operator==(const double3 &a, const double3 &b)
{
return a.x == b.x && a.y == b.y && a.z == b.z;
}
friend bool operator!=(const double3 &a, const double3 &b)
{
return a.x != b.x || a.y != b.y || a.z != b.z;
}
friend std::ostream &operator<<(std::ostream &stream, const double3 &v)
{
stream << "(" << v.x << ", " << v.y << ", " << v.z << ")";
return stream;
}
static double dot(const double3 &a, const double3 &b)
{
return a.x * b.x + a.y * b.y + a.z * b.z;
}
static double3 cross_high_precision(const double3 &a, const double3 &b)
{
double3 result;
cross_v3_v3v3_db(result, a, b);
return result;
}
static double3 project(const double3 &a, const double3 &b)
{
double3 result;
project_v3_v3v3_db(result, a, b);
return result;
}
static double distance(const double3 &a, const double3 &b)
{
return (a - b).length();
}
static double distance_squared(const double3 &a, const double3 &b)
{
return double3::dot(a, b);
}
static double3 interpolate(const double3 &a, const double3 &b, double t)
{
return a * (1 - t) + b * t;
}
static double3 abs(const double3 &a)
{
return double3(fabs(a.x), fabs(a.y), fabs(a.z));
}
static int dominant_axis(const double3 &a)
{
double x = (a.x >= 0) ? a.x : -a.x;
double y = (a.y >= 0) ? a.y : -a.y;
double z = (a.z >= 0) ? a.z : -a.z;
return ((x > y) ? ((x > z) ? 0 : 2) : ((y > z) ? 1 : 2));
}
static double3 cross_poly(Span<double3> poly);
};
} // namespace blender

View File

@@ -47,6 +47,11 @@ struct float2 {
return &x;
}
float length() const
{
return len_v2(*this);
}
float2 &operator+=(const float2 &other)
{
x += other.x;
@@ -107,6 +112,47 @@ struct float2 {
return stream;
}
static float dot(const float2 &a, const float2 &b)
{
return a.x * b.x + a.y * b.y;
}
static float2 interpolate(const float2 &a, const float2 &b, float t)
{
return a * (1 - t) + b * t;
}
static float2 abs(const float2 &a)
{
return float2(fabsf(a.x), fabsf(a.y));
}
static float distance(const float2 &a, const float2 &b)
{
return (a - b).length();
}
static float distance_squared(const float2 &a, const float2 &b)
{
return float2::dot(a, b);
}
struct isect_result {
enum {
LINE_LINE_COLINEAR = -1,
LINE_LINE_NONE = 0,
LINE_LINE_EXACT = 1,
LINE_LINE_CROSS = 2,
} kind;
float lambda;
float mu;
};
static isect_result isect_seg_seg(const float2 &v1,
const float2 &v2,
const float2 &v3,
const float2 &v4);
friend bool operator==(const float2 &a, const float2 &b)
{
return a.x == b.x && a.y == b.y;

View File

@@ -243,6 +243,11 @@ struct float3 {
{
return a * (1 - t) + b * t;
}
static float3 abs(const float3 &a)
{
return float3(fabsf(a.x), fabsf(a.y), fabsf(a.z));
}
};
} // namespace blender

View File

@@ -242,6 +242,14 @@ double double_round(double x, int ndigits);
} \
(void)0
# define BLI_ASSERT_UNIT_V3_DB(v) \
{ \
const double _test_unit = len_squared_v3_db(v); \
BLI_assert(!(fabs(_test_unit - 1.0) >= BLI_ASSERT_UNIT_EPSILON) || \
!(fabs(_test_unit) >= BLI_ASSERT_UNIT_EPSILON)); \
} \
(void)0
# define BLI_ASSERT_UNIT_V2(v) \
{ \
const float _test_unit = len_squared_v2(v); \

View File

@@ -0,0 +1,61 @@
/*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
#pragma once
/** \file
* \ingroup bli
* \brief Math vector functions needed specifically for mesh intersect and boolean.
*/
#include "BLI_double2.hh"
#include "BLI_double3.hh"
#ifdef WITH_GMP
#include "BLI_math_mpq.hh"
#include "BLI_mpq2.hh"
#include "BLI_mpq3.hh"
#endif
namespace blender {
/* #orient2d gives the exact result, using multi-precision arithmetic when result
* is close to zero. orient3d_fast just uses double arithmetic, so may be
* wrong if the answer is very close to zero.
* Similarly, for #incircle and #incircle_fast. */
int orient2d(const double2 &a, const double2 &b, const double2 &c);
int orient2d_fast(const double2 &a, const double2 &b, const double2 &c);
int incircle(const double2 &a, const double2 &b, const double2 &c, const double2 &d);
int incircle_fast(const double2 &a, const double2 &b, const double2 &c, const double2 &d);
/* #orient3d gives the exact result, using multi-precision arithmetic when result
* is close to zero. orient3d_fast just uses double arithmetic, so may be
* wrong if the answer is very close to zero.
* Similarly, for #insphere and #insphere_fast. */
int orient3d(const double3 &a, const double3 &b, const double3 &c, const double3 &d);
int orient3d_fast(const double3 &a, const double3 &b, const double3 &c, const double3 &d);
int insphere(const double3 &a, const double3 &b, const double3 &c, const double3 &d, const double3 &e);
int insphere_fast(const double3 &a, const double3 &b, const double3 &c, const double3 &d, const double3 &e);
#ifdef WITH_GMP
int orient2d(const mpq2 &a, const mpq2 &b, const mpq2 &c);
int incircle(const mpq2 &a, const mpq2 &b, const mpq2 &c, const mpq2 &d);
int orient3d(const mpq3 &a, const mpq3 &b, const mpq3 &c, const mpq3 &d);
#endif
} // namespace blender

View File

@@ -0,0 +1,36 @@
/*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
#pragma once
/** \file
* \ingroup bli
*/
#ifdef WITH_GMP
/* This file uses an external file header to define the multi-precision
* rational type, mpq_class.
* This class keeps separate multi-precision integer numerator and
* denominator, reduced to lowest terms after each arithmetic operation.
* It can be used where it is important to have exact arithmetic results.
*
* See gmplib.org for full documentation. In particular:
* https://gmplib.org/manual/C_002b_002b-Interface-Rationals
*/
# include "gmpxx.h"
#endif /* WITH_GMP */

View File

@@ -140,6 +140,7 @@ MINLINE void mul_v2_v2fl(float r[2], const float a[2], float f);
MINLINE void mul_v3_fl(float r[3], float f);
MINLINE void mul_v3db_db(double r[3], double f);
MINLINE void mul_v3_v3fl(float r[3], const float a[3], float f);
MINLINE void mul_v3_v3db_db(double r[3], const double a[3], double f);
MINLINE void mul_v2_v2(float r[2], const float a[2]);
MINLINE void mul_v2_v2v2(float r[2], const float a[2], const float b[2]);
MINLINE void mul_v3_v3(float r[3], const float a[3]);
@@ -236,17 +237,21 @@ MINLINE float len_manhattan_v3v3(const float a[3], const float b[3]) ATTR_WARN_U
MINLINE float len_v3(const float a[3]) ATTR_WARN_UNUSED_RESULT;
MINLINE float len_v3v3(const float a[3], const float b[3]) ATTR_WARN_UNUSED_RESULT;
MINLINE double len_v3_db(const double a[3]) ATTR_WARN_UNUSED_RESULT;
MINLINE double len_squared_v3_db(const double v[3]) ATTR_WARN_UNUSED_RESULT;
MINLINE float normalize_v2_length(float r[2], const float unit_scale);
MINLINE float normalize_v2_v2_length(float r[2], const float a[2], const float unit_scale);
MINLINE float normalize_v3_length(float r[3], const float unit_scale);
MINLINE float normalize_v3_v3_length(float r[3], const float a[3], const float unit_scale);
MINLINE double normalize_v3_length_d(double n[3], const double unit_scale);
MINLINE double normalize_v3_length_db(double n[3], const double unit_scale);
MINLINE double normalize_v3_v3_length_db(double r[3], const double a[3], const double unit_scale);
MINLINE float normalize_v2(float r[2]);
MINLINE float normalize_v2_v2(float r[2], const float a[2]);
MINLINE float normalize_v3(float r[3]);
MINLINE float normalize_v3_v3(float r[3], const float a[3]);
MINLINE double normalize_v3_d(double n[3]);
MINLINE double normalize_v3_v3_db(double r[3], const double a[3]);
MINLINE double normalize_v3_db(double n[3]);
/******************************* Interpolation *******************************/
@@ -402,6 +407,7 @@ void angle_poly_v3(float *angles, const float *verts[3], int len);
void project_v2_v2v2(float out[2], const float p[2], const float v_proj[2]);
void project_v3_v3v3(float out[3], const float p[3], const float v_proj[3]);
void project_v3_v3v3_db(double out[3], const double p[3], const double v_proj[3]);
void project_v2_v2v2_normalized(float out[2], const float p[2], const float v_proj[2]);
void project_v3_v3v3_normalized(float out[3], const float p[3], const float v_proj[3]);
void project_plane_v3_v3v3(float out[3], const float p[3], const float v_plane[3]);
@@ -410,6 +416,7 @@ void project_plane_normalized_v3_v3v3(float out[3], const float p[3], const floa
void project_plane_normalized_v2_v2v2(float out[2], const float p[2], const float v_plane[2]);
void project_v3_plane(float out[3], const float plane_no[3], const float plane_co[3]);
void reflect_v3_v3v3(float out[3], const float vec[3], const float normal[3]);
void reflect_v3_v3v3_db(double out[3], const double vec[3], const double normal[3]);
void ortho_basis_v3v3_v3(float r_n1[3], float r_n2[3], const float n[3]);
void ortho_v3_v3(float out[3], const float v[3]);
void ortho_v2_v2(float out[2], const float v[2]);

View File

@@ -0,0 +1,79 @@
/*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
#pragma once
/** \file
* \ingroup bli
*/
/* The boolean functions in Blenlib use exact arithmetic, so require GMP. */
#ifdef WITH_GMP
# include "BLI_mesh_intersect.hh"
# include <functional>
namespace blender::meshintersect {
/**
* Enum values after BOOLEAN_NONE need to match BMESH_ISECT_BOOLEAN_... values in
* editmesh_intersect.c. */
enum class BoolOpType {
None = -1,
/* Aligned with #BooleanModifierOp. */
Intersect = 0,
Union = 1,
Difference = 2,
};
/**
* Do the boolean operation op on the mesh pm_in.
* The boolean operation has nshapes input shapes. Each is a disjoint subset of the input mesh.
* The shape_fn argument, when applied to an input face argument, says which shape it is in
* (should be a value from -1 to nshapes - 1: if -1, it is not part of any shape).
* The use_self arg says whether or not the function should assume that faces in the
* same shape intersect - if the argument is true, such self-intersections will be found.
* Sometimes the caller has already done a triangulation of the faces,
* and if so, *pm_triangulated contains a triangulation: if non-null, it contains a mesh
* of triangles, each of whose orig_field says which face in pm that triangle belongs to.
* pm arg isn't const because we may populate its verts (for debugging).
* Same goes for the pm_triangulated arg.
* The output IMesh will have faces whose orig fields map back to faces and edges in
* the input mesh.
*/
IMesh boolean_mesh(IMesh &imesh,
BoolOpType op,
int nshapes,
std::function<int(int)> shape_fn,
bool use_self,
IMesh *pm_triangulated,
IMeshArena *arena);
/**
* This is like boolean, but operates on IMesh's whose faces are all triangles.
* It is exposed mainly for unit testing, at the moment: boolean_mesh() uses
* it to do most of its work.
*/
IMesh boolean_trimesh(IMesh &trimesh,
BoolOpType op,
int nshapes,
std::function<int(int)> shape_fn,
bool use_self,
IMeshArena *arena);
} // namespace blender::meshintersect
#endif /* WITH_GMP */

View File

@@ -0,0 +1,359 @@
/*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
#pragma once
/** \file
* \ingroup bli
*
* Mesh intersection library functions.
* Uses exact arithmetic, so need GMP.
*/
#ifdef WITH_GMP
# include <iostream>
# include "BLI_array.hh"
# include "BLI_double3.hh"
# include "BLI_index_range.hh"
# include "BLI_map.hh"
# include "BLI_math_mpq.hh"
# include "BLI_mpq3.hh"
# include "BLI_span.hh"
# include "BLI_utility_mixins.hh"
# include "BLI_vector.hh"
namespace blender::meshintersect {
constexpr int NO_INDEX = -1;
/**
* Vertex coordinates are stored both as #double3 and #mpq3, which should agree.
* Most calculations are done in exact arithmetic, using the mpq3 version,
* but some predicates can be sped up by operating on doubles and using error analysis
* to find the cases where that is good enough.
* Vertices also carry along an id, created on allocation. The id
* is useful for making algorithms that don't depend on pointers.
* Also, they are easier to read while debugging.
* They also carry an orig index, which can be used to tie them back to
* vertices that the caller may have in a different way (e.g., #BMVert).
* An orig index can be #NO_INDEX, indicating the Vert was created by
* the algorithm and doesn't match an original Vert.
* Vertices can be reliably compared for equality,
* and hashed (on their co_exact field).
*/
struct Vert {
mpq3 co_exact;
double3 co;
int id = NO_INDEX;
int orig = NO_INDEX;
Vert() = default;
Vert(const mpq3 &mco, const double3 &dco, int id, int orig);
~Vert() = default;
/** Test equality on the co_exact field. */
bool operator==(const Vert &other) const;
/** Hash on the co_exact field. */
uint64_t hash() const;
};
std::ostream &operator<<(std::ostream &os, const Vert *v);
/**
* A Plane whose equation is `dot(norm, p) + d = 0`.
* The norm and d fields are always present, but the norm_exact
* and d_exact fields may be lazily populated. Since we don't
* store degenerate planes, we can tell if a the exact versions
* are not populated yet by having `norm_exact == 0`.
*/
struct Plane {
mpq3 norm_exact;
mpq_class d_exact;
double3 norm;
double d;
Plane() = default;
Plane(const mpq3 &norm_exact, const mpq_class &d_exact);
Plane(const double3 &norm, const double d);
/* Test equality on the exact fields. */
bool operator==(const Plane &other) const;
/* Hash onthe exact fields. */
uint64_t hash() const;
void make_canonical();
bool exact_populated() const;
void populate_exact();
};
std::ostream &operator<<(std::ostream &os, const Plane *plane);
/**
* A #Face has a sequence of Verts that for a CCW ordering around them.
* Faces carry an index, created at allocation time, useful for making
* pointer-independent algorithms, and for debugging.
* They also carry an original index, meaningful to the caller.
* And they carry original edge indices too: each is a number meaningful
* to the caller for the edge starting from the corresponding face position.
* A "face position" is the index of a vertex around a face.
* Faces don't own the memory pointed at by the vert array.
* Also indexed by face position, the is_intersect array says
* for each edge whether or not it is the result of intersecting
* with another face in the intersect algorithm.
* Since the intersect algorithm needs the plane for each face,
* a #Face also stores the Plane of the face, but this is only
* populate later because not all faces will be intersected.
*/
struct Face : NonCopyable {
Array<const Vert *> vert;
Array<int> edge_orig;
Array<bool> is_intersect;
Plane *plane = nullptr;
int id = NO_INDEX;
int orig = NO_INDEX;
using FacePos = int;
Face() = default;
Face(Span<const Vert *> verts, int id, int orig, Span<int> edge_origs, Span<bool> is_intersect);
Face(Span<const Vert *> verts, int id, int orig);
~Face();
bool is_tri() const
{
return vert.size() == 3;
}
/* Test equality of verts, in same positions. */
bool operator==(const Face &other) const;
/* Test equaliy faces allowing cyclic shifts. */
bool cyclic_equal(const Face &other) const;
FacePos next_pos(FacePos p) const
{
return (p + 1) % vert.size();
}
FacePos prev_pos(FacePos p) const
{
return (p + vert.size() - 1) % vert.size();
}
const Vert *const &operator[](int index) const
{
return vert[index];
}
int size() const
{
return vert.size();
}
const Vert *const *begin() const
{
return vert.begin();
}
const Vert *const *end() const
{
return vert.end();
}
IndexRange index_range() const
{
return IndexRange(vert.size());
}
void populate_plane(bool need_exact);
bool plane_populated() const
{
return plane != nullptr;
}
};
std::ostream &operator<<(std::ostream &os, const Face *f);
/**
* #IMeshArena is the owner of the Vert and Face resources used
* during a run of one of the mesh-intersect main functions.
* It also keeps has a hash table of all Verts created so that it can
* ensure that only one instance of a Vert with a given co_exact will
* exist. I.e., it de-duplicates the vertices.
*/
class IMeshArena : NonCopyable, NonMovable {
class IMeshArenaImpl;
std::unique_ptr<IMeshArenaImpl> pimpl_;
public:
IMeshArena();
~IMeshArena();
/**
* Provide hints to number of expected Verts and Faces expected
* to be allocated.
*/
void reserve(int vert_num_hint, int face_num_hint);
int tot_allocated_verts() const;
int tot_allocated_faces() const;
/**
* These add routines find and return an existing Vert with the same
* co_exact, if it exists (the orig argument is ignored in this case),
* or else allocates and returns a new one. The index field of a
* newly allocated Vert will be the index in creation order.
*/
const Vert *add_or_find_vert(const mpq3 &co, int orig);
const Vert *add_or_find_vert(const double3 &co, int orig);
Face *add_face(Span<const Vert *> verts,
int orig,
Span<int> edge_origs,
Span<bool> is_intersect);
Face *add_face(Span<const Vert *> verts, int orig, Span<int> edge_origs);
Face *add_face(Span<const Vert *> verts, int orig);
/** The following return #nullptr if not found. */
const Vert *find_vert(const mpq3 &co) const;
const Face *find_face(Span<const Vert *> verts) const;
};
/**
* A #blender::meshintersect::IMesh is a self-contained mesh structure
* that can be used in `blenlib` without depending on the rest of Blender.
* The Vert and #Face resources used in the #IMesh should be owned by
* some #IMeshArena.
* The Verts used by a #IMesh can be recovered from the Faces, so
* are usually not stored, but on request, the #IMesh can populate
* internal structures for indexing exactly the set of needed Verts,
* and also going from a Vert pointer to the index in that system.
*/
class IMesh {
Array<Face *> face_; /* Not `const` so can lazily populate planes. */
Array<const Vert *> vert_; /* Only valid if vert_populated_. */
Map<const Vert *, int> vert_to_index_; /* Only valid if vert_populated_. */
bool vert_populated_ = false;
public:
IMesh() = default;
IMesh(Span<Face *> faces) : face_(faces)
{
}
void set_faces(Span<Face *> faces);
Face *face(int index) const
{
return face_[index];
}
int face_size() const
{
return face_.size();
}
int vert_size() const
{
return vert_.size();
}
bool has_verts() const
{
return vert_populated_;
}
void set_dirty_verts()
{
vert_populated_ = false;
vert_to_index_.clear();
vert_ = Array<const Vert *>();
}
/* Pass `max_verts` if there is a good bound estimate on the maximum number of verts. */
void populate_vert();
void populate_vert(int max_verts);
const Vert *vert(int index) const
{
BLI_assert(vert_populated_);
return vert_[index];
}
/** Returns index in vert_ where v is, or #NO_INDEX. */
int lookup_vert(const Vert *v) const;
IndexRange vert_index_range() const
{
BLI_assert(vert_populated_);
return IndexRange(vert_.size());
}
IndexRange face_index_range() const
{
return IndexRange(face_.size());
}
Span<const Vert *> vertices() const
{
BLI_assert(vert_populated_);
return Span<const Vert *>(vert_);
}
Span<Face *> faces() const
{
return Span<Face *>(face_);
}
/**
* Replace face at given index with one that elides the
* vertices at the positions in face_pos_erase that are true.
* Use arena to allocate the new face in.
*/
void erase_face_positions(int f_index, Span<bool> face_pos_erase, IMeshArena *arena);
};
std::ostream &operator<<(std::ostream &os, const IMesh &mesh);
/**
* The output will have duplicate vertices merged and degenerate triangles ignored.
* If the input has overlapping co-planar triangles, then there will be
* as many duplicates as there are overlaps in each overlapping triangular region.
* The orig field of each #IndexedTriangle will give the orig index in the input #IMesh
* that the output triangle was a part of (input can have -1 for that field and then
* the index in `tri[]` will be used as the original index).
* The orig structure of the output #IMesh gives the originals for vertices and edges.
* Note: if the input tm_in has a non-empty orig structure, then it is ignored.
*/
IMesh trimesh_self_intersect(const IMesh &tm_in, IMeshArena *arena);
IMesh trimesh_nary_intersect(const IMesh &tm_in,
int nshapes,
std::function<int(int)> shape_fn,
bool use_self,
IMeshArena *arena);
/** This has the side effect of populating verts in the #IMesh. */
void write_obj_mesh(IMesh &m, const std::string &objname);
} /* namespace blender::meshintersect */
#endif /* WITH_GMP */

View File

@@ -0,0 +1,184 @@
/*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
#pragma once
/** \file
* \ingroup bli
*/
#ifdef WITH_GMP
# include "BLI_math_mpq.hh"
# include "BLI_mpq3.hh"
namespace blender {
struct mpq2 {
mpq_class x, y;
mpq2() = default;
mpq2(const mpq_class *ptr) : x{ptr[0]}, y{ptr[1]}
{
}
mpq2(mpq_class x, mpq_class y) : x(x), y(y)
{
}
mpq2(const mpq2 &other) : x(other.x), y(other.y)
{
}
mpq2(mpq2 &&other) noexcept : x(std::move(other.x)), y(std::move(other.y))
{
}
~mpq2() = default;
mpq2 &operator=(const mpq2 &other)
{
if (this != &other) {
x = other.x;
y = other.y;
}
return *this;
}
mpq2 &operator=(mpq2 &&other) noexcept
{
x = std::move(other.x);
y = std::move(other.y);
return *this;
}
mpq2(const mpq3 &other) : x(other.x), y(other.y)
{
}
operator mpq_class *()
{
return &x;
}
operator const mpq_class *() const
{
return &x;
}
/**
* Cannot do this exactly in rational arithmetic!
* Approximate by going in and out of doubles.
*/
mpq_class length() const
{
mpq_class lsquared = dot(*this, *this);
return mpq_class(sqrt(lsquared.get_d()));
}
friend mpq2 operator+(const mpq2 &a, const mpq2 &b)
{
return {a.x + b.x, a.y + b.y};
}
friend mpq2 operator-(const mpq2 &a, const mpq2 &b)
{
return {a.x - b.x, a.y - b.y};
}
friend mpq2 operator*(const mpq2 &a, mpq_class b)
{
return {a.x * b, a.y * b};
}
friend mpq2 operator/(const mpq2 &a, mpq_class b)
{
BLI_assert(b != 0);
return {a.x / b, a.y / b};
}
friend mpq2 operator*(mpq_class a, const mpq2 &b)
{
return b * a;
}
friend bool operator==(const mpq2 &a, const mpq2 &b)
{
return a.x == b.x && a.y == b.y;
}
friend bool operator!=(const mpq2 &a, const mpq2 &b)
{
return a.x != b.x || a.y != b.y;
}
friend std::ostream &operator<<(std::ostream &stream, const mpq2 &v)
{
stream << "(" << v.x << ", " << v.y << ")";
return stream;
}
static mpq_class dot(const mpq2 &a, const mpq2 &b)
{
return a.x * b.x + a.y * b.y;
}
static mpq2 interpolate(const mpq2 &a, const mpq2 &b, mpq_class t)
{
return a * (1 - t) + b * t;
}
static mpq2 abs(const mpq2 &a)
{
mpq_class abs_x = (a.x >= 0) ? a.x : -a.x;
mpq_class abs_y = (a.y >= 0) ? a.y : -a.y;
return mpq2(abs_x, abs_y);
}
static mpq_class distance(const mpq2 &a, const mpq2 &b)
{
return (a - b).length();
}
static mpq_class distance_squared(const mpq2 &a, const mpq2 &b)
{
return dot(a, b);
}
struct isect_result {
enum {
LINE_LINE_COLINEAR = -1,
LINE_LINE_NONE = 0,
LINE_LINE_EXACT = 1,
LINE_LINE_CROSS = 2,
} kind;
mpq_class lambda;
mpq_class mu;
};
static isect_result isect_seg_seg(const mpq2 &v1,
const mpq2 &v2,
const mpq2 &v3,
const mpq2 &v4);
/** There is a sensible use for hashing on exact arithmetic types. */
uint64_t hash() const;
};
} // namespace blender
#endif /* WITH_GMP */

View File

@@ -0,0 +1,281 @@
/*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
#pragma once
/** \file
* \ingroup bli
*/
#ifdef WITH_GMP
# include <iostream>
# include "BLI_math.h"
# include "BLI_math_mpq.hh"
# include "BLI_span.hh"
namespace blender {
struct mpq3 {
mpq_class x, y, z;
mpq3() = default;
mpq3(const mpq_class *ptr) : x{ptr[0]}, y{ptr[1]}, z{ptr[2]}
{
}
mpq3(const mpq_class (*ptr)[3]) : mpq3((const mpq_class *)ptr)
{
}
explicit mpq3(mpq_class value) : x(value), y(value), z(value)
{
}
explicit mpq3(int value) : x(value), y(value), z(value)
{
}
mpq3(mpq_class x, mpq_class y, mpq_class z) : x{x}, y{y}, z{z}
{
}
operator const mpq_class *() const
{
return &x;
}
operator mpq_class *()
{
return &x;
}
/* Cannot do this exactly in rational arithmetic!
* Approximate by going in and out of doubles.
*/
mpq_class normalize_and_get_length()
{
double dv[3] = {x.get_d(), y.get_d(), z.get_d()};
double len = normalize_v3_db(dv);
this->x = mpq_class(dv[0]);
this->y = mpq_class(dv[1]);
this->z = mpq_class(dv[2]);
return len;
}
mpq3 normalized() const
{
double dv[3] = {x.get_d(), y.get_d(), z.get_d()};
double dr[3];
normalize_v3_v3_db(dr, dv);
return mpq3(mpq_class(dr[0]), mpq_class(dr[1]), mpq_class(dr[2]));
}
/* Cannot do this exactly in rational arithmetic!
* Approximate by going in and out of double.
*/
mpq_class length() const
{
mpq_class lsquared = this->length_squared();
double dsquared = lsquared.get_d();
double d = sqrt(dsquared);
return mpq_class(d);
}
mpq_class length_squared() const
{
return x * x + y * y + z * z;
}
void reflect(const mpq3 &normal)
{
*this = this->reflected(normal);
}
mpq3 reflected(const mpq3 &normal) const
{
mpq3 result;
const mpq_class dot2 = 2 * dot(*this, normal);
result.x = this->x - (dot2 * normal.x);
result.y = this->y - (dot2 * normal.y);
result.z = this->z - (dot2 * normal.z);
return result;
}
static mpq3 safe_divide(const mpq3 &a, const mpq3 &b)
{
mpq3 result;
result.x = (b.x == 0) ? mpq_class(0) : a.x / b.x;
result.y = (b.y == 0) ? mpq_class(0) : a.y / b.y;
result.z = (b.z == 0) ? mpq_class(0) : a.z / b.z;
return result;
}
void invert()
{
x = -x;
y = -y;
z = -z;
}
friend mpq3 operator+(const mpq3 &a, const mpq3 &b)
{
return mpq3(a.x + b.x, a.y + b.y, a.z + b.z);
}
void operator+=(const mpq3 &b)
{
this->x += b.x;
this->y += b.y;
this->z += b.z;
}
friend mpq3 operator-(const mpq3 &a, const mpq3 &b)
{
return mpq3(a.x - b.x, a.y - b.y, a.z - b.z);
}
friend mpq3 operator-(const mpq3 &a)
{
return mpq3(-a.x, -a.y, -a.z);
}
void operator-=(const mpq3 &b)
{
this->x -= b.x;
this->y -= b.y;
this->z -= b.z;
}
void operator*=(mpq_class scalar)
{
this->x *= scalar;
this->y *= scalar;
this->z *= scalar;
}
void operator*=(const mpq3 &other)
{
this->x *= other.x;
this->y *= other.y;
this->z *= other.z;
}
friend mpq3 operator*(const mpq3 &a, const mpq3 &b)
{
return {a.x * b.x, a.y * b.y, a.z * b.z};
}
friend mpq3 operator*(const mpq3 &a, const mpq_class &b)
{
return mpq3(a.x * b, a.y * b, a.z * b);
}
friend mpq3 operator*(const mpq_class &a, const mpq3 &b)
{
return mpq3(a * b.x, a * b.y, a * b.z);
}
friend mpq3 operator/(const mpq3 &a, const mpq_class &b)
{
BLI_assert(b != 0);
return mpq3(a.x / b, a.y / b, a.z / b);
}
friend bool operator==(const mpq3 &a, const mpq3 &b)
{
return a.x == b.x && a.y == b.y && a.z == b.z;
}
friend bool operator!=(const mpq3 &a, const mpq3 &b)
{
return a.x != b.x || a.y != b.y || a.z != b.z;
}
friend std::ostream &operator<<(std::ostream &stream, const mpq3 &v)
{
stream << "(" << v.x << ", " << v.y << ", " << v.z << ")";
return stream;
}
static mpq_class dot(const mpq3 &a, const mpq3 &b)
{
return a.x * b.x + a.y * b.y + a.z * b.z;
}
static mpq3 cross(const mpq3 &a, const mpq3 &b)
{
return mpq3(a[1] * b[2] - a[2] * b[1], a[2] * b[0] - a[0] * b[2], a[0] * b[1] - a[1] * b[0]);
}
static mpq3 cross_high_precision(const mpq3 &a, const mpq3 &b)
{
return cross(a, b);
}
static mpq3 project(const mpq3 &a, const mpq3 &b)
{
const mpq_class mul = mpq3::dot(a, b) / mpq3::dot(b, b);
return mpq3(mul * b[0], mul * b[1], mul * b[2]);
}
static mpq_class distance(const mpq3 &a, const mpq3 &b)
{
mpq3 diff(a.x - b.x, a.y - b.y, a.z - b.z);
return diff.length();
}
static mpq_class distance_squared(const mpq3 &a, const mpq3 &b)
{
mpq3 diff(a.x - b.x, a.y - b.y, a.z - b.z);
return mpq3::dot(diff, diff);
}
static mpq3 interpolate(const mpq3 &a, const mpq3 &b, mpq_class t)
{
mpq_class s = 1 - t;
return mpq3(a.x * s + b.x * t, a.y * s + b.y * t, a.z * s + b.z * t);
}
static mpq3 abs(const mpq3 &a)
{
mpq_class abs_x = (a.x >= 0) ? a.x : -a.x;
mpq_class abs_y = (a.y >= 0) ? a.y : -a.y;
mpq_class abs_z = (a.z >= 0) ? a.z : -a.z;
return mpq3(abs_x, abs_y, abs_z);
}
static int dominant_axis(const mpq3 &a)
{
mpq_class x = (a.x >= 0) ? a.x : -a.x;
mpq_class y = (a.y >= 0) ? a.y : -a.y;
mpq_class z = (a.z >= 0) ? a.z : -a.z;
return ((x > y) ? ((x > z) ? 0 : 2) : ((y > z) ? 1 : 2));
}
static mpq3 cross_poly(Span<mpq3> poly);
/** There is a sensible use for hashing on exact arithmetic types. */
uint64_t hash() const;
};
uint64_t hash_mpq_class(const mpq_class &value);
} // namespace blender
#endif /* WITH_GMP */

View File

@@ -32,6 +32,7 @@ set(INC
set(INC_SYS
${ZLIB_INCLUDE_DIRS}
${FREETYPE_INCLUDE_DIRS}
${GMP_INCLUDE_DIRS}
)
set(SRC
@@ -64,7 +65,7 @@ set(SRC
intern/boxpack_2d.c
intern/buffer.c
intern/convexhull_2d.c
intern/delaunay_2d.c
intern/delaunay_2d.cc
intern/dot_export.cc
intern/dynlib.c
intern/easing.c
@@ -89,6 +90,7 @@ set(SRC
intern/math_base_inline.c
intern/math_base_safe_inline.c
intern/math_bits_inline.c
intern/math_boolean.cc
intern/math_color.c
intern/math_color_blend_inline.c
intern/math_color_inline.c
@@ -99,9 +101,12 @@ set(SRC
intern/math_rotation.c
intern/math_solvers.c
intern/math_statistics.c
intern/math_vec.cc
intern/math_vector.c
intern/math_vector_inline.c
intern/memory_utils.c
intern/mesh_boolean.cc
intern/mesh_intersect.cc
intern/noise.c
intern/path_util.c
intern/polyfill_2d.c
@@ -170,6 +175,8 @@ set(SRC
BLI_dlrbTree.h
BLI_dot_export.hh
BLI_dot_export_attribute_enums.hh
BLI_double2.hh
BLI_double3.hh
BLI_dynlib.h
BLI_dynstr.h
BLI_easing.h
@@ -214,11 +221,13 @@ set(SRC
BLI_math_base.h
BLI_math_base_safe.h
BLI_math_bits.h
BLI_math_boolean.hh
BLI_math_color.h
BLI_math_color_blend.h
BLI_math_geom.h
BLI_math_inline.h
BLI_math_interp.h
BLI_math_mpq.hh
BLI_math_matrix.h
BLI_math_rotation.h
BLI_math_solvers.h
@@ -230,6 +239,10 @@ set(SRC
BLI_memory_utils.h
BLI_memory_utils.hh
BLI_mempool.h
BLI_mesh_boolean.hh
BLI_mesh_intersect.hh
BLI_mpq2.hh
BLI_mpq3.hh
BLI_noise.h
BLI_path_util.h
BLI_polyfill_2d.h
@@ -306,6 +319,18 @@ if(WITH_TBB)
)
endif()
if(WITH_GMP)
add_definitions(-DWITH_GMP)
list(APPEND INC_SYS
${GMP_INCLUDE_DIRS}
)
list(APPEND LIB
${GMP_LIBRARIES}
)
endif()
if(WIN32)
list(APPEND INC
../../../intern/utfconv
@@ -374,6 +399,8 @@ if(WITH_GTESTS)
tests/BLI_math_vector_test.cc
tests/BLI_memiter_test.cc
tests/BLI_memory_utils_test.cc
tests/BLI_mesh_boolean_test.cc
tests/BLI_mesh_intersect_test.cc
tests/BLI_multi_value_map_test.cc
tests/BLI_path_util_test.cc
tests/BLI_polyfill_2d_test.cc

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,193 @@
/*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
/** \file
* \ingroup bli
*/
#include "BLI_double2.hh"
#include "BLI_double3.hh"
#include "BLI_float2.hh"
#include "BLI_float3.hh"
#include "BLI_hash.hh"
#include "BLI_math_mpq.hh"
#include "BLI_mpq2.hh"
#include "BLI_mpq3.hh"
#include "BLI_span.hh"
#include "BLI_utildefines.h"
namespace blender {
float2::isect_result float2::isect_seg_seg(const float2 &v1,
const float2 &v2,
const float2 &v3,
const float2 &v4)
{
float2::isect_result ans;
float div = (v2[0] - v1[0]) * (v4[1] - v3[1]) - (v2[1] - v1[1]) * (v4[0] - v3[0]);
if (div == 0.0f) {
ans.lambda = 0.0f;
ans.mu = 0.0f;
ans.kind = float2::isect_result::LINE_LINE_COLINEAR;
}
else {
ans.lambda = ((v1[1] - v3[1]) * (v4[0] - v3[0]) - (v1[0] - v3[0]) * (v4[1] - v3[1])) / div;
ans.mu = ((v1[1] - v3[1]) * (v2[0] - v1[0]) - (v1[0] - v3[0]) * (v2[1] - v1[1])) / div;
if (ans.lambda >= 0.0f && ans.lambda <= 1.0f && ans.mu >= 0.0f && ans.mu <= 1.0f) {
if (ans.lambda == 0.0f || ans.lambda == 1.0f || ans.mu == 0.0f || ans.mu == 1.0f) {
ans.kind = float2::isect_result::LINE_LINE_EXACT;
}
else {
ans.kind = float2::isect_result::LINE_LINE_CROSS;
}
}
else {
ans.kind = float2::isect_result::LINE_LINE_NONE;
}
}
return ans;
}
double2::isect_result double2::isect_seg_seg(const double2 &v1,
const double2 &v2,
const double2 &v3,
const double2 &v4)
{
double2::isect_result ans;
double div = (v2[0] - v1[0]) * (v4[1] - v3[1]) - (v2[1] - v1[1]) * (v4[0] - v3[0]);
if (div == 0.0) {
ans.lambda = 0.0;
ans.mu = 0.0;
ans.kind = double2::isect_result::LINE_LINE_COLINEAR;
}
else {
ans.lambda = ((v1[1] - v3[1]) * (v4[0] - v3[0]) - (v1[0] - v3[0]) * (v4[1] - v3[1])) / div;
ans.mu = ((v1[1] - v3[1]) * (v2[0] - v1[0]) - (v1[0] - v3[0]) * (v2[1] - v1[1])) / div;
if (ans.lambda >= 0.0 && ans.lambda <= 1.0 && ans.mu >= 0.0 && ans.mu <= 1.0) {
if (ans.lambda == 0.0 || ans.lambda == 1.0 || ans.mu == 0.0 || ans.mu == 1.0) {
ans.kind = double2::isect_result::LINE_LINE_EXACT;
}
else {
ans.kind = double2::isect_result::LINE_LINE_CROSS;
}
}
else {
ans.kind = double2::isect_result::LINE_LINE_NONE;
}
}
return ans;
}
#ifdef WITH_GMP
mpq2::isect_result mpq2::isect_seg_seg(const mpq2 &v1,
const mpq2 &v2,
const mpq2 &v3,
const mpq2 &v4)
{
mpq2::isect_result ans;
mpq_class div = (v2[0] - v1[0]) * (v4[1] - v3[1]) - (v2[1] - v1[1]) * (v4[0] - v3[0]);
if (div == 0.0) {
ans.lambda = 0.0;
ans.mu = 0.0;
ans.kind = mpq2::isect_result::LINE_LINE_COLINEAR;
}
else {
ans.lambda = ((v1[1] - v3[1]) * (v4[0] - v3[0]) - (v1[0] - v3[0]) * (v4[1] - v3[1])) / div;
ans.mu = ((v1[1] - v3[1]) * (v2[0] - v1[0]) - (v1[0] - v3[0]) * (v2[1] - v1[1])) / div;
if (ans.lambda >= 0 && ans.lambda <= 1 && ans.mu >= 0 && ans.mu <= 1) {
if (ans.lambda == 0 || ans.lambda == 1 || ans.mu == 0 || ans.mu == 1) {
ans.kind = mpq2::isect_result::LINE_LINE_EXACT;
}
else {
ans.kind = mpq2::isect_result::LINE_LINE_CROSS;
}
}
else {
ans.kind = mpq2::isect_result::LINE_LINE_NONE;
}
}
return ans;
}
#endif
double3 double3::cross_poly(Span<double3> poly)
{
/* Newell's Method. */
int nv = static_cast<int>(poly.size());
if (nv < 3) {
return double3(0, 0, 0);
}
const double3 *v_prev = &poly[nv - 1];
const double3 *v_curr = &poly[0];
double3 n(0, 0, 0);
for (int i = 0; i < nv;) {
n[0] = n[0] + ((*v_prev)[1] - (*v_curr)[1]) * ((*v_prev)[2] + (*v_curr)[2]);
n[1] = n[1] + ((*v_prev)[2] - (*v_curr)[2]) * ((*v_prev)[0] + (*v_curr)[0]);
n[2] = n[2] + ((*v_prev)[0] - (*v_curr)[0]) * ((*v_prev)[1] + (*v_curr)[1]);
v_prev = v_curr;
++i;
if (i < nv) {
v_curr = &poly[i];
}
}
return n;
}
mpq3 mpq3::cross_poly(Span<mpq3> poly)
{
/* Newell's Method. */
int nv = static_cast<int>(poly.size());
if (nv < 3) {
return mpq3(0);
}
const mpq3 *v_prev = &poly[nv - 1];
const mpq3 *v_curr = &poly[0];
mpq3 n(0);
for (int i = 0; i < nv;) {
n[0] = n[0] + ((*v_prev)[1] - (*v_curr)[1]) * ((*v_prev)[2] + (*v_curr)[2]);
n[1] = n[1] + ((*v_prev)[2] - (*v_curr)[2]) * ((*v_prev)[0] + (*v_curr)[0]);
n[2] = n[2] + ((*v_prev)[0] - (*v_curr)[0]) * ((*v_prev)[1] + (*v_curr)[1]);
v_prev = v_curr;
++i;
if (i < nv) {
v_curr = &poly[i];
}
}
return n;
}
uint64_t hash_mpq_class(const mpq_class &value)
{
/* TODO: better/faster implementation of this. */
return DefaultHash<float>{}(static_cast<float>(value.get_d()));
}
uint64_t mpq2::hash() const
{
uint64_t hashx = hash_mpq_class(this->x);
uint64_t hashy = hash_mpq_class(this->y);
return hashx ^ (hashy * 33);
}
uint64_t mpq3::hash() const
{
uint64_t hashx = hash_mpq_class(this->x);
uint64_t hashy = hash_mpq_class(this->y);
uint64_t hashz = hash_mpq_class(this->z);
return hashx ^ (hashy * 33) ^ (hashz * 33 * 37);
}
} // namespace blender

View File

@@ -669,6 +669,15 @@ void project_v3_v3v3(float out[3], const float p[3], const float v_proj[3])
out[2] = mul * v_proj[2];
}
void project_v3_v3v3_db(double out[3], const double p[3], const double v_proj[3])
{
const double mul = dot_v3v3_db(p, v_proj) / dot_v3v3_db(v_proj, v_proj);
out[0] = mul * v_proj[0];
out[1] = mul * v_proj[1];
out[2] = mul * v_proj[2];
}
/**
* Project \a p onto a unit length \a v_proj
*/
@@ -796,6 +805,17 @@ void reflect_v3_v3v3(float out[3], const float v[3], const float normal[3])
out[2] = v[2] - (dot2 * normal[2]);
}
void reflect_v3_v3v3_db(double out[3], const double v[3], const double normal[3])
{
const double dot2 = 2.0 * dot_v3v3_db(v, normal);
/* BLI_ASSERT_UNIT_V3_DB(normal); this assert is not known? */
out[0] = v[0] - (dot2 * normal[0]);
out[1] = v[1] - (dot2 * normal[1]);
out[2] = v[2] - (dot2 * normal[2]);
}
/**
* Takes a vector and computes 2 orthogonal directions.
*

View File

@@ -571,6 +571,13 @@ MINLINE void mul_v3_v3fl(float r[3], const float a[3], float f)
r[2] = a[2] * f;
}
MINLINE void mul_v3_v3db_db(double r[3], const double a[3], double f)
{
r[0] = a[0] * f;
r[1] = a[1] * f;
r[2] = a[2] * f;
}
MINLINE void mul_v2_v2(float r[2], const float a[2])
{
r[0] *= a[0];
@@ -988,6 +995,11 @@ MINLINE float len_squared_v3(const float v[3])
return v[0] * v[0] + v[1] * v[1] + v[2] * v[2];
}
MINLINE double len_squared_v3_db(const double v[3])
{
return v[0] * v[0] + v[1] * v[1] + v[2] * v[2];
}
MINLINE float len_manhattan_v2(const float v[2])
{
return fabsf(v[0]) + fabsf(v[1]);
@@ -1045,6 +1057,11 @@ MINLINE float len_v3(const float a[3])
return sqrtf(dot_v3v3(a, a));
}
MINLINE double len_v3_db(const double a[3])
{
return sqrt(dot_v3v3_db(a, a));
}
MINLINE float len_squared_v2v2(const float a[2], const float b[2])
{
float d[2];
@@ -1161,7 +1178,29 @@ MINLINE float normalize_v3_v3(float r[3], const float a[3])
return normalize_v3_v3_length(r, a, 1.0f);
}
MINLINE double normalize_v3_length_d(double n[3], const double unit_length)
MINLINE double normalize_v3_v3_length_db(double r[3], const double a[3], double unit_length)
{
double d = dot_v3v3_db(a, a);
/* a larger value causes normalize errors in a
* scaled down models with camera extreme close */
if (d > 1.0e-70) {
d = sqrt(d);
mul_v3_v3db_db(r, a, unit_length / d);
}
else {
zero_v3_db(r);
d = 0.0;
}
return d;
}
MINLINE double normalize_v3_v3_db(double r[3], const double a[3])
{
return normalize_v3_v3_length_db(r, a, 1.0);
}
MINLINE double normalize_v3_length_db(double n[3], const double unit_length)
{
double d = n[0] * n[0] + n[1] * n[1] + n[2] * n[2];
@@ -1184,9 +1223,9 @@ MINLINE double normalize_v3_length_d(double n[3], const double unit_length)
return d;
}
MINLINE double normalize_v3_d(double n[3])
MINLINE double normalize_v3_db(double n[3])
{
return normalize_v3_length_d(n, 1.0);
return normalize_v3_length_db(n, 1.0);
}
MINLINE float normalize_v3_length(float n[3], const float unit_length)

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,908 @@
/* Apache License, Version 2.0 */
#include "testing/testing.h"
#include <fstream>
#include <iostream>
#include <sstream>
#include "MEM_guardedalloc.h"
#include "BLI_array.hh"
#include "BLI_map.hh"
#include "BLI_math_mpq.hh"
#include "BLI_mesh_boolean.hh"
#include "BLI_mpq3.hh"
#include "BLI_vector.hh"
namespace blender::meshintersect::tests {
constexpr bool DO_OBJ = false;
/* Build and hold an IMesh from a string spec. Also hold and own resources used by IMesh. */
class IMeshBuilder {
public:
IMesh imesh;
IMeshArena arena;
/* "Edge orig" indices are an encoding of <input face#, position in face of start of edge>. */
static constexpr int MAX_FACE_LEN = 1000; /* Used for forming "orig edge" indices only. */
static int edge_index(int face_index, int facepos)
{
return face_index * MAX_FACE_LEN + facepos;
}
static std::pair<int, int> face_and_pos_for_edge_index(int e_index)
{
return std::pair<int, int>(e_index / MAX_FACE_LEN, e_index % MAX_FACE_LEN);
}
/*
* Spec should have form:
* #verts #faces
* mpq_class mpq_class mpq_clas [#verts lines]
* int int int ... [#faces lines; indices into verts for given face]
*/
IMeshBuilder(const char *spec)
{
std::istringstream ss(spec);
std::string line;
getline(ss, line);
std::istringstream hdrss(line);
int nv, nf;
hdrss >> nv >> nf;
if (nv == 0 || nf == 0) {
return;
}
arena.reserve(nv, nf);
Vector<const Vert *> verts;
Vector<Face *> faces;
bool spec_ok = true;
int v_index = 0;
while (v_index < nv && spec_ok && getline(ss, line)) {
std::istringstream iss(line);
mpq_class p0;
mpq_class p1;
mpq_class p2;
iss >> p0 >> p1 >> p2;
spec_ok = !iss.fail();
verts.append(arena.add_or_find_vert(mpq3(p0, p1, p2), v_index));
++v_index;
}
if (v_index != nv) {
spec_ok = false;
}
int f_index = 0;
while (f_index < nf && spec_ok && getline(ss, line)) {
std::istringstream fss(line);
Vector<const Vert *> face_verts;
Vector<int> edge_orig;
int fpos = 0;
while (spec_ok && fss >> v_index) {
if (v_index < 0 || v_index >= nv) {
spec_ok = false;
continue;
}
face_verts.append(verts[v_index]);
edge_orig.append(edge_index(f_index, fpos));
++fpos;
}
Face *facep = arena.add_face(face_verts, f_index, edge_orig);
faces.append(facep);
++f_index;
}
if (f_index != nf) {
spec_ok = false;
}
if (!spec_ok) {
std::cout << "Bad spec: " << spec;
return;
}
imesh = IMesh(faces);
}
};
static int all_shape_zero(int UNUSED(t))
{
return 0;
}
TEST(boolean_trimesh, Empty)
{
IMeshArena arena;
IMesh in;
IMesh out = boolean_trimesh(in, BoolOpType::None, 1, all_shape_zero, true, &arena);
out.populate_vert();
EXPECT_EQ(out.vert_size(), 0);
EXPECT_EQ(out.face_size(), 0);
}
TEST(boolean_trimesh, TetTetTrimesh)
{
const char *spec = R"(8 8
0 0 0
2 0 0
1 2 0
1 1 2
0 0 1
2 0 1
1 2 1
1 1 3
0 2 1
0 1 3
1 2 3
2 0 3
4 6 5
4 5 7
5 6 7
6 4 7
)";
IMeshBuilder mb(spec);
IMesh out = boolean_trimesh(mb.imesh, BoolOpType::None, 1, all_shape_zero, true, &mb.arena);
out.populate_vert();
EXPECT_EQ(out.vert_size(), 11);
EXPECT_EQ(out.face_size(), 20);
if (DO_OBJ) {
write_obj_mesh(out, "tettet_tm");
}
IMeshBuilder mb2(spec);
IMesh out2 = boolean_trimesh(mb2.imesh, BoolOpType::Union, 1, all_shape_zero, true, &mb2.arena);
out2.populate_vert();
EXPECT_EQ(out2.vert_size(), 10);
EXPECT_EQ(out2.face_size(), 16);
if (DO_OBJ) {
write_obj_mesh(out2, "tettet_union_tm");
}
IMeshBuilder mb3(spec);
IMesh out3 = boolean_trimesh(
mb3.imesh, BoolOpType::Union, 2, [](int t) { return t < 4 ? 0 : 1; }, false, &mb3.arena);
out3.populate_vert();
EXPECT_EQ(out3.vert_size(), 10);
EXPECT_EQ(out3.face_size(), 16);
if (DO_OBJ) {
write_obj_mesh(out3, "tettet_union_binary_tm");
}
IMeshBuilder mb4(spec);
IMesh out4 = boolean_trimesh(
mb4.imesh, BoolOpType::Union, 2, [](int t) { return t < 4 ? 0 : 1; }, true, &mb4.arena);
out4.populate_vert();
EXPECT_EQ(out4.vert_size(), 10);
EXPECT_EQ(out4.face_size(), 16);
if (DO_OBJ) {
write_obj_mesh(out4, "tettet_union_binary_self_tm");
}
IMeshBuilder mb5(spec);
IMesh out5 = boolean_trimesh(
mb5.imesh, BoolOpType::Intersect, 2, [](int t) { return t < 4 ? 0 : 1; }, false, &mb5.arena);
out5.populate_vert();
EXPECT_EQ(out5.vert_size(), 4);
EXPECT_EQ(out5.face_size(), 4);
if (DO_OBJ) {
write_obj_mesh(out5, "tettet_intersect_binary_tm");
}
IMeshBuilder mb6(spec);
IMesh out6 = boolean_trimesh(
mb6.imesh,
BoolOpType::Difference,
2,
[](int t) { return t < 4 ? 0 : 1; },
false,
&mb6.arena);
out6.populate_vert();
EXPECT_EQ(out6.vert_size(), 6);
EXPECT_EQ(out6.face_size(), 8);
if (DO_OBJ) {
write_obj_mesh(out6, "tettet_difference_binary_tm");
}
IMeshBuilder mb7(spec);
IMesh out7 = boolean_trimesh(
mb7.imesh,
BoolOpType::Difference,
2,
[](int t) { return t < 4 ? 1 : 0; },
false,
&mb7.arena);
out7.populate_vert();
EXPECT_EQ(out7.vert_size(), 8);
EXPECT_EQ(out7.face_size(), 12);
if (DO_OBJ) {
write_obj_mesh(out7, "tettet_difference_rev_binary_tm");
}
}
TEST(boolean_trimesh, TetTet2Trimesh)
{
const char *spec = R"(8 8
0 1 -1
7/8 -1/2 -1
-7/8 -1/2 -1
0 0 1
0 1 0
7/8 -1/2 0
-7/8 -1/2 0
0 0 2
0 3 1
0 1 2
1 3 2
2 3 0
4 7 5
4 5 6
5 7 6
6 7 4
)";
IMeshBuilder mb(spec);
IMesh out = boolean_trimesh(mb.imesh, BoolOpType::Union, 1, all_shape_zero, true, &mb.arena);
out.populate_vert();
EXPECT_EQ(out.vert_size(), 10);
EXPECT_EQ(out.face_size(), 16);
if (DO_OBJ) {
write_obj_mesh(out, "tettet2_union_tm");
}
}
TEST(boolean_trimesh, CubeTetTrimesh)
{
const char *spec = R"(12 16
-1 -1 -1
-1 -1 1
-1 1 -1
-1 1 1
1 -1 -1
1 -1 1
1 1 -1
1 1 1
0 1/2 1/2
1/2 -1/4 1/2
-1/2 -1/4 1/2
0 0 3/2
0 1 3
0 3 2
2 3 7
2 7 6
6 7 5
6 5 4
4 5 1
4 1 0
2 6 4
2 4 0
7 3 1
7 1 5
8 11 9
8 9 10
9 11 10
10 11 8
)";
IMeshBuilder mb(spec);
IMesh out = boolean_trimesh(mb.imesh, BoolOpType::Union, 1, all_shape_zero, true, &mb.arena);
out.populate_vert();
EXPECT_EQ(out.vert_size(), 14);
EXPECT_EQ(out.face_size(), 24);
if (DO_OBJ) {
write_obj_mesh(out, "cubetet_union_tm");
}
}
TEST(boolean_trimesh, BinaryTetTetTrimesh)
{
const char *spec = R"(8 8
0 0 0
2 0 0
1 2 0
1 1 2
0 0 1
2 0 1
1 2 1
1 1 3
0 2 1
0 1 3
1 2 3
2 0 3
4 6 5
4 5 7
5 6 7
6 4 7
)";
IMeshBuilder mb(spec);
IMesh out = boolean_trimesh(
mb.imesh, BoolOpType::Intersect, 2, [](int t) { return t < 4 ? 0 : 1; }, false, &mb.arena);
out.populate_vert();
EXPECT_EQ(out.vert_size(), 4);
EXPECT_EQ(out.face_size(), 4);
if (DO_OBJ) {
write_obj_mesh(out, "binary_tettet_isect_tm");
}
}
TEST(boolean_trimesh, TetTetCoplanarTrimesh)
{
const char *spec = R"(8 8
0 1 0
7/8 -1/2 0
-7/8 -1/2 0
0 0 1
0 1 0
7/8 -1/2 0
-7/8 -1/2 0
0 0 -1
0 3 1
0 1 2
1 3 2
2 3 0
4 5 7
4 6 5
5 6 7
6 4 7
)";
IMeshBuilder mb(spec);
IMesh out = boolean_trimesh(mb.imesh, BoolOpType::Union, 1, all_shape_zero, true, &mb.arena);
out.populate_vert();
EXPECT_EQ(out.vert_size(), 5);
EXPECT_EQ(out.face_size(), 6);
if (DO_OBJ) {
write_obj_mesh(out, "tettet_coplanar_tm");
}
}
TEST(boolean_trimesh, TetInsideTetTrimesh)
{
const char *spec = R"(8 8
0 0 0
2 0 0
1 2 0
1 1 2
-1 -3/4 -1/2
3 -3/4 -1/2
1 13/4 -1/2
1 5/4 7/2
0 2 1
0 1 3
1 2 3
2 0 3
4 6 5
4 5 7
5 6 7
6 4 7
)";
IMeshBuilder mb(spec);
IMesh out = boolean_trimesh(mb.imesh, BoolOpType::Union, 1, all_shape_zero, true, &mb.arena);
out.populate_vert();
EXPECT_EQ(out.vert_size(), 4);
EXPECT_EQ(out.face_size(), 4);
if (DO_OBJ) {
write_obj_mesh(out, "tetinsidetet_tm");
}
}
TEST(boolean_trimesh, TetBesideTetTrimesh)
{
const char *spec = R"(8 8
0 0 0
2 0 0
1 2 0
1 1 2
3 0 0
5 0 0
4 2 0
4 1 2
0 2 1
0 1 3
1 2 3
2 0 3
4 6 5
4 5 7
5 6 7
6 4 7
)";
IMeshBuilder mb(spec);
IMesh out = boolean_trimesh(mb.imesh, BoolOpType::Union, 1, all_shape_zero, true, &mb.arena);
out.populate_vert();
EXPECT_EQ(out.vert_size(), 8);
EXPECT_EQ(out.face_size(), 8);
if (DO_OBJ) {
write_obj_mesh(out, "tetbesidetet_tm");
}
}
TEST(boolean_trimesh, DegenerateTris)
{
const char *spec = R"(10 10
0 0 0
2 0 0
1 2 0
1 1 2
0 0 1
2 0 1
1 2 1
1 1 3
0 0 0
1 0 0
0 2 1
0 8 1
0 1 3
1 2 3
2 0 3
4 6 5
4 5 7
5 6 7
6 4 7
0 1 9
)";
IMeshBuilder mb(spec);
IMesh out = boolean_trimesh(
mb.imesh, BoolOpType::Intersect, 2, [](int t) { return t < 5 ? 0 : 1; }, false, &mb.arena);
out.populate_vert();
EXPECT_EQ(out.vert_size(), 4);
EXPECT_EQ(out.face_size(), 4);
if (DO_OBJ) {
write_obj_mesh(out, "degenerate_tris_tm");
}
}
TEST(boolean_polymesh, TetTet)
{
const char *spec = R"(8 8
0 0 0
2 0 0
1 2 0
1 1 2
0 0 1
2 0 1
1 2 1
1 1 3
0 2 1
0 1 3
1 2 3
2 0 3
4 6 5
4 5 7
5 6 7
6 4 7
)";
IMeshBuilder mb(spec);
IMesh out = boolean_mesh(
mb.imesh, BoolOpType::None, 1, all_shape_zero, true, nullptr, &mb.arena);
out.populate_vert();
EXPECT_EQ(out.vert_size(), 11);
EXPECT_EQ(out.face_size(), 13);
if (DO_OBJ) {
write_obj_mesh(out, "tettet");
}
IMeshBuilder mb2(spec);
IMesh out2 = boolean_mesh(
mb2.imesh,
BoolOpType::None,
2,
[](int t) { return t < 4 ? 0 : 1; },
false,
nullptr,
&mb2.arena);
out2.populate_vert();
EXPECT_EQ(out2.vert_size(), 11);
EXPECT_EQ(out2.face_size(), 13);
if (DO_OBJ) {
write_obj_mesh(out, "tettet2");
}
}
TEST(boolean_polymesh, CubeCube)
{
const char *spec = R"(16 12
-1 -1 -1
-1 -1 1
-1 1 -1
-1 1 1
1 -1 -1
1 -1 1
1 1 -1
1 1 1
1/2 1/2 1/2
1/2 1/2 5/2
1/2 5/2 1/2
1/2 5/2 5/2
5/2 1/2 1/2
5/2 1/2 5/2
5/2 5/2 1/2
5/2 5/2 5/2
0 1 3 2
6 2 3 7
4 6 7 5
0 4 5 1
0 2 6 4
3 1 5 7
8 9 11 10
14 10 11 15
12 14 15 13
8 12 13 9
8 10 14 12
11 9 13 15
)";
IMeshBuilder mb(spec);
if (DO_OBJ) {
write_obj_mesh(mb.imesh, "cube_cube_in");
}
IMesh out = boolean_mesh(
mb.imesh, BoolOpType::Union, 1, all_shape_zero, true, nullptr, &mb.arena);
out.populate_vert();
EXPECT_EQ(out.vert_size(), 20);
EXPECT_EQ(out.face_size(), 12);
if (DO_OBJ) {
write_obj_mesh(out, "cubecube_union");
}
IMeshBuilder mb2(spec);
IMesh out2 = boolean_mesh(
mb2.imesh,
BoolOpType::None,
2,
[](int t) { return t < 6 ? 0 : 1; },
false,
nullptr,
&mb2.arena);
out2.populate_vert();
EXPECT_EQ(out2.vert_size(), 22);
EXPECT_EQ(out2.face_size(), 18);
if (DO_OBJ) {
write_obj_mesh(out2, "cubecube_none");
}
}
TEST(boolean_polymesh, CubeCone)
{
const char *spec = R"(14 12
-1 -1 -1
-1 -1 1
-1 1 -1
-1 1 1
1 -1 -1
1 -1 1
1 1 -1
1 1 1
0 1/2 3/4
119/250 31/200 3/4
147/500 -81/200 3/4
0 0 7/4
-147/500 -81/200 3/4
-119/250 31/200 3/4
0 1 3 2
2 3 7 6
6 7 5 4
4 5 1 0
2 6 4 0
7 3 1 5
8 11 9
9 11 10
10 11 12
12 11 13
13 11 8
8 9 10 12 13)";
IMeshBuilder mb(spec);
IMesh out = boolean_mesh(
mb.imesh, BoolOpType::Union, 1, all_shape_zero, true, nullptr, &mb.arena);
out.populate_vert();
EXPECT_EQ(out.vert_size(), 14);
EXPECT_EQ(out.face_size(), 12);
if (DO_OBJ) {
write_obj_mesh(out, "cubeccone");
}
}
TEST(boolean_polymesh, CubeCubeCoplanar)
{
const char *spec = R"(16 12
-1 -1 -1
-1 -1 1
-1 1 -1
-1 1 1
1 -1 -1
1 -1 1
1 1 -1
1 1 1
-1/2 -1/2 1
-1/2 -1/2 2
-1/2 1/2 1
-1/2 1/2 2
1/2 -1/2 1
1/2 -1/2 2
1/2 1/2 1
1/2 1/2 2
0 1 3 2
2 3 7 6
6 7 5 4
4 5 1 0
2 6 4 0
7 3 1 5
8 9 11 10
10 11 15 14
14 15 13 12
12 13 9 8
10 14 12 8
15 11 9 13
)";
IMeshBuilder mb(spec);
IMesh out = boolean_mesh(
mb.imesh,
BoolOpType::Union,
2,
[](int t) { return t < 6 ? 0 : 1; },
false,
nullptr,
&mb.arena);
out.populate_vert();
EXPECT_EQ(out.vert_size(), 16);
EXPECT_EQ(out.face_size(), 12);
if (DO_OBJ) {
write_obj_mesh(out, "cubecube_coplanar");
}
}
TEST(boolean_polymesh, TetTeTCoplanarDiff)
{
const char *spec = R"(8 8
0 1 0
7/8 -1/2 0
-7/8 -1/2 0
0 0 1
0 1 0
7/8 -1/2 0
-7/8 -1/2 0
0 0 -1
0 3 1
0 1 2
1 3 2
2 3 0
4 5 7
4 6 5
5 6 7
6 4 7
)";
IMeshBuilder mb(spec);
IMesh out = boolean_mesh(
mb.imesh,
BoolOpType::Difference,
2,
[](int t) { return t < 4 ? 0 : 1; },
false,
nullptr,
&mb.arena);
out.populate_vert();
EXPECT_EQ(out.vert_size(), 4);
EXPECT_EQ(out.face_size(), 4);
if (DO_OBJ) {
write_obj_mesh(out, "tettet_coplanar_diff");
}
}
TEST(boolean_polymesh, CubeCubeStep)
{
const char *spec = R"(16 12
0 -1 0
0 -1 2
0 1 0
0 1 2
2 -1 0
2 -1 2
2 1 0
2 1 2
-1 -1 -1
-1 -1 1
-1 1 -1
-1 1 1
1 -1 -1
1 -1 1
1 1 -1
1 1 1
0 1 3 2
2 3 7 6
6 7 5 4
4 5 1 0
2 6 4 0
7 3 1 5
8 9 11 10
10 11 15 14
14 15 13 12
12 13 9 8
10 14 12 8
15 11 9 13
)";
IMeshBuilder mb(spec);
IMesh out = boolean_mesh(
mb.imesh,
BoolOpType::Difference,
2,
[](int t) { return t < 6 ? 0 : 1; },
false,
nullptr,
&mb.arena);
out.populate_vert();
EXPECT_EQ(out.vert_size(), 12);
EXPECT_EQ(out.face_size(), 8);
if (DO_OBJ) {
write_obj_mesh(out, "cubecubestep");
}
}
TEST(boolean_polymesh, CubeCyl4)
{
const char *spec = R"(16 12
0 1 -1
0 1 1
1 0 -1
1 0 1
0 -1 -1
0 -1 1
-1 0 -1
-1 0 1
-1 -1 -1
-1 -1 1
-1 1 -1
-1 1 1
1 -1 -1
1 -1 1
1 1 -1
1 1 1
0 1 3 2
2 3 5 4
3 1 7 5
4 5 7 6
6 7 1 0
0 2 4 6
8 9 11 10
10 11 15 14
14 15 13 12
12 13 9 8
10 14 12 8
15 11 9 13
)";
IMeshBuilder mb(spec);
IMesh out = boolean_mesh(
mb.imesh,
BoolOpType::Difference,
2,
[](int t) { return t < 6 ? 1 : 0; },
false,
nullptr,
&mb.arena);
out.populate_vert();
EXPECT_EQ(out.vert_size(), 16);
EXPECT_EQ(out.face_size(), 20);
if (DO_OBJ) {
write_obj_mesh(out, "cubecyl4");
}
}
TEST(boolean_polymesh, CubeCubesubdivDiff)
{
/* A cube intersected by a subdivided cube that intersects first cubes edges exactly. */
const char *spec = R"(26 22
2 1/3 2
2 -1/3 2
2 -1/3 0
2 1/3 0
0 -1/3 2
0 1/3 2
0 1/3 0
0 -1/3 0
1 1/3 2
1 -1/3 2
1 1/3 0
1 -1/3 0
0 -1/3 1
0 1/3 1
2 1/3 1
2 -1/3 1
1 1/3 1
1 -1/3 1
-1 -1 -1
-1 -1 1
-1 1 -1
-1 1 1
1 -1 -1
1 -1 1
1 1 -1
1 1 1
17 9 4 12
13 6 7 12
15 2 3 14
11 7 6 10
16 13 5 8
9 1 0 8
4 9 8 5
14 16 8 0
2 11 10 3
15 1 9 17
2 15 17 11
3 10 16 14
10 6 13 16
1 15 14 0
5 13 12 4
11 17 12 7
19 21 20 18
21 25 24 20
25 23 22 24
23 19 18 22
18 20 24 22
23 25 21 19
)";
IMeshBuilder mb(spec);
IMesh out = boolean_mesh(
mb.imesh,
BoolOpType::Difference,
2,
[](int t) { return t < 16 ? 1 : 0; },
false,
nullptr,
&mb.arena);
out.populate_vert();
EXPECT_EQ(out.vert_size(), 16);
EXPECT_EQ(out.face_size(), 10);
if (DO_OBJ) {
write_obj_mesh(out, "cubecubesubdivdiff");
}
}
TEST(boolean_polymesh, CubePlane)
{
const char *spec = R"(12 7
-2 -2 0
2 -2 0
-2 2 0
2 2 0
-1 -1 -1
-1 -1 1
-1 1 -1
-1 1 1
1 -1 -1
1 -1 1
1 1 -1
1 1 1
0 1 3 2
4 5 7 6
6 7 11 10
10 11 9 8
8 9 5 4
6 10 8 4
11 7 5 9
)";
IMeshBuilder mb(spec);
IMesh out = boolean_mesh(
mb.imesh,
BoolOpType::Difference,
2,
[](int t) { return t >= 1 ? 0 : 1; },
false,
nullptr,
&mb.arena);
out.populate_vert();
EXPECT_EQ(out.vert_size(), 8);
EXPECT_EQ(out.face_size(), 6);
if (DO_OBJ) {
write_obj_mesh(out, "cubeplane");
}
}
} // namespace blender::meshintersect::tests

File diff suppressed because it is too large Load Diff

View File

@@ -504,6 +504,18 @@ void blo_do_versions_290(FileData *fd, Library *UNUSED(lib), Main *bmain)
}
}
}
/* Initialize solver for Boolean. */
if (!DNA_struct_elem_find(fd->filesdna, "BooleanModifierData", "enum", "solver")) {
for (Object *object = bmain->objects.first; object != NULL; object = object->id.next) {
LISTBASE_FOREACH (ModifierData *, md, &object->modifiers) {
if (md->type == eModifierType_Boolean) {
BooleanModifierData *bmd = (BooleanModifierData *)md;
bmd->solver = eBooleanModifierSolver_Fast;
}
}
}
}
}
/**

View File

@@ -138,6 +138,8 @@ set(SRC
tools/bmesh_bevel.h
tools/bmesh_bisect_plane.c
tools/bmesh_bisect_plane.h
tools/bmesh_boolean.cc
tools/bmesh_boolean.h
tools/bmesh_decimate.h
tools/bmesh_decimate_collapse.c
tools/bmesh_decimate_dissolve.c
@@ -204,6 +206,18 @@ if(WITH_FREESTYLE)
add_definitions(-DWITH_FREESTYLE)
endif()
if(WITH_GMP)
add_definitions(-DWITH_GMP)
list(APPEND INC_SYS
${GMP_INCLUDE_DIRS}
)
list(APPEND LIB
${GMP_LIBRARIES}
)
endif()
blender_add_lib(bf_bmesh "${SRC}" "${INC}" "${INC_SYS}" "${LIB}")
if(WITH_GTESTS)

View File

@@ -30,6 +30,7 @@ extern "C" {
#include "tools/bmesh_beautify.h"
#include "tools/bmesh_bevel.h"
#include "tools/bmesh_bisect_plane.h"
#include "tools/bmesh_boolean.h"
#include "tools/bmesh_decimate.h"
#include "tools/bmesh_edgenet.h"
#include "tools/bmesh_edgesplit.h"

View File

@@ -0,0 +1,479 @@
/*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
/** \file
* \ingroup bmesh
*
* Main functions for boolean on a #BMesh (used by the tool and modifier)
*/
#include "BLI_array.hh"
#include "BLI_math.h"
#include "BLI_math_mpq.hh"
#include "BLI_mesh_boolean.hh"
#include "BLI_mesh_intersect.hh"
#include "bmesh.h"
#include "bmesh_boolean.h"
#include "bmesh_edgesplit.h"
namespace blender {
namespace meshintersect {
#ifdef WITH_GMP
/** Make a #blender::meshintersect::Mesh from #BMesh bm.
* We are given a triangulation of it from the caller via #looptris,
* which are looptris_tot triples of loops that together tessellate
* the faces of bm.
* Return a second #IMesh in *r_triangulated that has the triangulated
* mesh, with face "orig" fields that connect the triangles back to
* the faces in the returned (polygonal) mesh.
*/
static IMesh mesh_from_bm(BMesh *bm,
struct BMLoop *(*looptris)[3],
const int looptris_tot,
IMesh *r_triangulated,
IMeshArena *arena)
{
BLI_assert(r_triangulated != nullptr);
BM_mesh_elem_index_ensure(bm, BM_VERT | BM_EDGE | BM_FACE);
BM_mesh_elem_table_ensure(bm, BM_VERT | BM_EDGE | BM_FACE);
/* Account for triangulation and intersects. */
const int estimate_num_outv = (3 * bm->totvert) / 2;
const int estimate_num_outf = 4 * bm->totface;
arena->reserve(estimate_num_outv, estimate_num_outf);
Array<const Vert *> vert(bm->totvert);
for (int v = 0; v < bm->totvert; ++v) {
BMVert *bmv = BM_vert_at_index(bm, v);
vert[v] = arena->add_or_find_vert(mpq3(bmv->co[0], bmv->co[1], bmv->co[2]), v);
}
Array<Face *> face(bm->totface);
constexpr int estimated_max_facelen = 100;
Vector<const Vert *, estimated_max_facelen> face_vert;
Vector<int, estimated_max_facelen> face_edge_orig;
for (int f = 0; f < bm->totface; ++f) {
BMFace *bmf = BM_face_at_index(bm, f);
int flen = bmf->len;
face_vert.clear();
face_edge_orig.clear();
BMLoop *l = bmf->l_first;
for (int i = 0; i < flen; ++i) {
const Vert *v = vert[BM_elem_index_get(l->v)];
face_vert.append(v);
int e_index = BM_elem_index_get(l->e);
face_edge_orig.append(e_index);
l = l->next;
}
face[f] = arena->add_face(face_vert, f, face_edge_orig);
}
/* Now do the triangulation mesh.
* The loop_tris have accurate v and f members for the triangles,
* but their next and e pointers are not correct for the loops
* that start added-diagonal edges. */
Array<Face *> tri_face(looptris_tot);
face_vert.resize(3);
face_edge_orig.resize(3);
for (int i = 0; i < looptris_tot; ++i) {
BMFace *bmf = looptris[i][0]->f;
int f = BM_elem_index_get(bmf);
for (int j = 0; j < 3; ++j) {
BMLoop *l = looptris[i][j];
int v_index = BM_elem_index_get(l->v);
int e_index;
if (l->next->v == looptris[i][(j + 1) % 3]->v) {
e_index = BM_elem_index_get(l->e);
}
else {
e_index = NO_INDEX;
}
face_vert[j] = vert[v_index];
face_edge_orig[j] = e_index;
}
tri_face[i] = arena->add_face(face_vert, f, face_edge_orig);
}
r_triangulated->set_faces(tri_face);
return IMesh(face);
}
static bool bmvert_attached_to_wire(const BMVert *bmv)
{
/* This is not quite right. It returns true if the only edges
* Attached to \a bmv are wire edges. TODO: iterate through edges
* attached to \a bmv and check #BM_edge_is_wire. */
return BM_vert_is_wire(bmv);
}
static bool face_has_verts_in_order(BMesh *bm, BMFace *bmf, const BMVert *v1, const BMVert *v2)
{
BMIter liter;
BMLoop *l = static_cast<BMLoop *>(BM_iter_new(&liter, bm, BM_LOOPS_OF_FACE, bmf));
while (l != NULL) {
if (l->v == v1 && l->next->v == v2) {
return true;
}
l = static_cast<BMLoop *>(BM_iter_step(&liter));
}
return false;
}
/** Use the unused _BM_ELEM_TAG_ALT #BMElem.hflag to mark geometry we will keep. */
constexpr uint KEEP_FLAG = (1 << 6);
/**
* Change #BMesh bm to have the mesh match m_out. Return true if there were any changes at all.
* Vertices, faces, and edges in the current bm that are not used in the output are killed,
* except we don't kill wire edges and we don't kill hidden geometry.
* Also, the #BM_ELEM_TAG header flag is set for those #BMEdge's that come from intersections
* resulting from the intersection needed by the Boolean operation.
*/
static bool apply_mesh_output_to_bmesh(BMesh *bm, IMesh &m_out)
{
bool any_change = false;
m_out.populate_vert();
/* Initially mark all existing verts as "don't keep", except hidden verts
* and verts attached to wire edges. */
for (int v = 0; v < bm->totvert; ++v) {
BMVert *bmv = BM_vert_at_index(bm, v);
if (BM_elem_flag_test(bmv, BM_ELEM_HIDDEN) || bmvert_attached_to_wire(bmv)) {
BM_elem_flag_enable(bmv, KEEP_FLAG);
}
else {
BM_elem_flag_disable(bmv, KEEP_FLAG);
}
}
/* Reuse old or make new #BMVert's, depending on if there's an orig or not.
* For those reused, mark them "keep".
* Store needed old #BMVert's in new_bmvs first, as the table may be unusable after
* creating a new #BMVert. */
Array<BMVert *> new_bmvs(m_out.vert_size());
for (int v : m_out.vert_index_range()) {
const Vert *vertp = m_out.vert(v);
int orig = vertp->orig;
if (orig != NO_INDEX) {
BLI_assert(orig >= 0 && orig < bm->totvert);
BMVert *bmv = BM_vert_at_index(bm, orig);
new_bmvs[v] = bmv;
BM_elem_flag_enable(bmv, KEEP_FLAG);
}
else {
new_bmvs[v] = NULL;
}
}
for (int v : m_out.vert_index_range()) {
const Vert *vertp = m_out.vert(v);
if (new_bmvs[v] == NULL) {
float co[3];
const double3 &d_co = vertp->co;
for (int i = 0; i < 3; ++i) {
co[i] = static_cast<float>(d_co[i]);
}
BMVert *bmv = BM_vert_create(bm, co, NULL, BM_CREATE_NOP);
new_bmvs[v] = bmv;
BM_elem_flag_enable(bmv, KEEP_FLAG);
any_change = true;
}
}
/* Initially mark all existing faces as "don't keep", except hidden faces.
* Also, save current #BMFace pointers as creating faces will disturb the table. */
Array<BMFace *> old_bmfs(bm->totface);
for (int f = 0; f < bm->totface; ++f) {
BMFace *bmf = BM_face_at_index(bm, f);
old_bmfs[f] = bmf;
if (BM_elem_flag_test(bmf, BM_ELEM_HIDDEN)) {
BM_elem_flag_enable(bmf, KEEP_FLAG);
}
else {
BM_elem_flag_disable(bmf, KEEP_FLAG);
}
}
/* Save the original #BMEdge's so we can use them as examples. */
Array<BMEdge *> old_edges(bm->totedge);
std::copy(bm->etable, bm->etable + bm->totedge, old_edges.begin());
/* Reuse or make new #BMFace's, as the faces are identical to old ones or not.
* If reusing, mark them as "keep". First find the maximum face length
* so we can declare some arrays outside of the face-creating loop. */
int maxflen = 0;
for (const Face *f : m_out.faces()) {
maxflen = max_ii(maxflen, f->size());
}
Array<BMVert *> face_bmverts(maxflen);
Array<BMEdge *> face_bmedges(maxflen);
for (const Face *f : m_out.faces()) {
const Face &face = *f;
int flen = face.size();
for (int i = 0; i < flen; ++i) {
const Vert *v = face[i];
int v_index = m_out.lookup_vert(v);
BLI_assert(v_index < new_bmvs.size());
face_bmverts[i] = new_bmvs[v_index];
}
BMFace *bmf = BM_face_exists(face_bmverts.data(), flen);
/* #BM_face_exists checks if the face exists with the vertices in either order.
* We can only reuse the face if the orientations are the same. */
if (bmf != NULL && face_has_verts_in_order(bm, bmf, face_bmverts[0], face_bmverts[1])) {
BM_elem_flag_enable(bmf, KEEP_FLAG);
}
else {
int orig = face.orig;
BMFace *orig_face;
/* There should always be an orig face, but just being extra careful here. */
if (orig != NO_INDEX) {
orig_face = old_bmfs[orig];
}
else {
orig_face = NULL;
}
/* Make or find #BMEdge's. */
for (int i = 0; i < flen; ++i) {
BMVert *bmv1 = face_bmverts[i];
BMVert *bmv2 = face_bmverts[(i + 1) % flen];
BMEdge *bme = BM_edge_exists(bmv1, bmv2);
if (bme == NULL) {
BMEdge *orig_edge = NULL;
if (face.edge_orig[i] != NO_INDEX) {
orig_edge = old_edges[face.edge_orig[i]];
}
bme = BM_edge_create(bm, bmv1, bmv2, orig_edge, BM_CREATE_NOP);
if (orig_edge != NULL) {
BM_elem_select_copy(bm, bme, orig_edge);
}
}
face_bmedges[i] = bme;
if (face.is_intersect[i]) {
BM_elem_flag_enable(bme, BM_ELEM_TAG);
}
else {
BM_elem_flag_disable(bme, BM_ELEM_TAG);
}
}
BMFace *bmf = BM_face_create(
bm, face_bmverts.data(), face_bmedges.data(), flen, orig_face, BM_CREATE_NOP);
if (orig_face != NULL) {
BM_elem_select_copy(bm, bmf, orig_face);
}
BM_elem_flag_enable(bmf, KEEP_FLAG);
/* Now do interpolation of loop data (e.g., UV's) using the example face. */
if (orig_face != NULL) {
BMIter liter;
BMLoop *l = static_cast<BMLoop *>(BM_iter_new(&liter, bm, BM_LOOPS_OF_FACE, bmf));
while (l != NULL) {
BM_loop_interp_from_face(bm, l, orig_face, true, true);
l = static_cast<BMLoop *>(BM_iter_step(&liter));
}
}
any_change = true;
}
}
/* Now kill the unused faces and verts, and clear flags for kept ones. */
/* #BM_ITER_MESH_MUTABLE macro needs type casts for C++, so expand here.
* TODO(howard): make some nice C++ iterators for #BMesh. */
BMIter iter;
BMFace *bmf = static_cast<BMFace *>(BM_iter_new(&iter, bm, BM_FACES_OF_MESH, NULL));
while (bmf != NULL) {
# ifdef DEBUG
iter.count = BM_iter_mesh_count(BM_FACES_OF_MESH, bm);
# endif
BMFace *bmf_next = static_cast<BMFace *>(BM_iter_step(&iter));
if (BM_elem_flag_test(bmf, KEEP_FLAG)) {
BM_elem_flag_disable(bmf, KEEP_FLAG);
}
else {
BM_face_kill_loose(bm, bmf);
# if 0
BM_face_kill(bm, bmf);
# endif
any_change = true;
}
bmf = bmf_next;
}
BMVert *bmv = static_cast<BMVert *>(BM_iter_new(&iter, bm, BM_VERTS_OF_MESH, NULL));
while (bmv != NULL) {
# ifdef DEBUG
iter.count = BM_iter_mesh_count(BM_VERTS_OF_MESH, bm);
# endif
BMVert *bmv_next = static_cast<BMVert *>(BM_iter_step(&iter));
if (BM_elem_flag_test(bmv, KEEP_FLAG)) {
BM_elem_flag_disable(bmv, KEEP_FLAG);
}
else {
BM_vert_kill(bm, bmv);
any_change = true;
}
bmv = bmv_next;
}
return any_change;
}
static bool bmesh_boolean(BMesh *bm,
struct BMLoop *(*looptris)[3],
const int looptris_tot,
int (*test_fn)(BMFace *f, void *user_data),
void *user_data,
const bool use_self,
const bool use_separate_all,
const BoolOpType boolean_mode)
{
IMeshArena arena;
IMesh m_triangulated;
IMesh m_in = mesh_from_bm(bm, looptris, looptris_tot, &m_triangulated, &arena);
std::function<int(int)> shape_fn;
int nshapes;
if (use_self) {
/* Unary boolean operation. Want every face where test_fn doesn't return -1. */
nshapes = 1;
shape_fn = [bm, test_fn, user_data](int f) {
BMFace *bmf = BM_face_at_index(bm, f);
if (test_fn(bmf, user_data) != -1) {
return 0;
}
return -1;
};
}
else {
nshapes = 2;
shape_fn = [bm, test_fn, user_data](int f) {
BMFace *bmf = BM_face_at_index(bm, f);
int test_val = test_fn(bmf, user_data);
if (test_val == 0) {
return 0;
}
if (test_val == 1) {
return 1;
}
return -1;
};
}
IMesh m_out = boolean_mesh(
m_in, boolean_mode, nshapes, shape_fn, use_self, &m_triangulated, &arena);
bool any_change = apply_mesh_output_to_bmesh(bm, m_out);
if (use_separate_all) {
/* We are supposed to separate all faces that are incident on intersection edges. */
BM_mesh_edgesplit(bm, false, true, false);
}
return any_change;
}
#endif // WITH_GMP
} // namespace meshintersect
} // namespace blender
extern "C" {
/**
* Perform the boolean operation specified by boolean_mode on the mesh bm.
* The inputs to the boolean operation are either one sub-mesh (if use_self is true),
* or two sub-meshes. The sub-meshes are specified by providing a test_fn which takes
* a face and the supplied user_data and says with 'side' of the boolean operation
* that face is for: 0 for the first side (side A), 1 for the second side (side B),
* and -1 if the face is to be ignored completely in the boolean operation.
*
* If use_self is true, all operations do the same: the sub-mesh is self-intersected
* and all pieces inside that result are removed.
* Otherwise, the operations can be one of #BMESH_ISECT_BOOLEAN_ISECT, #BMESH_ISECT_BOOLEAN_UNION,
* or #BMESH_ISECT_BOOLEAN_DIFFERENCE.
*
* (The actual library function called to do the boolean is internally capable of handling
* n-ary operands, so maybe in the future we can expose that functionality to users.)
*/
#ifdef WITH_GMP
bool BM_mesh_boolean(BMesh *bm,
struct BMLoop *(*looptris)[3],
const int looptris_tot,
int (*test_fn)(BMFace *f, void *user_data),
void *user_data,
const bool use_self,
const int boolean_mode)
{
return blender::meshintersect::bmesh_boolean(
bm,
looptris,
looptris_tot,
test_fn,
user_data,
use_self,
false,
static_cast<blender::meshintersect::BoolOpType>(boolean_mode));
}
/**
* Perform a Knife Intersection operation on the mesh bm.
* There are either one or two operands, the same as described above for BM_mesh_boolean().
* If use_separate_all is true, each edge that is created from the intersection should
* be used to separate all its incident faces. TODO: implement that.
* TODO: need to ensure that "selected/non-selected" flag of original faces gets propagated
* to the intersection result faces.
*/
bool BM_mesh_boolean_knife(BMesh *bm,
struct BMLoop *(*looptris)[3],
const int looptris_tot,
int (*test_fn)(BMFace *f, void *user_data),
void *user_data,
const bool use_self,
const bool use_separate_all)
{
return blender::meshintersect::bmesh_boolean(bm,
looptris,
looptris_tot,
test_fn,
user_data,
use_self,
use_separate_all,
blender::meshintersect::BoolOpType::None);
}
#else
bool BM_mesh_boolean(BMesh *UNUSED(bm),
struct BMLoop *(*looptris)[3],
const int UNUSED(looptris_tot),
int (*test_fn)(BMFace *, void *),
void *UNUSED(user_data),
const bool UNUSED(use_self),
const int UNUSED(boolean_mode))
{
UNUSED_VARS(looptris, test_fn);
return false;
}
/**
* Perform a Knife Intersection operation on the mesh bm.
* There are either one or two operands, the same as described above for #BM_mesh_boolean().
* If use_separate_all is true, each edge that is created from the intersection should
* be used to separate all its incident faces. TODO: implement that.
* TODO: need to ensure that "selected/non-selected" flag of original faces gets propagated
* to the intersection result faces.
*/
bool BM_mesh_boolean_knife(BMesh *UNUSED(bm),
struct BMLoop *(*looptris)[3],
const int UNUSED(looptris_tot),
int (*test_fn)(BMFace *, void *),
void *UNUSED(user_data),
const bool UNUSED(use_self),
const bool UNUSED(use_separate_all))
{
UNUSED_VARS(looptris, test_fn);
return false;
}
#endif
} /* extern "C" */

View File

@@ -0,0 +1,45 @@
/*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
#pragma once
/** \file
* \ingroup bmesh
*/
#ifdef __cplusplus
extern "C" {
#endif
bool BM_mesh_boolean(BMesh *bm,
struct BMLoop *(*looptris)[3],
const int looptris_tot,
int (*test_fn)(BMFace *f, void *user_data),
void *user_data,
const bool use_self,
const int boolean_mode);
bool BM_mesh_boolean_knife(BMesh *bm,
struct BMLoop *(*looptris)[3],
const int looptris_tot,
int (*test_fn)(BMFace *f, void *user_data),
void *user_data,
const bool use_self,
const bool use_separate_all);
#ifdef __cplusplus
}
#endif

View File

@@ -117,7 +117,7 @@ static void bm_decim_build_quadrics(BMesh *bm, Quadric *vquadrics)
cross_v3_v3v3(edge_plane, edge_vector, f->no);
copy_v3db_v3fl(edge_plane_db, edge_plane);
if (normalize_v3_d(edge_plane_db) > (double)FLT_EPSILON) {
if (normalize_v3_db(edge_plane_db) > (double)FLT_EPSILON) {
Quadric q;
float center[3];

View File

@@ -20,7 +20,15 @@
* \ingroup bmesh
*/
#ifdef __cplusplus
extern "C" {
#endif
void BM_mesh_edgesplit(BMesh *bm,
const bool use_verts,
const bool tag_only,
const bool copy_select);
#ifdef __cplusplus
}
#endif

View File

@@ -93,6 +93,10 @@ if(WITH_BULLET)
add_definitions(-DWITH_BULLET)
endif()
if(WITH_GMP)
add_definitions(-DWITH_GMP)
endif()
add_definitions(${GL_DEFINITIONS})
blender_add_lib(bf_editor_mesh "${SRC}" "${INC}" "${INC_SYS}" "${LIB}")

View File

@@ -39,6 +39,9 @@
#include "WM_types.h"
#include "UI_interface.h"
#include "UI_resources.h"
#include "ED_mesh.h"
#include "ED_screen.h"
@@ -46,6 +49,7 @@
#include "mesh_intern.h" /* own include */
#include "tools/bmesh_boolean.h"
#include "tools/bmesh_intersect.h"
#include "tools/bmesh_separate.h"
@@ -134,6 +138,11 @@ enum {
ISECT_SEPARATE_NONE = 2,
};
enum {
ISECT_SOLVER_FAST = 0,
ISECT_SOLVER_EXACT = 1,
};
static int edbm_intersect_exec(bContext *C, wmOperator *op)
{
const int mode = RNA_enum_get(op->ptr, "mode");
@@ -142,6 +151,11 @@ static int edbm_intersect_exec(bContext *C, wmOperator *op)
bool use_separate_cut = false;
const int separate_mode = RNA_enum_get(op->ptr, "separate_mode");
const float eps = RNA_float_get(op->ptr, "threshold");
#ifdef WITH_GMP
const bool exact = RNA_enum_get(op->ptr, "solver") == ISECT_SOLVER_EXACT;
#else
const bool exact = false;
#endif
bool use_self;
bool has_isect;
@@ -186,19 +200,25 @@ static int edbm_intersect_exec(bContext *C, wmOperator *op)
continue;
}
has_isect = BM_mesh_intersect(em->bm,
em->looptris,
em->tottri,
test_fn,
NULL,
use_self,
use_separate_all,
true,
true,
true,
true,
-1,
eps);
if (exact) {
has_isect = BM_mesh_boolean_knife(
em->bm, em->looptris, em->tottri, test_fn, NULL, use_self, use_separate_all);
}
else {
has_isect = BM_mesh_intersect(em->bm,
em->looptris,
em->tottri,
test_fn,
NULL,
use_self,
use_separate_all,
true,
true,
true,
true,
-1,
eps);
}
if (use_separate_cut) {
/* detach selected/un-selected faces */
@@ -220,6 +240,38 @@ static int edbm_intersect_exec(bContext *C, wmOperator *op)
return OPERATOR_FINISHED;
}
static void edbm_intersect_ui(bContext *UNUSED(C), wmOperator *op)
{
uiLayout *layout = op->layout;
uiLayout *row;
PointerRNA ptr;
RNA_pointer_create(NULL, op->type->srna, op->properties, &ptr);
#ifdef WITH_GMP
bool use_exact = RNA_enum_get(&ptr, "solver") == ISECT_SOLVER_EXACT;
#else
bool use_exact = false;
#endif
uiLayoutSetPropSep(layout, true);
uiLayoutSetPropDecorate(layout, false);
row = uiLayoutRow(layout, false);
uiItemR(row, &ptr, "mode", UI_ITEM_R_EXPAND, NULL, ICON_NONE);
uiItemS(layout);
row = uiLayoutRow(layout, false);
uiItemR(row, &ptr, "separate_mode", UI_ITEM_R_EXPAND, NULL, ICON_NONE);
uiItemS(layout);
#ifdef WITH_GMP
row = uiLayoutRow(layout, false);
uiItemR(row, &ptr, "solver", UI_ITEM_R_EXPAND, NULL, ICON_NONE);
uiItemS(layout);
#endif
if (!use_exact) {
uiItemR(layout, &ptr, "threshold", 0, NULL, ICON_NONE);
}
}
void MESH_OT_intersect(struct wmOperatorType *ot)
{
static const EnumPropertyItem isect_mode_items[] = {
@@ -243,6 +295,12 @@ void MESH_OT_intersect(struct wmOperatorType *ot)
{0, NULL, 0, NULL, NULL},
};
static const EnumPropertyItem isect_intersect_solver_items[] = {
{ISECT_SOLVER_FAST, "FAST", 0, "Fast", "Faster Solver, some limitations"},
{ISECT_SOLVER_EXACT, "EXACT", 0, "Exact", "Exact Solver, slower, handles more cases"},
{0, NULL, 0, NULL, NULL},
};
/* identifiers */
ot->name = "Intersect (Knife)";
ot->description = "Cut an intersection into faces";
@@ -251,6 +309,7 @@ void MESH_OT_intersect(struct wmOperatorType *ot)
/* api callbacks */
ot->exec = edbm_intersect_exec;
ot->poll = ED_operator_editmesh;
ot->ui = edbm_intersect_ui;
/* props */
RNA_def_enum(ot->srna, "mode", isect_mode_items, ISECT_SEL_UNSEL, "Source", "");
@@ -258,6 +317,14 @@ void MESH_OT_intersect(struct wmOperatorType *ot)
ot->srna, "separate_mode", isect_separate_items, ISECT_SEPARATE_CUT, "Separate Mode", "");
RNA_def_float_distance(
ot->srna, "threshold", 0.000001f, 0.0, 0.01, "Merge threshold", "", 0.0, 0.001);
#ifdef WITH_GMP
RNA_def_enum(ot->srna,
"solver",
isect_intersect_solver_items,
ISECT_SOLVER_EXACT,
"Solver",
"Which Intersect solver to use");
#endif
/* flags */
ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
@@ -280,6 +347,12 @@ static int edbm_intersect_boolean_exec(bContext *C, wmOperator *op)
{
const int boolean_operation = RNA_enum_get(op->ptr, "operation");
bool use_swap = RNA_boolean_get(op->ptr, "use_swap");
bool use_self = RNA_boolean_get(op->ptr, "use_self");
#ifdef WITH_GMP
bool use_exact = RNA_enum_get(op->ptr, "solver") == ISECT_SOLVER_EXACT;
#else
bool use_exact = false;
#endif
const float eps = RNA_float_get(op->ptr, "threshold");
int (*test_fn)(BMFace *, void *);
bool has_isect;
@@ -298,19 +371,25 @@ static int edbm_intersect_boolean_exec(bContext *C, wmOperator *op)
continue;
}
has_isect = BM_mesh_intersect(em->bm,
em->looptris,
em->tottri,
test_fn,
NULL,
false,
false,
true,
true,
false,
true,
boolean_operation,
eps);
if (use_exact) {
has_isect = BM_mesh_boolean(
em->bm, em->looptris, em->tottri, test_fn, NULL, use_self, boolean_operation);
}
else {
has_isect = BM_mesh_intersect(em->bm,
em->looptris,
em->tottri,
test_fn,
NULL,
false,
false,
true,
true,
false,
true,
boolean_operation,
eps);
}
edbm_intersect_select(em, obedit->data, has_isect);
@@ -326,6 +405,38 @@ static int edbm_intersect_boolean_exec(bContext *C, wmOperator *op)
return OPERATOR_FINISHED;
}
static void edbm_intersect_boolean_ui(bContext *UNUSED(C), wmOperator *op)
{
uiLayout *layout = op->layout;
uiLayout *row;
PointerRNA ptr;
RNA_pointer_create(NULL, op->type->srna, op->properties, &ptr);
#ifdef WITH_GMP
bool use_exact = RNA_enum_get(&ptr, "solver") == ISECT_SOLVER_EXACT;
#else
bool use_exact = false;
#endif
uiLayoutSetPropSep(layout, true);
uiLayoutSetPropDecorate(layout, false);
row = uiLayoutRow(layout, false);
uiItemR(row, &ptr, "operation", UI_ITEM_R_EXPAND, NULL, ICON_NONE);
uiItemS(layout);
#ifdef WITH_GMP
row = uiLayoutRow(layout, false);
uiItemR(row, &ptr, "solver", UI_ITEM_R_EXPAND, NULL, ICON_NONE);
uiItemS(layout);
#endif
uiItemR(layout, &ptr, "use_swap", 0, NULL, ICON_NONE);
uiItemR(layout, &ptr, "use_self", 0, NULL, ICON_NONE);
if (!use_exact) {
uiItemR(layout, &ptr, "threshold", 0, NULL, ICON_NONE);
}
}
void MESH_OT_intersect_boolean(struct wmOperatorType *ot)
{
static const EnumPropertyItem isect_boolean_operation_items[] = {
@@ -334,6 +445,11 @@ void MESH_OT_intersect_boolean(struct wmOperatorType *ot)
{BMESH_ISECT_BOOLEAN_DIFFERENCE, "DIFFERENCE", 0, "Difference", ""},
{0, NULL, 0, NULL, NULL},
};
static const EnumPropertyItem isect_boolean_solver_items[] = {
{ISECT_SOLVER_FAST, "FAST", 0, "Fast", "Faster Solver, some limitations"},
{ISECT_SOLVER_EXACT, "EXACT", 0, "Exact", "Exact Solver, slower, handles more cases"},
{0, NULL, 0, NULL, NULL},
};
/* identifiers */
ot->name = "Intersect (Boolean)";
@@ -343,21 +459,31 @@ void MESH_OT_intersect_boolean(struct wmOperatorType *ot)
/* api callbacks */
ot->exec = edbm_intersect_boolean_exec;
ot->poll = ED_operator_editmesh;
ot->ui = edbm_intersect_boolean_ui;
/* props */
RNA_def_enum(ot->srna,
"operation",
isect_boolean_operation_items,
BMESH_ISECT_BOOLEAN_DIFFERENCE,
"Boolean",
"");
"Boolean operation",
"Which boolean operation to apply");
RNA_def_boolean(ot->srna,
"use_swap",
false,
"Swap",
"Use with difference intersection to swap which side is kept");
RNA_def_boolean(ot->srna, "use_self", false, "Self", "Do self-union or self-intersection");
RNA_def_float_distance(
ot->srna, "threshold", 0.000001f, 0.0, 0.01, "Merge threshold", "", 0.0, 0.001);
#ifdef WITH_GMP
RNA_def_enum(ot->srna,
"solver",
isect_boolean_solver_items,
ISECT_SOLVER_EXACT,
"Solver",
"Which Boolean solver to use");
#endif
/* flags */
ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;

View File

@@ -862,7 +862,8 @@ typedef struct BooleanModifierData {
struct Object *object;
char operation;
char _pad[2];
char solver;
char _pad[1];
char bm_flag;
float double_threshold;
} BooleanModifierData;
@@ -873,7 +874,12 @@ typedef enum {
eBooleanModifierOp_Difference = 2,
} BooleanModifierOp;
/* bm_flag (only used when G_DEBUG) */
typedef enum {
eBooleanModifierSolver_Fast = 0,
eBooleanModifierSolver_Exact = 1,
} BooleanModifierSolver;
/* bm_flag only used when G_DEBUG. */
enum {
eBooleanModifierBMeshFlag_BMesh_Separate = (1 << 0),
eBooleanModifierBMeshFlag_BMesh_NoDissolve = (1 << 1),

View File

@@ -352,6 +352,10 @@ if(WITH_XR_OPENXR)
add_definitions(-DWITH_XR_OPENXR)
endif()
if(WITH_GMP)
add_definitions(-DWITH_GMP)
endif()
# Build makesrna executable
blender_include_dirs(
.

View File

@@ -2819,6 +2819,16 @@ static void rna_def_modifier_boolean(BlenderRNA *brna)
{0, NULL, 0, NULL, NULL},
};
static const EnumPropertyItem prop_solver_items[] = {
{eBooleanModifierSolver_Fast,
"FAST",
0,
"Fast",
"Simple solver for the best performance, without support for overlapping geometry"},
{eBooleanModifierSolver_Exact, "EXACT", 0, "Exact", "Advanced solver for the best result"},
{0, NULL, 0, NULL, NULL},
};
srna = RNA_def_struct(brna, "BooleanModifier", "Modifier");
RNA_def_struct_ui_text(srna, "Boolean Modifier", "Boolean operations modifier");
RNA_def_struct_sdna(srna, "BooleanModifierData");
@@ -2847,6 +2857,12 @@ static void rna_def_modifier_boolean(BlenderRNA *brna)
prop, "Overlap Threshold", "Threshold for checking overlapping geometry");
RNA_def_property_update(prop, 0, "rna_Modifier_update");
prop = RNA_def_property(srna, "solver", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_items(prop, prop_solver_items);
RNA_def_property_enum_default(prop, eBooleanModifierSolver_Exact);
RNA_def_property_ui_text(prop, "Solver", "Method for calculating booleans");
RNA_def_property_update(prop, 0, "rna_Modifier_update");
/* BMesh debugging options, only used when G_DEBUG is set */
/* BMesh intersection options */

View File

@@ -171,6 +171,10 @@ if(WITH_CYCLES)
add_definitions(-DWITH_CYCLES)
endif()
if(WITH_GMP)
add_definitions(-DWITH_GMP)
endif()
# So we can have special tricks in modifier system.
add_definitions(${GL_DEFINITIONS})

View File

@@ -62,6 +62,7 @@
#include "bmesh.h"
#include "bmesh_tools.h"
#include "tools/bmesh_boolean.h"
#include "tools/bmesh_intersect.h"
#ifdef DEBUG_TIME
@@ -75,6 +76,11 @@ static void initData(ModifierData *md)
bmd->double_threshold = 1e-6f;
bmd->operation = eBooleanModifierOp_Difference;
#ifdef WITH_GMP
bmd->solver = eBooleanModifierSolver_Exact;
#else
bmd->solver = eBooleanModifierSolver_Fast;
#endif
}
static bool isDisabled(const struct Scene *UNUSED(scene),
@@ -315,19 +321,30 @@ static Mesh *modifyMesh(ModifierData *md, const ModifierEvalContext *ctx, Mesh *
0;
}
BM_mesh_intersect(bm,
looptris,
tottri,
bm_face_isect_pair,
NULL,
false,
use_separate,
use_dissolve,
use_island_connect,
false,
false,
bmd->operation,
bmd->double_threshold);
#ifdef WITH_GMP
bool use_exact = bmd->solver == eBooleanModifierSolver_Exact;
#else
bool use_exact = false;
#endif
if (use_exact) {
BM_mesh_boolean(bm, looptris, tottri, bm_face_isect_pair, NULL, false, bmd->operation);
}
else {
BM_mesh_intersect(bm,
looptris,
tottri,
bm_face_isect_pair,
NULL,
false,
use_separate,
use_dissolve,
use_island_connect,
false,
false,
bmd->operation,
bmd->double_threshold);
}
MEM_freeN(looptris);
}
@@ -374,7 +391,18 @@ static void panel_draw(const bContext *C, Panel *panel)
uiLayoutSetPropSep(layout, true);
uiItemR(layout, &ptr, "object", 0, NULL, ICON_NONE);
uiItemR(layout, &ptr, "double_threshold", 0, NULL, ICON_NONE);
#ifdef WITH_GMP
bool use_exact = RNA_enum_get(&ptr, "solver") == eBooleanModifierSolver_Exact;
#else
bool use_exact = false;
#endif
if (!use_exact) {
uiItemR(layout, &ptr, "double_threshold", 0, NULL, ICON_NONE);
}
#ifdef WITH_GMP
uiItemR(layout, &ptr, "solver", UI_ITEM_R_EXPAND, NULL, ICON_NONE);
#endif
if (G.debug) {
uiLayout *col = uiLayoutColumn(layout, true);
@@ -394,7 +422,7 @@ ModifierTypeInfo modifierType_Boolean = {
/* structName */ "BooleanModifierData",
/* structSize */ sizeof(BooleanModifierData),
/* type */ eModifierTypeType_Nonconstructive,
/* flags */ eModifierTypeFlag_AcceptsMesh,
/* flags */ eModifierTypeFlag_AcceptsMesh | eModifierTypeFlag_SupportsEditmode,
/* copyData */ BKE_modifier_copydata_generic,

View File

@@ -64,4 +64,8 @@ if(WITH_FREESTYLE)
add_definitions(-DWITH_FREESTYLE)
endif()
if(WITH_GMP)
add_definitions(-DWITH_GMP)
endif()
blender_add_lib(bf_python_bmesh "${SRC}" "${INC}" "${INC_SYS}" "${LIB}")

View File

@@ -1639,7 +1639,6 @@ static PyObject *M_Geometry_delaunay_2d_cdt(PyObject *UNUSED(self), PyObject *ar
in.faces_start_table = in_faces_start_table;
in.faces_len_table = in_faces_len_table;
in.epsilon = epsilon;
in.skip_input_modify = false;
res = BLI_delaunay_2d_cdt_calc(&in, output_type);

View File

@@ -115,6 +115,10 @@ if(WITH_XR_OPENXR)
add_definitions(-DWITH_XR_OPENXR)
endif()
if(WITH_GMP)
add_definitions(-DWITH_GMP)
endif()
# Setup the exe sources and buildinfo
set(SRC
creator.c

View File

@@ -154,13 +154,13 @@ add_blender_test(
--run-all-tests
)
add_blender_test(
bmesh_boolean
${TEST_SRC_DIR}/modeling/bool_regression.blend
--python ${TEST_PYTHON_DIR}/boolean_operator.py
--
--run-all-tests
)
# add_blender_test(
# bmesh_boolean
# ${TEST_SRC_DIR}/modeling/bool_regression.blend
# --python ${TEST_PYTHON_DIR}/boolean_operator.py
# --
# --run-all-tests
#)
add_blender_test(
bmesh_split_faces
@@ -176,13 +176,13 @@ add_blender_test(
--python-text run_tests.py
)
add_blender_test(
modifiers
${TEST_SRC_DIR}/modeling/modifiers.blend
--python ${TEST_PYTHON_DIR}/modifiers.py
--
--run-all-tests
)
#add_blender_test(
# modifiers
# ${TEST_SRC_DIR}/modeling/modifiers.blend
# --python ${TEST_PYTHON_DIR}/modifiers.py
# --
# --run-all-tests
#)
add_blender_test(
physics_cloth