Commit Graph

120055 Commits

Author SHA1 Message Date
Jacques Lucke
de7ea7e60d Fix: don't allow zero bandwidth in sdf grid
Setting the bandwidth to zero caused a crash.
2024-04-25 12:13:11 +02:00
Christoph Lendenfeld
dafcb353b8 Fix #120950: Graph Editor curve drawing artifacts with normalized display
The drawing code in the Graph Editor reduces the points drawn by checking the pixel distance.
The calculation for the pixel distance didn't take the normalization into account though, so
in certain scenarios points would be skipped that shouldn't be skipped.

The fix is to pass the normalization factor into the pixel distance calculation.

Pull Request: https://projects.blender.org/blender/blender/pulls/121070
2024-04-25 11:50:55 +02:00
Jacques Lucke
3f2c4db951 Curves: support more curve type conversion options in edit mode
This adds a new `Handles` checkbox to the conversion operator that
affects how the conversion works in the following cases:
`Bezier -> Catmull Rom / Poly / Nurbs` and `Catmull Rom -> Nurbs`.
If enabled, three control points are added for each original control
point, otherwise only one.

-----

The images show the effect of the toggle. The top result is always the one with handles and the bottom one without.
* `Bezier -> Poly`
  ![image](/attachments/c4833568-fb8a-415e-b4fc-a8af2002ded8)
* `Bezier -> Catmull Rom`
  ![image](/attachments/df62e4c0-1a88-4f04-aa82-506bc40765a2)
* `Bezier -> Nurbs`
  ![image](/attachments/3b78d49d-c840-4c15-a342-050fb1f5c3f5)
* `Catmull Rom -> Nurbs`
  ![image](/attachments/de9a4c08-d442-4f97-a0e0-6393b0f0e6de)

Pull Request: https://projects.blender.org/blender/blender/pulls/120423
2024-04-25 10:56:43 +02:00
Iliya Katueshenock
fa66b52d0a Nodes: tooltips for value of dangling reroute node
Dangling reroute nodes have no source of value. For that reason, such reroute nodes
are ignored by geometry nodes. Other node systems still have to handle this case
more explicitly. To users this behavior generally makes sense, but it's also not completely
obvious. Now, there is a new tooltip when hovering over dangling reroute nodes that
mentions how those work.

Pull Request: https://projects.blender.org/blender/blender/pulls/120851
2024-04-25 10:48:06 +02:00
Campbell Barton
7337d97e13 Fix #120231: Unwrap can crash with shape_method='CONVEX'
There was no check for a convex hull with 1-2 points,
causing unwrap to crash on degenerate faces.

