Commit Graph

136734 Commits

Author SHA1 Message Date
Hans Goudey
434b225bb8 Cleanup: Sculpt: Reduce usage of topology array references
Access topology arrays directly from the mesh as needed instead.
Part of #118145.

Pull Request: https://projects.blender.org/blender/blender/pulls/122407
2024-05-28 23:48:39 +02:00
Hans Goudey
61fa2b7991 Paint: Reduce constant work for each node in weight paint
Move the loop over all affected nodes to each brush implementation,
making use of lambdas to avoid a bunch of boilerplate code. This makes
it clearer what logic actually depends on the vertices in each node, and
decreases future overhead if we decide to make PBVH nodes smaller.
2024-05-28 23:48:37 +02:00
Hans Goudey
aae77d5e60 Cleanup: Paint: Use const arguments 2024-05-28 23:48:37 +02:00
Hans Goudey
808c29d8db Cleanup: Paint: Remove more permanent storage of topology map
Access the vertex to face map directly from the mesh as necessary.
This helps to prevent unnecessary calculation (it isn't necessary in
weight paint mode besides the blur brush anymore), though it is
used for vertex normals calculation for smooth-shaded meshes.
2024-05-28 23:48:37 +02:00
Hans Goudey
f31d3b9e39 Paint: Remove use of vert to corner topology map
This saves 4 bytes per face corner and 4 bytes per vertex.
2024-05-28 23:48:37 +02:00
Hans Goudey
5cd06ffe60 Cleanup: Mesh: Modernize vert to corner topology map naming 2024-05-28 23:48:37 +02:00
Hans Goudey
bdb949bc76 Cleanup: Paint: Retrieve vert positions from consistent array
`ss.vert_positions` and `pbvh.vert_positions` are expected to point to the
same evaluated deformed position array here. It's preferrable to use the
span we already have locally. Though eventually we hope to remove the
vertex position array from PBVH.
2024-05-28 23:48:37 +02:00
Hans Goudey
144c995c06 Paint: Remove PBVH vertex iteration macro from weight & vertex paint
Part of #118145.
2024-05-28 23:48:37 +02:00
Hans Goudey
73a407061a Paint: Read selection before brush falloff
Reading the selection is much cheaper than calculating the brush radius
since it just requires reading from a boolean array. Better to do it earlier
so the radius calculation can be skipped for deselected points.
2024-05-28 23:48:37 +02:00
Hans Goudey
1c3d6fa4dd Paint: Avoid virtual array access overhead for weight and vertex paint
Use an optionally empty VArraySpan instead of a potentially-single VArray.
2024-05-28 23:48:37 +02:00
Hans Goudey
08ecad5471 Cleanup: Paint: Remove useless comments 2024-05-28 23:48:37 +02:00
Hans Goudey
8c7708acbc Cleanup: Paint: Remove multires code paths from vertex & weight paint
Multires isn't supported here anyway, and if it was it would look very different
because the weights and colors would probably be stored on the subdivided
grids somehow. For now this code is just confusing and gets in the way. It
also mixes up the purpose of the PBVH iteration macro abstraction.
2024-05-28 23:48:37 +02:00
Hans Goudey
c7e115a5ff Cleanup: Paint: Rename index variables 2024-05-28 23:48:37 +02:00
Dalai Felinto
8d79a24075 UI: Only show offline mode if launched with --offline-mode
Blender is offline by default. There is no need to mention that unless the user
went out of their way to make it offline (with the --offline-mode argument).

This is still waiting for the offline icon #122225. Using the internet
icon meanwhile.

Co-authored by Pablo Vazquez.

---

Pull Request: https://projects.blender.org/blender/blender/pulls/122392
2024-05-28 23:29:24 +02:00
Clément Foucault
5bab443c63 Fix: EEVEE-Next: Fix broken Translucent Shadow bias
This was caused by #122255 which used the normal
to tag the translucent with thickness case. But
this normal is then overwritten during the first
call to `light_eval_single`.

