Commit Graph

108824 Commits

Author SHA1 Message Date
Sergey Sharybin
88dd0be6fa Cleanup: Strict compiler warning about capturing constexpr value
Resolves the following error when compiling with Apple Clang:

```
lambda capture 'thickness_adjustement_factor' is not required to be captured for this use [-Wunused-lambda-capture]
```

Pull Request: https://projects.blender.org/blender/blender/pulls/121012
2024-04-24 17:35:39 +02:00
Hans Goudey
b3ecfcd77d Node Tools: Avoid depsgraph evaluation when possible
Currently for node tools we create and evaluate a temporary depsgraph
with all the selected object data-blocks and all data-blocks referenced
by the node tree.

Needless to say, this can be very slow when those data-blocks contain
arbitrary procedural operations. Re-evaluating all the selected objects
is particularly because it will give a slowdown even in very basic uses
of node tools.

Originally I hoped that geometry nodes could be made to work with
original as well as evaluated data-blocks. But that would require far
too many tricky changes and arguably isn't right design-wise anyway.
Instead of that, this commit makes node tools dependency graph
evaluation more fine-grained in a few ways.

1. Remove the evaluation of selected objects. These are always visible
   in the viewport and part of the active depsgraph anyway. To protect
   against cyclic dependencies, we now compare `orig_id` instead of the
   object pointer itself.
2. Evaluate the node group and its dependencies in a separate depsgraph
   used only when necessary. This allows using the original node tree
   without any copies when it doesn't reference any data-blocks.
3. Evaluate IDs from node group inputs (from the redo panel) in the extra
   depsgraph as well, only when necessary.

Pull Request: https://projects.blender.org/blender/blender/pulls/120723
2024-04-24 17:08:25 +02:00
Clément Foucault
e725cc3494 Fix: EEVEE-Next: Shadow: Casters behind area lights cast shadow
This introduces fragment clipping for the shadow pipeline.

The fragments are culled using a sphere distance test
for sphere lights, which is then re-purposed as a simple
distance test for area lights.

However, in the case of area lights, this introduces some
light bleeding. To mitigate this, we bring the shadow origin
back towards the light center so that this artifact only
appears if using larger shadow tracing.

Fixes #119334

Pull Request: https://projects.blender.org/blender/blender/pulls/120992
2024-04-24 17:08:12 +02:00
Clément Foucault
b8e17cf531 Fix: EEVEE-Next: Missing fluid volume domain rendering
This was an oversight in the implementation of the new
volume drw API. Now fill up dummy attributes and allow
rendering of the fluid domains.
2024-04-24 17:06:55 +02:00
Clément Foucault
41036348bc Fix: EEVEE-Next: Missing resource bind for volume lighting 2024-04-24 17:06:55 +02:00
Iliya Katueshenock
8e830a95de Nodes: Add default socket value to tooltip of socket
Even if node is not used, socket value is still there.
This value can be placed in tooltip instead of evaluated one.

Pull Request: https://projects.blender.org/blender/blender/pulls/120497
2024-04-24 17:03:55 +02:00
Brecht Van Lommel
15b9ae5436 Refactor: Use typed functions for blend file data reading
This makes the read and write API functions match more closely, and adds
asserts to check that the data size is as expected.

There are still a few places remaining that use BLO_read_data_address
and similar generic functions, these should eventually be replaced as well.

Pull Request: https://projects.blender.org/blender/blender/pulls/120994
2024-04-24 17:01:22 +02:00
Ray Molenkamp
d2be9cecc2 Cleanup: Make Format 2024-04-24 08:42:16 -06:00
Clément Foucault
a2becaead3 Fix: EEVEE-Next: Missing resource bind for opaque tagging
Introduced by #120965
2024-04-24 16:25:16 +02:00
Ben-7
0136289cb6 CMake: Windows: clang-cl fixes
Support for building blender with clang on windows on x64 was added
years ago but given there are no active users support has crumbled a
bit.

This PR brings the build system back into working order but upstream
patches in openVDB are still required for a successful build see PR
#120317 for details.

