Commit Graph

112420 Commits

Author SHA1 Message Date
Campbell Barton
08d5eb8f9c Cleanup: cmake formatting 2024-08-21 23:20:34 +10:00
Campbell Barton
83fe5712ab Fix #126525: Gizmo flickering when a Blender window is resized 2024-08-21 23:03:31 +10:00
Jeroen Bakker
d7a6ab6f04 Fix #124364: BPY improve description template_list.list_id
Add some hints when the property is needed.
Use similar text as `template_asset_view` widget.

Pull Request: https://projects.blender.org/blender/blender/pulls/126569
2024-08-21 14:33:12 +02:00
Hans Goudey
11524775c7 Cleanup: Pass BVH nodes by reference 2024-08-21 08:10:56 -04:00
Lukas Tönne
2e9fc8ef2d GPv3: Segment selection support
Support segment mode in Grease Pencil v3 selection operators.
This is a continuation of #109221.

Segment selection works in multiple stages:
1. When enabled, the 2D evaluated lines for all visible curves are
entered into a BVH tree. This tree is used to find intersections later
on. All the visible drawings are in the tree, an `OffsetIndices` array
is used to record ranges of BVH elements for each drawing.
2. Primary selection functions get alternative versions that produce an
`IndexMask` instead of writing directly to selection attributes. This
makes it possible to detect select actions on points that are already
selected. Using a delta of selection attributes for this is not enough
to detect such user actions (and inefficient).
3. In segment mode the `IndexMask` is extended to fully cover segment
points (or exclude them when deselecting respectively). This first
performs and intersection test using the BVH tree, then finds all point
range with selected elements.
4. Finally the extended index mask is applied to selection attributes as
usual.

Pull Request: https://projects.blender.org/blender/blender/pulls/126027
2024-08-21 13:35:26 +02:00
Jonas Holzman
9b1d653554 Fix #126246: Missing Outliner redraw notifier when making datablock single user
Without a proper redraw, the outliner (in `Blender File` mode) would
only *partially* update on mouse hover, refreshing the user-count of
the old datablock without listing the newly added datablock.

Pull Request: https://projects.blender.org/blender/blender/pulls/126386
2024-08-21 13:10:35 +02:00
Julian Eisel
36c5606fc3 Fix #124622: Crash/assert on "Render Active Object"
The preview rendering would fall back to the shader preview rendering
pipeline, which is not suitable for objects. Instead, don't render any
preview (use an empty preview) for such object types. This case could be
handled a bit nicer by the code triggering the preview rendering (e.g.
the "Render Active Object" operator poll could return false), but
keeping that separate from fixing the lower level logic to ensure crash
free behavior.

Pull Request: https://projects.blender.org/blender/blender/pulls/126235
2024-08-21 11:54:50 +02:00
Bastien Montagne
6e143cbf75 Fix #126549: Forbid unlinking Scene main collection.
Looks like this use to 'work' because lower-level code would refuse to
delete an embedded scene collection, but the operator should not have
been active at all in the first place.

Fixed by adding a proper `poll` callback to the `collection unlink`
operator.
2024-08-21 11:48:03 +02:00
Campbell Barton
5a0e8317f4 Cleanup: use const vars/args 2024-08-21 19:19:38 +10:00
Omar Emara
844d6d2df0 Fix #126552: Crash on Render Layers node with no scene
Blender crashes when a Render Layers node is used with no scene in the
GPU compositor. This is fixed by a simple nullptr check.
2024-08-21 10:54:00 +03:00
Jesse Yurkovich
d6ea01bd38 Fix #126551: Write Hex values using 2 digits in the color tooltips
We need to use 2 hex digits to ensure that the value displayed in the
tooltips is correct.

Pull Request: https://projects.blender.org/blender/blender/pulls/126580
2024-08-21 04:55:55 +02:00
Campbell Barton
ddcf5bac44 Revert "Fix image sequence detection to account for the number of digits"
This reverts commit 5c2d412a29.
because it caused a regression.