This patch moves the tag to a special type of
`LightingType` which then gets flushed to
`LIGHT_DIFFUSE` when used.

Pull Request: https://projects.blender.org/blender/blender/pulls/122400
2024-05-28 21:23:46 +02:00
Vitaljok
14f9ae90c2 EEVEE: fixing vector displacement
Fix for #121890

The image shows testing results with "green" texture. It is expected that
all vectors are displaced along Y axis.
Cases are "no displacement", "tangent", "object" and "world" spaces.

Results are consistent with Cycles.

Pull Request: https://projects.blender.org/blender/blender/pulls/122376
2024-05-28 21:20:54 +02:00
Sergey Sharybin
9faed28dcd Fix #122401: Missing animation rendering scene with "Render Single Layer"
Ensure that the re->r.scemode has R_SINGLE_LAYER when not rendering the
single layer.

Pull Request: https://projects.blender.org/blender/blender/pulls/122402
2024-05-28 21:19:43 +02:00
Clément Foucault
7d533175f2 EEVEE-Next: Shadow: Avoid transmission shadow to go behind light
This avoid missing tiles if light is inside the object radius.
2024-05-28 19:43:24 +02:00
Hans Goudey
33a5b47735 Cleanup: Make format 2024-05-28 13:35:44 -04:00
Hans Goudey
2918602586 Fix #119980: BMesh copy functions can clear selection
A subtle error in 66da875488fc4f9e69b1 mean that the existing selection
was overwritten instead of adding to the final flag on the result BMesh
element. Selection is often interpolated separately which is probably
why this mistake wasn't more observable earlier.
2024-05-28 13:34:50 -04:00
Hans Goudey
f38c4e0a39 Fix #119980: BMesh copying functions can clear selection
A subtle mistake in 66da875488fc4f9e69b1 meant that existing selection
was overwritten instead of maintained in the BMesh utility functions for
copying element custom data and flags.
2024-05-28 13:34:50 -04:00
Hans Goudey
34af347bb5 Cleanup: Remove unused mesh extractor 2024-05-28 13:34:50 -04:00
Nikita Sirgienko
759bb6c768 Cycles: oneAPI: Enable host memory migration
This enables scenes with all textures not fitting in GPU
memory to finally render. For scenes that are fitting,
no functional change or performance change is expected.

Pull Request: https://projects.blender.org/blender/blender/pulls/122385
2024-05-28 19:04:19 +02:00
Jacques Lucke
b210d56857 Nodes: support adding nodes in versioning without node callbacks
There is a fundamental issue when adding nodes from versioning code right now.
Generally speaking, versioning code should not change after it has been written.
If old versioning code suddenly changes its behavior, it can invalidate the versioning
code that comes after it.

The issue is that while the versioning code itself doesn't change, it is indirectly calling
code that is changing and evolving all the time. This makes the versioning unreliable
and makes it hard to do certain changes (e.g. changing which sockets a node has).
It's easy to overlook issues this creates because many of these cases don't have
regression tests.

The solution is to keep the versioning code more independent from the part of
Blender that is constantly evolving. More specifically, this means that when adding
a node, this should not take the current node initialization and declaration code into
account. Instead, the versioning code should just manually create the node with
the sockets that it expects based on the version that the versioning code has been
written for.

This patch adds new `version_node_add_empty`, `version_node_add_socket` and
`version_node_add_link` methods which allow creating nodes without calling ever
evolving code.

Pull Request: https://projects.blender.org/blender/blender/pulls/121664
2024-05-28 18:57:06 +02:00
Dalai Felinto
4b57951604 Extensions: New status message when checking for update
```
- Sync repo: {remote_url}
+ Checking repository "{remote_name}" for updates...

- Sync downloading remote data
+ Refreshing extensions list for "{remote_name}"...

- sync: invalid manifest ({error_msg}) reading {remote_url}!"
+ Repository error: invalid manifest ({error_msg}) for repository "{remote_name}"!

- Sync complete: {:s}".format(remote_url)
+ Extensions list for "{remote_name}" updated
```