Blender when build with clang the classroom scenes rendered on the cpu
with cycles is seeing a 5% reduction in render time on both an
AMD 7700x and an Intel 14900k.
2024-04-24 15:59:47 +02:00
Hans Goudey
3cd1c365c3 Geometry Nodes: Add Project point matrix node
With the matrix socket being introduced into geometry nodes, we
are starting to deal with more complex transforms like perspective
projection. For those matrices projecting a point is not as simple
as just matrix multiplication, there has to be an additional normalization
step after. To solve that in an intuitive way consistent with how it's
typically solved in code, add a new "Project Point" node.

The canonical use case for now is in combination with the mouse
position, viewport transform, and raycast nodes, to find where the
mouse clicked on the edited geometry.

Pull Request: https://projects.blender.org/blender/blender/pulls/120597
2024-04-24 15:56:33 +02:00
Lukas Tönne
3fac9df65f Fix #113925: GPv3: eval_frame needs to be updated for modifier result
Grease pencil runtime data stores the "current" frame in the
`eval_frame` property. This is updated before modifier evaluation, but
also used after modifiers, e.g. by the spreadsheet.

If the GeometrySet that is returned by the nodes modifier is created
during the nodes evaluation (as is the case with the Delete node) then
the resulting geometry set has `eval_frame == 0`. To fix this the
`eval_frame` is now also update _after_ modifier evaluation.

This will only set the correct `eval_frame` for the __top level__
geometry set. Other GeometrySets like instances may not have the correct
frame value. This is a more general problem with the design that is out
of scope here.

Pull Request: https://projects.blender.org/blender/blender/pulls/121022
2024-04-24 15:31:30 +02:00
Sean Kim
fd9de3ff7e Cleanup: Fix function comments in BKE_mesh.hh
This PR fixes the `mesh_select_*_flush` comments.

Pull Request: https://projects.blender.org/blender/blender/pulls/121000
2024-04-24 14:26:47 +02:00
Hans Goudey
ab3f05d3ec Cleanup: Move sculpt_transform.cc to C++ namespace 2024-04-24 08:19:57 -04:00
Lukas Tönne
bc9ebd72d9 Fix #120926: GPv3: Separate operator crashing because of missing layer
The Separate operator uses the ubiquitous `gather_attributes` function
to fill in attributes of layers. However, it only makes sure the layer
exists _after_ calling `gather_attributes`, which crashes if the layer
does not already exist.

Pull Request: https://projects.blender.org/blender/blender/pulls/121013
2024-04-24 14:08:41 +02:00
Hans Goudey
9193f4554c Cleanup: Move more PBVH API functions to C++ namespace 2024-04-24 07:54:22 -04:00
Hans Goudey
a4073563c8 Cleanup: Use references for sculpt undo and restore functions 2024-04-24 07:54:21 -04:00
Hans Goudey
60c0954edf Cleanup: Remove unnecessarily specific assert message 2024-04-24 07:54:21 -04:00
Hans Goudey
e4ec7c3345 Cleanup: Move more code in sculpt.cc to C++ namespace 2024-04-24 07:54:21 -04:00
Hans Goudey
cd7e67cedb Cleanup: Improve sculpt restore function name 2024-04-24 07:54:21 -04:00
Hans Goudey
78ff13eb7b Sculpt: Specialize brush position restore
Remove another use of the `BKE_pbvh_vertex_iter_begin` macro
and significantly simplify hot loops used when cancelling a brush
stroke or calculating an anchored stroke.
2024-04-24 07:54:21 -04:00
Hans Goudey
28f2383477 Sculpt: Simplify code paths for brush restore
Avoid mixing different abstraction levels, remove the conversion
of the brush tool into `undo::Type`. Make it simpler to specialize
the implementation further for separate PBVH types later.