Resolve #124832.
2024-08-21 12:40:14 +10:00
Harley Acheson
6be90285bc Fix #126512: Icon Positioning When Icon Height Varies
Remove the subpixel positioning of icons. I just can't get this work
well in enough circumstances to make it worth the hassle it causes.

Pull Request: https://projects.blender.org/blender/blender/pulls/126579
2024-08-21 04:04:19 +02:00
Hans Goudey
ef0b163b49 Sculpt: Make BMesh BVH tree build similar to mesh/grids
Changes similar to f9c6fe30db.
- Calculate node bounds after building the tree.
- Calculate node visibility after building the tree.
- Avoid redundant normals recalculation. They are already calculated
  when first building the dynamic topology BMesh.
- Avoid clearing the default node flags.
2024-08-20 17:47:43 -04:00
Hans Goudey
65efd7f033 Fix: Dynamic topology mesh invisible after recent commit
Mistake in 7e0029fb65.
I assumed the BMesh and Mesh PBVH building process was
more similar than they really are.
2024-08-20 16:08:57 -04:00
Hans Goudey
7e0029fb65 Sculpt: Simplify BVH node flag initialization, avoid normals update
Use the default constructor of `Node` to set the default new flag value.
Remove the normals update flag which was added in f9c6fe30db.
This should avoid recalculating all the normals after just building the
BVH tree.
2024-08-20 15:41:56 -04:00
Hans Goudey
a2d8eec834 Cleanup: Reduce indentation in PBVH construction 2024-08-20 15:41:56 -04:00
Hans Goudey
726315deba Cleanup: Sculpt: Pass BVH building data as arguments
Rather than retrieving the data from the BVH. This opens up the
possibility that the BVH building produces a slightly different
data structure that's then converted to the final format in a
separate pass.
2024-08-20 15:41:56 -04:00
Sean Kim
4870ba5906 Cleanup: Isolate dyntopo detail size call
Setting the detail size is unnecessary when not using dyntopo sculpting.

Pull Request: https://projects.blender.org/blender/blender/pulls/126533
2024-08-20 21:29:18 +02:00
Sean Kim
858f91b2aa Cleanup: Use enum class and constexpr in sculpt_automask.cc
Pull Request: https://projects.blender.org/blender/blender/pulls/126111
2024-08-20 20:53:55 +02:00
Jeroen Bakker
1ba82ed139 Cleanup: Spelling 2024-08-20 20:32:48 +02:00
Hans Goudey
0277ad127a Cleanup: Reduce indentation in mesh separate operator 2024-08-20 13:41:57 -04:00
Hans Goudey
fa9aa5eab3 Cleanup: Remove unused variable 2024-08-20 13:39:27 -04:00
Hans Goudey
18a7aff3e2 Refactor: Sculpt: Simplify access to BVH nodes in undo code
Use the same method for retrieving "all nodes" that we do elsewhere.
Even though this requires a temporary vector, it makes it an easier
target for optimization later and makes the sculpt BVH iteration
easier to refactor in the meantime.
2024-08-20 13:34:06 -04:00
Hans Goudey
98308757cd Cleanup: Use C++ Stack for PBVH iteration 2024-08-20 13:34:06 -04:00
Hans Goudey
05bd28d123 Cleanup: Move PBVH iteration struct closer to use 2024-08-20 13:34:06 -04:00
Bastien Montagne
dcadb3301e 'Fix' crash in append code in invalid data cases (linked data using local data).
Issue found here at the studio in some production files using dirty
hacks. Ideally we could fully forbid such assignement in BPY/RNA API
too, but there is no 'proper' way to achieve this without this dirty
hack currenlty.