---

Note, this is working as expected (from Blender anyways), however I can't test test_cli.py at the moment here.

---

Old messages:

<img src="https://projects.blender.org/attachments/9d4db8f5-ef9a-48c8-9e56-cb534aa9aed5" width=650>

New messages:

<img src="https://projects.blender.org/attachments/0245bcb7-6c4e-47e4-a616-0cf831761b47" width=450>

---

Co-authored by Pablo Vazquez

Pull Request: https://projects.blender.org/blender/blender/pulls/122378
2024-05-28 18:39:42 +02:00
Clément Foucault
53797a2ed3 EEVEE-Next: UI: Move fast GI to the bottom of raytracing panel
This avoid to mistakely think that the denoising is applied
to the Fast GI. Fast GI has its own internal denoising.
2024-05-28 18:38:23 +02:00
Sean Kim
025df21a0f Sculpt: Add Polyline Mask, Face Set, and Trim
This PR adds the *Polyline Mask*, *Polyline Face Set*, and
*Polyline Trim* tools.

## Limitations
* *Polyline Face Set* is not added to either of the *Sculpt*
or *Face Sets* menu as none of the other face set gestures are in
either.

Pull Request: https://projects.blender.org/blender/blender/pulls/122248
2024-05-28 18:33:45 +02:00
Dalai Felinto
18cf4e9d09 Correct tooltip for bl_pkg.extensions_show_for_update 2024-05-28 18:12:00 +02:00
Dalai Felinto
7ac762241e Extensions: Fixup for Install/Update operator
The same tooltip is used for Update. Which didn't make much sense as it
was (since it was suggesting that it was enabling the extension).

Simplifying the message now.

Fixup for: 31f7016ba9f92135fe1843aa72892a56607bd061

Co-authored by Pablo Vazquez.
2024-05-28 18:12:00 +02:00
Hans Goudey
48cc79f52d Mesh: Edit data draw extraction improvement
Part of #116901.

Avoid the "extractor" abstraction for creation of edit mode overlay data
vertex buffers. Use threading::parallel_for loops instead. Also prefer
code duplication over linking things that are unrelated. This is the
last "extractor" loop that runs by default in edit mode so there is a
small performance improvement there. Besides that, the changes is the
same as the other similar refactors.

Pull Request: https://projects.blender.org/blender/blender/pulls/122386
2024-05-28 18:06:08 +02:00
Sean Kim
9d3e2de76e Cleanup: make format 2024-05-28 08:47:58 -07:00
Hans Goudey
b642b516d9 Cleanup: Reorder edit data draw buffer extraction function
Just to make a future diff smaller.
2024-05-28 11:26:22 -04:00
Hans Goudey
ebbb72187a Cleanup: Use references, const, for mesh edit data flag extraction 2024-05-28 11:26:21 -04:00
Lukas Tönne
fd651da7e5 GPv3: Fix fill tool boundary construction on thin pixel lines
Finding the boundary uses a Moore neighborhood. The algorithm iterates
over filled pixels, following pixels with empty neighbors, in clockwise
direction. For a given pixel and input direction (where the boundary is
coming from), the next neighbor is found by checking neighbors clockwise
from the previous pixel.

The last direction in this inner loop would be opposite the input
direction, i.e. if the pixel has only one neighbor it can loop back
and iterate over pixels that are already in the boundary, from the
opposite direction. However, this last direction was excluded from the
search (an earlier implementation did not support it). Using this search
direction as well allows the boundary to go back and forth over the same
line of pixels until the boundary is closed.

Pull Request: https://projects.blender.org/blender/blender/pulls/122383
2024-05-28 17:25:35 +02:00
Sean Kim
7726e7f563 Sculpt: Add Line Face Set Tool
This PR adds the `Line Face Set` tool and adds it to the following
location:
* Sculpt Mode toolbar

## Limitations
None of the existing Face Set gesture operators exist in either the
Sculpt dropdown or the Face Set dropdown, this PR does not add the Line
Face set tool in either location as well.