Also fix race condition retrieving write access to an attribute from
multiple threads at the same time, and reduce per-PBVH-node
overhead.
2024-04-24 07:54:21 -04:00
Hans Goudey
d374253b7a Cleanup: Use const object and node pointers for sculpt undo push 2024-04-24 07:54:21 -04:00
Hans Goudey
577a7fdd91 Cleanup: Inline expand update flush function
No need to duplicate the switch here.
2024-04-24 07:54:21 -04:00
Hans Goudey
adf4331c8b Fix #120934: Sculpt expand cancel broken with multires
Basically the same as 7d2d590f0e
2024-04-24 07:54:21 -04:00
Pratik Borhade
3f1591394a Fix: memory leak in alloc_proxy_output_ffmpeg
Possible memory leak of `rv` due to early return without freeing the
allocated memory.
Part of #120767

Pull Request: https://projects.blender.org/blender/blender/pulls/121007
2024-04-24 12:56:17 +02:00
Aras Pranckevicius
c64050ecd2 VSE: Timeline strip visual design updates
Design updates as per #118288:
- Tweak text labels (colors, drop shadows)
- Strip border colors, inset outlines
- Muted strips are mostly gray, and their thumbnails are faded
- Overlapping strips are not semitransparent anymore
- Locked stripes only in content area
- Missing data blocks
- Updates to meta strips w/ missing data blocks

Pull Request: https://projects.blender.org/blender/blender/pulls/118581
2024-04-24 12:37:38 +02:00
Campbell Barton
848571ff01 Cleanup: initialize USDExportParams::worker_status
worker_status was left uninitialized in some cases,
while this doesn't seem to cause an error - initialize
to null to prevent errors in the future.
2024-04-24 19:58:51 +10:00
Lukas Tönne
11bfac7f11 Fix #120698: GPv3: Don't move the first stroke point
There are two ways the first stroke point is moved after initial
placement:
- The `process_extension_sample` overwrites the initial values of the
  sample point after `process_start_sample`. It copies the _new_ sample
  position, until a threshold (3 pixels) is reached and the 2nd point
  is created, and the 1st point remains stationary.
- After initial placement the point may still get shifted due to the
  resampling and interpolation used. Long sections between stroke
  samples may get subdivided and the positions of the two samples are
  linearly interpolated. However, the interpolation starts at 1/n,
  meaning the first interpolated point never matches the first sample.
  This is correct for later samples where the last point should not be
  repeated, but it ends up moving the first curve point again when the
  2nd sample is processed.

This patch fixes both issues by keeping the first generated point
stationary and never touching its position again.

Pull Request: https://projects.blender.org/blender/blender/pulls/121011
2024-04-24 11:54:01 +02:00
Clément Foucault
2056b4b563 Fix: EEVEE-Next: Broken uniform attribute in blended materials
Was caused by difference in header order for forward materials.
Fix by adding the missing include in the nodetree lib directly.

Fix #117277
2024-04-24 11:31:39 +02:00
Clément Foucault
6d347dd5ca Fix: EEVEE-Next: Point cloud macro coliding with voronoi texture
Was caused by macro declaration. Remove the macro
and add another `#if` case for EEVEE-next instead.

Fix #115438
2024-04-24 09:38:32 +02:00
YimingWu
01b7cb88ef Fix #120862: Add eps arguments to points_in_planes
The usage for `points_in_planes` might require different epsilons set
for parallel/intersection determination. This adds those epsilon values
to the bpy function so it benefits script users.