Regression caused by [0] (fix for #115061), which hid this bug.

[0]: 0053de6556
2024-04-25 18:02:33 +10:00
Campbell Barton
e8229fccba Fix #120551: Loop Cut tool fails when Select Circle tool is active
Allow pre-select gizmos to be "highlighted" so they can override
the fallback tool key-map items.
2024-04-25 16:11:19 +10:00
Clément Foucault
2a0074c930 Fix: EEVEE-Next: Compile error on Nvidia drivers
Fixes #121057
2024-04-25 08:00:14 +02:00
Guillermo Venegas
5c2d412a29 Fix image sequence detection to account for the number of digits
Previously when opening 2 images like `['img1.png' ,'img002.png']` the
sequence detection will open this images as a single image sequence.
However internally this is not a supported sequence.
To fix that this changes will also differentiate sequences
by their digit count, so if a group of images like:
`['img1.png','img2.png' ,'img002.png','img003.png']`
are open now it will create 2 images sequences instead of just one.

Ref: !120185
2024-04-25 13:04:23 +10:00
Campbell Barton
0f93f70076 Cleanup: quiet unused variable warnings 2024-04-25 12:09:31 +10:00
Campbell Barton
bc7e7b80fc Cleanup: use const arguments & remove redundant check 2024-04-25 12:02:15 +10:00
Campbell Barton
08b3db500f Cleanup: correct asserts
Also remove redundant assert.
2024-04-25 12:02:14 +10:00
Campbell Barton
29dd91815f Cleanup: remove redundant calls to strlen 2024-04-25 12:02:12 +10:00
Campbell Barton
9558aafafb Sequencer: correct speed assignment
The argument was shadowing the class member.

Ref !121016
2024-04-25 12:02:11 +10:00
Guillermo Venegas
b97ac126f8 IO: Replace Image space drop-box with a File Handler
Replaces `Space Image` drop-box with a file handler in order to support
opening multiple sets of files at once and to allow users to add their
own file handler to the Image editor space if desired.

A new `Image_OT_open_images` operator is introduced that uses
`Image_OT_open` internally. It groups files by different sequences and
UDIMs and loads each group accordingly.

Co-authored-by: Jesse Yurkovich <deadpin>
Pull Request: https://projects.blender.org/blender/blender/pulls/117707
2024-04-25 03:40:14 +02:00
Sean Kim
a03bf7e055 Refactor: Invert return value of array_utils::indexed_data_equal
This PR inverts the return values of `indexed_data_equal` to make the
function return as one would expect (i.e. if everything is equal then it
returns true, if any are not equal it returns false)

Pull Request: https://projects.blender.org/blender/blender/pulls/121056
2024-04-25 02:31:27 +02:00
Charles Wardlaw
2548132e23 USD Import: Added mesh validation on import as an option
Added mesh validation on import as an option.

If bad mesh data is imported, there may be a crash on a switch to edit
mode or similar. This adds an option to validate if a user determines
the file is corrupted, allowing the possibility for data recovery.
This is especially useful for importing files exported from certain CAD
applications.

The option here matches the option that OBJ and Alembic both provide.

Co-authored-by: Charles Wardlaw <kattkieru@users.noreply.github.com>
Pull Request: https://projects.blender.org/blender/blender/pulls/121054
2024-04-25 01:47:08 +02:00
Clément Foucault
1b04a0d494 Fix: EEVEE-Next: Self shadow issue caused by depth buffer precision
This add a small bias to the shading point position. This avoid
most of the self shadowing artifacts caused by depth buffer
precision. If near/far distances are set to reasonable value
this should not create any shading differences.

Fix #119124
2024-04-24 22:59:13 +02:00
Jeroen Bakker
c8ccf77564 Vulkan: Render graph dispatch indirect
Add dispatch indirect node. Also refactored the dispatch (direct) node
so more logic could be reused. The context only stores a `VKResourceAccessInfo`
struct which is reused by both the dispatch and dispatch indirect node.

Pull Request: https://projects.blender.org/blender/blender/pulls/120993
2024-04-24 21:28:45 +02:00
Michael B Johnson
f91b23ef2d USD import: add support for displayColor on non-Mesh USD shape prims
Blender USD import already supports the displayColor primvar, when it is
specified on Mesh prims. These colors are visible in the viewport when
the viewport shading color type is set to Attribute.

This PR extends this displayColor primvar support to also work with the
various shape prims, such as Box, Sphere, etc.

The original displayColor support was implemented in USDMeshReader.
Because USDShapeReader is a sibling to to USDMeshReader, and
USDShapeReader first converts shapes to a Mesh, we have factored out the
mutually beneficial code from usd_reader_mesh.cc into a new usd_mesh_utils.cc.

For now only the displayColor primvar is supported on shapes, but this
could be easily extended in a future PR.

Authored by Apple: Matt McLin

Co-authored-by: Michael Kowalski <makowalski@nvidia.com>
Pull Request: https://projects.blender.org/blender/blender/pulls/120236
2024-04-24 20:58:53 +02:00
Hans Goudey
777473313e Fix: Correct perferred domain function for point index in curve node 2024-04-24 14:32:10 -04:00
Hans Goudey
36f1336e38 Fix #121041: Node tools asset list missing on startup
Caused by 52cff75ce0 which marked the asset tree "not dirty"
when it was built even if asset loading wasn't finished.
2024-04-24 14:31:56 -04:00
Clément Foucault
fcb19fc4ec Cleanup: EEVEE-Next: Use define for volume probe atlas format 2024-04-24 20:20:35 +02:00
Clément Foucault
211b726f48 Fix: EEVEE-Next: Wrong sphere probe normalization with no volume prove
This was caused by 2 issues:
- The probe selection was running before the volume set_view
  copying undefined data.
- Missing half voxel offset which was making L1 data incorrectly
  blended with other coefficients.
2024-04-24 20:20:35 +02:00
Pratik Borhade
1e61cf7cf4 Fix #120958: Redundant Operations Tips in Status Bar when Transforming
Caused by 49bd285529.
keyitem with "release" events are shown in the status bar which is not
necessary. Move the if condition outside of for loop and exit early from
`uiTemplateStatusBarModalItem` to skip drawing of "release" type of
keyitems.

Pull Request: https://projects.blender.org/blender/blender/pulls/120974
2024-04-24 20:19:59 +02:00
Aras Pranckevicius
31e56797f0 VSE: indicate missing media in timeline/display
Sequencer timeline displays red tint & appropriate icons for strips that are
missing media file (images, movies, audio, or meta strips that contain such).

Sequencer preview and rendering displays missing media strips as magenta,
similar to missing textures elsewhere in Blender. This is on by default,
sequencer view settings have an option to turn it off.

Pull Request: https://projects.blender.org/blender/blender/pulls/116869
2024-04-24 19:54:44 +02:00
Pablo Vazquez
3ac504b8f6 VSE: Draw outline on active unselected strips
In Blender 4.1 and prior, you can tell apart the active-unselected strip
because it would have no thick outline but the text would be highlighted.

However, if label overlays were disabled there would be no way to know tell
them apart. Solve this by drawing a subtle 1px outline on active unselected
strips, using the active outline color but slightly dimmed.

Pull Request: https://projects.blender.org/blender/blender/pulls/121029
2024-04-24 19:24:11 +02:00
Brecht Van Lommel
badec4fc39 Fix: Assert reading light cache texture after recent changes 2024-04-24 18:34:59 +02:00
Hans Goudey
c60a1006e5 Asset Shelf: Add asset shelf region to image editor
As part of the brush assets project, the image editor needs an asset
shelf to display brush assets for texture paint mode. This commit adds
the unused asset shelf region, similar to the 3D viewport's region that
is currently just used for the pose library. For now, users will just
see an "Asset Shelf" toggle in the view menu.

Pull Request: https://projects.blender.org/blender/blender/pulls/121034
2024-04-24 17:55:37 +02:00
Lukas Tönne
13ae2e613e Fix #117721: GPv3: write to vertex and fill color attributes
Fill color attribute (curve domain) needs to be written for custom
fill colors to work.

Pull Request: https://projects.blender.org/blender/blender/pulls/121028
2024-04-24 17:47:17 +02:00
Brecht Van Lommel
1420c7bc60 Fix: Crash when ViewLayer.active_collection is invalid in blend file
Pull Request: https://projects.blender.org/blender/blender/pulls/121035
2024-04-24 17:42:18 +02:00
Brecht Van Lommel
9947111a19 Fix: Crash when curve mapping has zero points 2024-04-24 17:42:16 +02:00
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