Commit Graph

98003 Commits

Author SHA1 Message Date
Jacques Lucke aa8279648e Simulation: extract node tree parsing code to separate file 2020-07-17 21:20:51 +02:00
Jacques Lucke 25582aef61 Simulation: separate code from node tree parsing and solver 2020-07-17 21:20:51 +02:00
Hans Goudey 69d14c0ddb 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
2020-07-17 15:18:54 -04:00
Germano Cavalcante 8b0df381d9 Transform: use GHASH_ITER when restoring customdata 2020-07-17 14:33:40 -03:00
Sybren A. Stüvel d8a6eec1a3 Cleanup: Removed incorrect `// namespace DEG` comment
No functional changes.
2020-07-17 16:49:00 +02:00
Sebastián Barschkis 893eb30730 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.
2020-07-17 16:11:21 +02:00
Sebastián Barschkis 0cdc75ccd2 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.
2020-07-17 15:58:13 +02:00
Jacques Lucke e3f8768d8a Refactor: move ParticleFunction to separate file 2020-07-17 14:23:57 +02:00
Jacques Lucke 2679236047 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.
2020-07-17 14:15:06 +02:00
Jacques Lucke 3ef59121a4 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.
2020-07-17 13:49:18 +02:00
Jeroen Bakker 9582797d4b 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
2020-07-17 13:47:53 +02:00
Ankit Meel bf2bb6db26 Cleanup: silence unused variable warning
Reviewed By: fclem

Differential Revision: https://developer.blender.org/D8328
2020-07-17 17:12:46 +05:30
Jacques Lucke 0e3d34e48f 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.
2020-07-17 12:38:15 +02:00
Jacques Lucke 0fcd23a388 Simulation: use better api for adding and removing simulation states 2020-07-17 12:36:23 +02:00
Sybren A. Stüvel c5f61fbf48 Cleanup: avoid warning about redundant access specifier
No functional changes.
2020-07-17 11:49:51 +02:00
Jacques Lucke 5910dbdbf7 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.
2020-07-17 11:36:59 +02:00
Campbell Barton 0a40c671b0 Cleanup: consistent ordering for scene argument to UV functions 2020-07-17 17:39:47 +10:00
Campbell Barton 83e204702d Cleanup: remove f-string use in favor of percentage for formatting 2020-07-17 17:39:47 +10:00
Campbell Barton 618f31312c Fix vertex selection error from recent refactor
Temporary fix for regression in 8084b7e6e2.
2020-07-17 17:37:35 +10:00
Jeroen Bakker 89a7a1c156 Cleanup: extract draw cache sanity checks to own function 2020-07-17 08:31:03 +02:00
Hans Goudey 608d9b5aa1 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
2020-07-16 14:07:47 -04:00
Jacques Lucke b13bbb22e4 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.
2020-07-16 19:52:28 +02:00
Jacques Lucke 02a3720000 Simulation: rename bf_physics to bf_simulation
Also see {rB9363c4de0635394548fa2eb8d205581313029775}.
2020-07-16 18:49:59 +02:00
Sebastián Barschkis 93f21ebb13 Fluid: Update Mantaflow source files
Includes cleanup that resolves a -Wunused-but-set-variable warning.
2020-07-16 18:04:44 +02:00
Sybren A. Stüvel e7c1a32a78 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.
2020-07-16 17:38:29 +02:00
Sybren A. Stüvel a138bf57c9 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
2020-07-16 17:38:29 +02:00
Francesco Siddi 09a483a3aa macOS: improve design of .dmg background
Differential Revision: https://developer.blender.org/D8300
2020-07-16 17:28:27 +02:00
Clément Foucault 671c6d8afd 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.
2020-07-16 18:01:44 +02:00
Clément Foucault 07d70a76df Cleanup: WM: Use GPUTexture API instead of raw ogl calls 2020-07-16 18:01:44 +02:00
Clément Foucault 5099cbeec9 Cleanup: GPU: Move depth/color masks functions to GPU_state 2020-07-16 18:01:44 +02:00
Clément Foucault 436d38bb54 Cleanup: GPU: Move XOR logic op to gpu_state.c 2020-07-16 18:01:44 +02:00
Clément Foucault 3481f6eaf2 Cleanup: GPU: Remove GL_DITHER usage 2020-07-16 18:01:44 +02:00
Clément Foucault 71ac137662 Cleanup: GPU: Move quad buffer stereo check to GPU module 2020-07-16 18:01:44 +02:00
Clément Foucault 8084b7e6e2 Cleanup: GPU: Replace all glReadPixels by GPU equivalent 2020-07-16 18:01:44 +02:00
Clément Foucault ab19abe223 Cleanup: Port glClear calls to GPU module functions 2020-07-16 18:01:44 +02:00
Clément Foucault bc85081156 Cleanup: DRW: remove uneeded double bind
Now that binds are permanent there is no need to setup the same
texture for each subgroups.
2020-07-16 18:01:44 +02:00
Jacques Lucke 56b8adb9e2 Particles: avoid crash when connected unimplemented node 2020-07-16 16:43:42 +02:00
Jacques Lucke 1494ad20b9 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.
2020-07-16 16:43:42 +02:00
Jacques Lucke 76bf050853 Particles: simplify adding new implicit conversions between sockets 2020-07-16 16:43:42 +02:00
Sebastián Barschkis aa547ce88b 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.
2020-07-16 16:39:49 +02:00
Jacques Lucke f64710a518 Particles: change initial velocity of particles
This is only temporary, but makes testing the system a bit easier.
2020-07-16 16:09:19 +02:00
Jacques Lucke 4249d6f58e Particles: support Separate/Combine RGB nodes 2020-07-16 16:09:19 +02:00
Jacques Lucke ada173ebfd Particles: simplify Combine XYZ node 2020-07-16 16:09:19 +02:00
Jacques Lucke 72df7c23c4 Particles: support Color Ramp node 2020-07-16 16:09:19 +02:00
Brecht Van Lommel c7aa0f9d74 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
2020-07-16 15:50:43 +02:00
Campbell Barton 279cc34343 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.
2020-07-16 23:48:38 +10:00
Jacques Lucke 83955d6769 Particles: support Map Range node
Only linear interpolation mode is supported for now.
2020-07-16 13:26:20 +02:00
Ray Molenkamp 99fda4d31e deps builder: Fix typo in windows harvesting 2020-07-16 07:22:52 -06:00
Jacques Lucke 9b6088cb9d 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.
2020-07-16 14:37:21 +02:00
Jacques Lucke 9363c4de06 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.
2020-07-16 14:28:38 +02:00