Pull Request: https://projects.blender.org/blender/blender/pulls/120910
2024-04-24 09:38:20 +02:00
Campbell Barton
7f2c0311fc Cleanup: fully initialize timeline_draw_context_get's return value
timeline_draw_context_get relied on the caller assigning "quads",
since setting the value is required, pass in "quads" as an argument.
2024-04-24 16:33:54 +10:00
Campbell Barton
7f7e276e4d Fix sculpt "Set Pivot Position" activating immediately from the menu 2024-04-24 14:05:53 +10:00
Campbell Barton
7fbf09e1e5 Theme: don't store the filepath in the presets 2024-04-24 13:37:24 +10:00
Campbell Barton
1865776767 Cleanup: doxygen syntax, use colons after "param" arguments, not "note" 2024-04-24 10:55:44 +10:00
Campbell Barton
019d3ef939 Cleanup: spelling in comments 2024-04-24 10:48:45 +10:00
Campbell Barton
679e54737f Cleanup: avoid redundant smooth calculation in grid-fill
Meshes without any selected edges had their default smooth state
calculated which involves looping over all edges.
2024-04-24 10:36:05 +10:00
Campbell Barton
75eea50253 Fix operator flag overlap between OP_IS_REPEAT & OP_IS_REPEAT_LAST
Both flags shared the same value, causing repeating a transform action
always recalculate the orientation matrix instead of using the value
from the initial execution. This is most noticeable when repeating a
transform that used a view matrix, where orbiting the view doesn't
use the view orientation from the original transform.
2024-04-24 10:32:23 +10:00
Clément Foucault
ce768d43a1 MTL: Increase log level to errors for missing texture binds
This avoid missing them as they are true user level errors.
2024-04-23 23:08:19 +02:00
Jesse Yurkovich
d208ce84b7 Cleanup: USD curves writer
Cleans up the following issues:
- USD arrays were passed by value instead of references
- UsdGeomBasisCurves and UsdGeomNurbsCurves were potentially sliced when
  assigning to their parent UsdGeomCurves object in a non-polymorphic way
- Make more parameters and functions const
- Align with how Alembic validates the curve_types and cyclic values
- Standarize CurvesGeometry naming like what was done in 5ed9c8c9dd
  (Curves data-block is called "curve_id", CurvesGeometry is called
  "curves")

Pull Request: https://projects.blender.org/blender/blender/pulls/120760
2024-04-23 23:01:46 +02:00
Clément Foucault
5611cafe5e Fix: EEVEE-Next: Different shading in forward pipeline
This was due to using a different normal than the deferred
pipeline for light facing attenuation.

Use the same heuristic as the deferred pipeline for
consistency and smoother look.

Fix #119750
2024-04-23 22:30:05 +02:00
Clément Foucault
71745416b8 EEVEE-Next: UI: Rename material Raytraced Refraction to Transmission
This is more correct as it affects all transmission BSDFs.
2024-04-23 22:17:50 +02:00
Clément Foucault
3e9796c7c3 EEVEE-Next: Light-Probe: Make volume probe display relative
This avoid overlap of data spheres when density changes.
2024-04-23 21:47:31 +02:00
Clément Foucault
0023d850e3 EEVEE-Next: Light-Probe: Make sphere probe display reflective
This was the previous behavior in legacy EEVEE.
2024-04-23 21:32:22 +02:00
Clément Foucault
3799920dc1 EEVEE-Next: Light-Probe: Make sphere probe display size relative
The display is now relative to the size of the probe. This avoid
display being too small or too big after re-sizing.
2024-04-23 21:32:22 +02:00
Jesse Yurkovich
37cc387fcb USD: Correctly write out and read Mesh velocity data
During Export, we were accidentally duplicating the `velocity` attribute
data. Once inside the `write_surface_velocity` function (which was
correct) and again while writing out all "custom" attributes inside
`write_custom_data` (which was incorrect). Fixed by excluding the
"velocity" attribute inside `write_custom_data`.

During Import, we were only loading back in those "custom" primvars so
things happened to work, by accident, but only for USD files produced by
Blender. Now we import just the Velocities attribute which should work
with all files.

This should fully address #96182

Pull Request: https://projects.blender.org/blender/blender/pulls/120771
2024-04-23 20:44:33 +02:00
Clément Foucault
dc20def2f9 Fix: EEVEE-Next: Lightprobe: Avoid division by zero
The normalization factor can divide by zero. Add a small
bias to avoid this. Since the bias is the same on both
the numerator and the denominator, the result converges
to 1 as the denominator reaches zero.

This also adds a `saturate` to avoid lighting being
weirdly increase in some part of the volume probe.

Fix #119799
2024-04-23 20:27:28 +02:00
Brecht Van Lommel
29c3997c28 Fix: Crash reading some particular old blend files 2024-04-23 19:52:20 +02:00
Hans Goudey
7dad324845 Fix: Lite build error after recent commit
Mistake in 0c3763ddda
2024-04-23 13:49:30 -04:00