Pull Request: https://projects.blender.org/blender/blender/pulls/122245
2024-05-28 17:17:10 +02:00
Lukas Tönne
f3054f03cd GPv3: Dilate and erode functions for the fill tool
This increases or decreases the initial filled area by an amount of
pixels.

Pull Request: https://projects.blender.org/blender/blender/pulls/122368
2024-05-28 17:14:28 +02:00
Clément Foucault
71e8e6520e EEVEE-Next: Fast GI: Improve Precision parameter
The parameter was not taking the number of samples into
account, making it impossible to acheive highest quality
at high sample count.
2024-05-28 17:14:06 +02:00
Sean Kim
1ab3fffc1d Sculpt: Add increase / decrease visibility operator
This PR adds a new operator: `PAINT_OT_visibility_edit` to support
iteratively expanding or shrinking the visibility of a mesh, similar to
the *Grow / Shrink Mask* actions and the *Grow / Shrink Face Set*
options. This operator is exposed via two new entries in the *Sculpt*
toolbar entry as *Show More* and *Show Less* and have also been
assigned to Page Up and Page Down in the default Blender keybinds for
Sculpt Mode.

### Technical Details
Each of the PBVH types is solved slightly differently, though the
general principle for each is as follows:

1. Make a copy of the current mesh visibility state
2. Iterate over elements (faces & corners if available, otherwise
   vertices) to look at adjacency information
3. Apply appropriate visibility change to vertices
4. Sync face visibility

### Limitations
* Currently, like all other operators in the `paint_hide.cc` file. This
  new operator is limited to Sculpt mode only.