So instead, check for this case and print a nice error about it for now.
2024-08-20 18:22:30 +02:00
Jacques Lucke
41acd803e4 Fix: ConcurrentMap requires the value to be copy-constructible
It's not entirely clear why TBB requires this. I couldn't find this restriction
in their documentation yet. It is mentioned in a code comment in
`allocate_node_default_construct` in `tbb/concurrent_hash_map.h` though.
2024-08-20 17:47:27 +02:00
Amelie Fondevilla
625ef79f57 GPv3: Soft mode for the Eraser tool
Implementation of the soft mode of the eraser tool for GPv3.
In this mode, the eraser decreases the opacity of the points it hits.
If the opacity of a point falls below a threshold, then the point
is removed from the curves.

Pull Request: https://projects.blender.org/blender/blender/pulls/110310
2024-08-20 17:24:03 +02:00
Lukas Tönne
df028d588f Fix: Build error when pugixml and haru libraries are disabled
These libraries are used for grease pencil import/export. If both of
them are disabled the SVG import operator is still built but needs a
function that was hidden.

Pull Request: https://projects.blender.org/blender/blender/pulls/126555
2024-08-20 17:14:10 +02:00
Casey Bianco-Davis
92155db27a GPv3: Canvas overlay
This implements the "Canvas" overlay for GPv3.

Some things of note:
- The color and subdivision are hard coded for now
- The scale and offset have been removed for now

Pull Request: https://projects.blender.org/blender/blender/pulls/126248
2024-08-20 17:05:34 +02:00
Jacques Lucke
24f7b7a8fb Cleanup: Nodes: reduce coupling between socket shape and field state
Previously, the inferencing result was only stored in the socket shape.
However, that was conflicting with experiments where the socket shape and
the field state was not related.
2024-08-20 16:15:59 +02:00
Jeroen Bakker
7f1812e335 Vulkan: Fix multi view layer selection
When using multi view only the first layer could be selected as the
rendering info only had a single layer in its main struct.
- Add failsafe for unsupported platforms
2024-08-20 16:02:32 +02:00
Jeroen Bakker
8acb2f363e Cleanup: Remove solved comment 2024-08-20 15:31:54 +02:00
Jeroen Bakker
2c6b1eb2e5 GPU: Fix static shader tests for NVIDIA
Skipping tests when workarounds are enabled due to GLSL restrictions in
the NVIDIA driver.
2024-08-20 14:52:35 +02:00
Jeroen Bakker
242271237a Vulkan: Ensure rendering ends when deleting attached framebuffer
When a frame buffer that is attached is being deleted the rendering end
event will never happen which leads to inconsistent render graphs.
2024-08-20 14:50:18 +02:00
Jeroen Bakker
df910f2417 GPU: Fix draw test on NVIDIA/OpenGL
Some workarounds cannot work on NVIDIA but are tested leading to
segfaults. Fixed by skipping in these cases.
2024-08-20 13:37:00 +02:00
Bastien Montagne
d6fa48c022 Fix #126507: GP conversion code was not updating link/append data.
Code executed in `BLO_read_do_version_after_setup` would not update in
any ways the info in link/append context data.

NOTE: this could potentially be extended to other code in this 'complex
do version' area. However, other versionning did not cause issues
apparently so far, so would rather until such changes are proven needed.
2024-08-20 12:51:47 +02:00
Bastien Montagne
2853a4c4db Refactor: Blendfile Link/Append: make callback of foreach item a function ref. 2024-08-20 12:51:47 +02:00
Bastien Montagne
382122f172 Cleanup: GPv3: Remove unused public GP object conversion function.
This was used during development for the conversion operator. now that
all data is systematically converted on load, it was not needed anymore
(and already unused).
2024-08-20 12:51:47 +02:00
Lukas Tönne
5a1f264d49 Fix: GPv3: Disable debug setting of the fill tool that keeps images. 2024-08-20 12:17:52 +02:00
Lukas Tönne
ec82ccb4b4 Fix #126271: Prevent comparing a curve index mask to a point span
The `has_anything_selected` function has a variant that takes just an
index mask and compares that to all selection attributes it can find,
regardless of which domain they are on. In this case the bezier handle
selection attributes were stored on the Curve domain while the selection
domain has already been switched to Point.