Based off of [this](https://blender.community/c/rightclickselect/pz4y/)
RCS request.

Pull Request: https://projects.blender.org/blender/blender/pulls/120282
2024-05-28 17:12:45 +02:00
Philipp Oeser
fcc481a407 Render: include info string for "render_stats" handler
The "render_stats" handler now includes the message line that was
written to stdout as the first arg (using `BKE_callback_exec_string`
instead of just `BKE_callback_exec_null`).

This can be useful to track render progress (and people were relying on
parsing stdout in the past).

Was a request in chat.

This also corrects possible output from the callback being written in
between message parts in `do_write_image_or_movie` (which was probably a
mistake in 93d5e106aac8).

Pull Request: https://projects.blender.org/blender/blender/pulls/119789
2024-05-28 17:07:27 +02:00
Hans Goudey
89c13dbb5c Fix: Mesh draw extraction missing wire batch missing normals input
The `overlay_wireframe` shaders uses a `nor` input but it wasn't added
to the GPU batch since the normals were split to a separate vertex buffer.
Adding that input gets closer to the appearance in 4.0. But it still looks a
bit different-- the outline is not as bright overall.

Fixes #120781.

Pull Request: https://projects.blender.org/blender/blender/pulls/120827
2024-05-28 16:58:08 +02:00
Nika Kutsniashvili
61178b22a2 Nodes: port "Connect to Output" operator from Node Wrangler
As Node Wrangler add-on is moving to extensions platform and maybe isn't shipped
with Blender from 4.2 onwards, some of it's more important functionalities which are
crucial for Blender UX can be ported inside core. Also see #121749.

This PR ports "Preview Node" operator from add-on inside `scripts/startup/bl_operators`.

When Shift-Ctrl (or Shift-Alt) clicked on the node operator connects output socket of the
node to active Output node in the tree (group, material, light, or world output). For Geometry
Nodes this is just handy operator, but in Shader Nodes, because Viewer Node isn't
implemented, this has always been the only way to quickly preview nodes by connecting
it to Material Output.

Changes made from Node Wrangler version:
- Renamed operator from "Preview Node" to "**Connect to Output**", because node previews
  already mean a different thing in context of compositor and shader editor, and viewer node
  is used for previewing in geometry nodes. Connect to Output is correct name because in every
  context it's called that's what it does.
- Assigned shortcut Shift-Alt-Click in shader editor as well. Even though Shift-Ctrl click already
  works, it's good to have consistency with geometry nodes, so that users can use same shortcut
  in both contexts.

Operator doesn't work in compositor. It's not clear if that's wanted (to connect to Composite node),
and if it is it'll be added in separate PR.

Original authors of the add-on: Bartek Skorupa, Greg Zaal, Sebastian Koenig, Christian Brinkmann, Florian Meyer

Pull Request: https://projects.blender.org/blender/blender/pulls/122016
2024-05-28 16:42:55 +02:00
Campbell Barton
be4788a9bd Extensions: pass platform to the remote URL
Add the platform to the URL when connecting to the remote server.

Based on !122234.

Co-authored-by: Dalai Felinto <dalai@blender.org>

----

This follows documented platform ID's from: https://docs.blender.org/manual/nb/dev/advanced/extensions/getting_started.html

Co-authored-by: Dalai Felinto <dalai@blender.org>
Pull Request: https://projects.blender.org/blender/blender/pulls/122371
2024-05-28 16:35:41 +02:00
Jacques Lucke
905aaf439c Geometry Nodes: new Set Instance Transform node
This node allows replacing the transformation of every instance by providing a matrix.

Before, this was only possible by using the Store Named Attribute node. It's more common
in Blender to have specialized built-in nodes for built-in attributes (e.g. Set Position, and Set ID).

Pull Request: https://projects.blender.org/blender/blender/pulls/121473
2024-05-28 16:34:37 +02:00
Clément Foucault
6e50aebd74 EEVEE-Next: UI: Remove mention of Horizon Scan in tooltip
We use fast GI for this feature now.
2024-05-28 16:16:53 +02:00
Clément Foucault
c9c95e7e64 EEVEE-Next: RNA: Rename horizon property to fast_gi
This avoid discrepancy between the UI and the API.
2024-05-28 16:09:00 +02:00
Clément Foucault
117bfc870d EEVEE-Next: Fast GI: Add angular thickness
While easier to understand, the conventionnal global
scene thickness parameter have some downside:
- It doesn't scale with larger scenes since the
  distant samples have small thickness
- It doesn't handle fine geometric variation in
  foreground.

The proposed angular thicknes makes all sample
have the same angular span. This makes it
distance independant and capture different occluder
thickness with less artifacts. The downside is
that the occluders have the same angular span
at any distance which makes the same occluder inflate
with distance.

A downside is that the geometry near the shading point is
under-represented. Leaving light leaking or lack of AO
at contact points. To fix this, we introduce back a
geometric thickness parameter.

Pull Request: https://projects.blender.org/blender/blender/pulls/122334
2024-05-28 16:00:38 +02:00
Bart van der Braak
ceeaea0c8a Fix: Switch to scheduled trigger for appropriate permission scope in workflow
Previously, the workflow was triggered by **opened pull requests** events.
However, testing revealed that this event, initiated by external GitHub users,
lacks the permission scope to comment on or close pull requests.

To address this, I've updated the workflow to trigger on a schedule. Scheduled
triggers aren't tied to external actors, thereby ensuring the necessary
permission scopes are available.

Pull Request: https://projects.blender.org/blender/blender/pulls/122363
2024-05-28 14:12:20 +02:00
Campbell Barton
b15bc1b5bb Extensions: add the blender version to the remote URL
Add query arguments to the URL when connecting to the remote server.

This information is stripped to create relative paths and for error
messages to prevent overly verbose URS's.

Based on !122234.

Co-authored-by: Dalai Felinto <dalai@blender.org>
2024-05-28 21:41:43 +10:00
Campbell Barton
171319d9ef Extensions: send access token for HTTP requests
- The access token is used when connecting to the server.
- Mention an invalid access token as a possible cause for 403 errors.

Based on !122234.

Co-authored-by: Dalai Felinto <dalai@blender.org>
2024-05-28 21:36:23 +10:00
Campbell Barton
a55c3f503c Cleanup: quiet switch warning 2024-05-28 21:35:27 +10:00