Now the `has_anything_selected` function always expects a domain so it
can check for attributes on that same domain.

Bezier handle selection does not make sense on the point domain, but the
way curve selection is written makes it difficult to prevent the
creation of the attribute on Curve domain. It's also not generally
prohibited (user can still create that attribute) so selection code
should handle this case robustly.

Pull Request: https://projects.blender.org/blender/blender/pulls/126543
2024-08-20 12:00:37 +02:00
Casey Bianco-Davis
1fb849b98e GPv3: Sculpt mode overlay.
This adds lines and points overlay to sculpt mode.
Visibly of lines and points matches legacy grease pencil.

Pull Request: https://projects.blender.org/blender/blender/pulls/126453
2024-08-20 11:57:59 +02:00
Lukas Tönne
400c738db9 GPv3: Import and export for SVG and PDF
Implements the SVG import/export and PDF export operators for GPv3.

Pull Request: https://projects.blender.org/blender/blender/pulls/123996
2024-08-20 11:41:37 +02:00
Jeroen Bakker
7a7ae5defe Vulkan: Occlusion Queries
Implements occlusion queries using VkQueryPools.

Pull Request: https://projects.blender.org/blender/blender/pulls/123883
2024-08-20 11:27:33 +02:00
casey bianco-davis
29be8ff359 GPv3: Only select visible bezier handles for Circle, Lasso and Box selection tools.
This makes so that only visible bézier handles can be selected by the
following tools: `Circle`, `Lasso` and `Box` selection.

Pull Request: https://projects.blender.org/blender/blender/pulls/125549
2024-08-20 11:00:08 +02:00
Campbell Barton
a51f6b6923 Fix #123405: Edit-mesh bridge crashes with all faces selected
Bridge could delete all faces & then fail to perform the bridge
operation. In this case the mesh was still modified.

Resolve by tracking the changed state, run updates when any changes are
made.
2024-08-20 17:46:34 +10:00
Jeroen Bakker
994e14b000 OpenGL: Enable HQ normals workaround for more AMD drivers
Allows EEVEE to be used on Legacy platforms. Fixes rendering black geometry in some cases.

Pull Request: https://projects.blender.org/blender/blender/pulls/126540
2024-08-20 08:46:55 +02:00
Campbell Barton
4cea295fcb Fix #126392: Crash loading a file with "Load UI" disabled
Resolve regression in [0].

Loading a blend file from the command line with "Load UI" disabled
was crashing.

Resolve by including the window in the temporary context override.

[0]: 7fcd4e2429
2024-08-20 16:37:34 +10:00
John Kiril Swenson
9dd2d7bd75 Fix: VSE snapping with edge panning
Ever since it was added to the VSE in e49fef45ce, edge panning would
break snapping -- edge panning a strip and then bringing it back would
cause snap code to trigger at incorrect locations. This is because the
edge pan system would update the `View2D` in `t->region->v2d.cur`, but
not mouse values, and so `t->values` would end up unchanged even while
the strip was moving.

e6a557952e fixed the issue for the node editor by recalculating mouse
input values when the view changed with `transformViewUpdate()`, but
since the code was separate from VSE, that fix did not get also get
applied here.

Although the code in `view2d_edge_pan_loc_compensate()` is mostly
identical between the two and so one possibility is to move it to
`transform_generics.cc`, adapting it to allow it to be used by both
spaces, custom transform data in the node editor additionally stores and
updates a `viewrect_prev` as mentioned in e040aea7bf, which VSE custom
data does not have. Since the fix is small enough and I don't want to
risk messing with other module code, I've opted to just copy the fix
over to VSE. If further bugs crop up in the future, we can consider
combining the code.

Also fix typo in `tranformViewUpdate()`.

Pull Request: https://projects.blender.org/blender/blender/pulls/126471
2024-08-20 07:11:45 +02:00