Commit Graph

120055 Commits

Author SHA1 Message Date
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 93d5e106aa).

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
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
Campbell Barton
a55c3f503c Cleanup: quiet switch warning 2024-05-28 21:35:27 +10:00
Campbell Barton
a64f36a591 Unbreak building without OPENVDB 2024-05-28 21:35:01 +10:00
Dalai Felinto
651621da0d Extensions: Tooltips and disable poll message for Check for Updates
This includes checks for offline-mode.

Co-authored by Pablo Vazquez.
2024-05-28 13:01:07 +02:00
Dalai Felinto
bdde38eff1 UI: Preferences: Group the Themes tab with the Extensions
Co-authored by Pablo Vazquez.
2024-05-28 13:01:07 +02:00
Lukas Tönne
0fd81e4994 GPv3: Dot stroke materials for fill tool
This allows using strokes with a "Dot" material as boundaries for the
fill tool.

Note: "Square" materials are not currently supported, they get rendered
as dots too. This is the same in GPv2, there just isn't a simple shader
for rotated squares.

Pull Request: https://projects.blender.org/blender/blender/pulls/122324
2024-05-28 12:53:26 +02:00
Falk David
e7cf4676a1 Fix: GPv3: Build modifier conversion
There were some copy-paste mistakes in the
build modifier conversion.

Pull Request: https://projects.blender.org/blender/blender/pulls/122358
2024-05-28 12:52:38 +02:00
Falk David
d8c5f9a8ba Fix: GPv3: Build modifier maximum gap not working
The "Maximum Gap" setting for the "Natural Drawing Speed"
mode was not working.
This was because the code used `math::max` to try and clamp the value
to a maximum when it should have used `math::min`.
This fixes this issue.
2024-05-28 12:27:36 +02:00
Falk David
e4c0055591 Fix #122355: Opacity modifier hardness mode not working
This was introduced by 944be3d619.

In order to keep the behavior the same at the user level,
we can't invert the factor. We have to invert the values, then
apply the factor and convert back.

Pull Request: https://projects.blender.org/blender/blender/pulls/122360
2024-05-28 12:12:31 +02:00
Lukas Tönne
1080a94a3d Geometry Nodes: Value logging for Volume geometry and Grid sockets
Volumes and grids were not yet handled by the Geometry Nodes value
logging system. This patch adds basic information (number of grids)
to the value logger and node tooltips.

Pull Request: https://projects.blender.org/blender/blender/pulls/121622
2024-05-28 12:05:58 +02:00
Iliya Katueshenock
0507dc8c2a Geometry Nodes: skip unused output of multi-function when evaluating on single values
This is slight optimization. Number of nodes with additional outputs like `Valid`
flag of other math-related things will be more in future, its better to strict api
and do not evaluate even singles. This also can reduce number of logged values.

Pull Request: https://projects.blender.org/blender/blender/pulls/121799
2024-05-28 12:00:14 +02:00
Christoph Lendenfeld
f3af98db5c Fix #120858: Flip Quaternions didn't use keyingset for autokeying
The issue was that the code called a function that doesn't
check for the active keyingset in combination with autokeying.
The fix is to just call `autokeyframe_pose_channel` which does that check.

I snuck in a minor change to the operator label.
It spells out "Quaternions" now instead of shortening to "Quats".
I haven't seen that way to shorten it in Blender before.

Pull Request: https://projects.blender.org/blender/blender/pulls/122170
2024-05-28 11:58:46 +02:00
Falk David
489bb2e29a Cleanup: GPv3: Use dereference operator instead of .varray 2024-05-28 11:19:54 +02:00
Christoph Lendenfeld
669b15a53d Fix #119945: Dependency Graph not updated properly when adding constraints through python
The issue was that when adding a constraint through
python to an object that is already animated,
the constraint did not evaluate properly at first.
The fix is to update the depsgraph when creating a
constraint through the API.
Such an update already happened when running the
operator to create a constraint.

Pull Request: https://projects.blender.org/blender/blender/pulls/122198
2024-05-28 11:08:26 +02:00
Nathan Vegdahl
b821e56165 Refactor: Anim: put default channel group names in one place
Previously they were split between two places, and were not fully
consistent with each other.  The inconsistency didn't result in
user-facing inconsistency due to what was called when at a higher
level, but this will ensure continued user-facing consistency as we make
more changes to the keyframing code.

Pull Request: https://projects.blender.org/blender/blender/pulls/122317
2024-05-28 09:59:35 +02:00
Omar Emara
0dca908191 Compositor: Add GPU per-node execution time report
This patch adds support for timing GPU compositor executions. This was
previously not possible since there was no mechanism to measure GPU
calls, which is still the case. However, since 2cf8b5c4e1, we now flush
GPU calls immediately for interactive editing, so we can now measure the
GPU evaluation on the host, which is not a very accurate method, but it
is better than having no timing information. Therefore, timing is only
implemented for interactive editing.

This is different from the CPU implementation in that it measures the
total evaluation time, including any preprocessing of the inputs like
implicit type conversion as well as things like previews.

The profiling implementation was moved to the realtime compositor since
the compositor module is optional.

Pull Request: https://projects.blender.org/blender/blender/pulls/122230
2024-05-28 08:13:46 +02:00
Campbell Barton
0cbadd00a3 Cleanup: various non functional changes 2024-05-28 14:09:40 +10:00
Campbell Barton
f7f23541f0 Extensions: add trailing slash to URL 2024-05-28 13:50:26 +10:00
Campbell Barton
ca9b105e6c Cleanup: spelling in comments 2024-05-28 13:47:43 +10:00
Campbell Barton
c110d26c61 Cleanup: use const pointers where possible 2024-05-28 13:47:43 +10:00
Hans Goudey
91c7809640 Fix #122319: GPU subdivision loose geometry positions invalid
Caused by 8d4da6063a
2024-05-27 23:04:07 -04:00
Hans Goudey
81a6eb2118 Fix #121789: Viewer node crash with matrix socket type 2024-05-27 16:27:41 -04:00
Hans Goudey
0dd61a9dc6 Fix #122293: Hidden edges affect incorrect loose edge indices
The loose edge section of the index buffer was built incorrectly,
essentially assuming that all the hidden edges came at the end of the
loose edge indices. To correct this, we need to track the visibility of
each loose edge index rather than the visibility of each edge itself.
This is driven by the need to combine the loose and non-loose indices
into one IBO with the loose edges in a contiguous section, and the
desire to avoid restart "invisible" indices in the buffer to upload
less data to the GPU.
2024-05-27 16:18:41 -04:00
Julian Eisel
71b0e9d92a UI: Don't refresh searchbox region blocks on text input
Refreshing refers to the recreation of the block and it's buttons in
this case.

Refreshing popup regions on text input was added in 7d80fde033. It can
be useful to update the popup contents on text input, searchboxes have
their completely own update handling however.
2024-05-27 21:25:28 +02:00
Julian Eisel
98c92b9033 Fix more potential crashes when refreshing certain popups
These popups had refreshing enabled, but the callback used for
refreshing would access a likely dangling operator pointer. One case can
use the operator-type pointer instead, in the other case disable
refreshing altogether. Also see 8ea79dc3a7.
2024-05-27 21:21:39 +02:00
Julian Eisel
8ea79dc3a7 Fix #122276: Crash when searching for a Collection Instance
This search menu creation/refreshing function relies on the operator
pointer which might be dangling. There are more such cases, will fix in
followup commits.
2024-05-27 20:58:12 +02:00
Harley Acheson
8542797c6f Fix: UI: Versioning Error with V3D_SHOW_CAMERA_GUIDES
Fix test failures after versioning change introduced in #121923.

Pull Request: https://projects.blender.org/blender/blender/pulls/122333
2024-05-27 20:16:44 +02:00
Julian Eisel
95886fdfe2 Refactor: Use new context string support for node asset menus
Since 2fbf206491 it's possible to store named strings in context, rather
than having to wrap them in RNA pointers. Here this can avoid some
boilerplate code.

After this the `AssetCatalogPath` RNA struct should be unused. Might
be better to remove it in 5.0 only though, since it's part of the API.
Added to #110461.

Pull Request: https://projects.blender.org/blender/blender/pulls/122331
2024-05-27 20:02:49 +02:00
Damien Picard
b37d121e0a I18n: extract and disambiguate a few messages
Extract
- Add to Quick Favorites tooltip.
- "Mask", the name of a newly created mask (DATA_).
- "New" in the context of the new mask ID button.
- A few strings using BLI_STR_UTF8_ defines were not extracted.
  Take the special characters out of the translation macros.
- "External" menu items from the filebrowser's Files context
  menu (right-click on a file). These items were already extracted,
  but not translated.

Improve
- Separate formatted error message "%s is not compatible with
  ["the specified", "any"] 'refresh' options" into two messages.

Disambiguate
- Use Action context for new F-modifiers' names. This is already used
  for the "type" operator prop.
- Translate ImportHelper's default confirmation text using the
  Operator context, as it uses the operator name which is extracted
  with this context.
- "Scale" can be a noun, the scale of something, or a verb, to scale
  something. The latter mostly uses the Operator context, so apply
  this context to verbs, and the default contexts to nouns.
- "Scale Influence" can mean "Influence on Scale" (tracking
  stabilization) and "to Scale the Influence" (dynamic paint canvas).
- "Object Line Art" as type of Line Art to add, as opposed to the
  active object's Line Art settings.
- Float to Integer node: use NodeTree context for the node label, as
  this is already extracted and used for the enum.

Do not translate
- Sequencer labels containing only a string formatting field.

Some issues reported by Gabriel Gazzán and Ye Gui.

Pull Request: https://projects.blender.org/blender/blender/pulls/122283
2024-05-27 19:33:35 +02:00
Jesse Yurkovich
3ccb84fee6 Fix: USD: warning when printing bke::AttrDomain type 2024-05-27 19:20:54 +02:00
Hans Goudey
55ff4aef85 Cleanup: Sculpt: Improve function name 2024-05-27 13:12:43 -04:00
Jacques Lucke
41472dc659 Geometry Nodes: clear data block references before baking
The references are automatically recreated during the bake. Clearing them
first ensures that no old references stay around unnecessarily.
2024-05-27 19:11:23 +02:00
Julian Eisel
2fbf206491 UI: Allow passing named strings via context
Sometimes it is necessary to pass additional data through generic UI entities,
to specific implementations. For example to pass additional options to panel
polling & drawing when instantiating a panel through its panel type. Or storing
additional data in a button, without hardcoding it in the button struct/class.

Passing data via context is a simple solution to this, however so far this only
works using hardcoded context queries or RNA pointers. For passing arbitrary
strings we've used workarounds like creating an RNA type to wrap it already.
For example `RNA_AssetCatalogPath`, which is used to dynamically populate menu
items based on an asset catalog path, via a generic menu type.
type instantiation. This makes it possible to invoke specific asset shelves as
popover panels.

Idea is simply to let `bContextStore` entries hold copies of the string (as
`std::string`), avoiding lifetime issues. Context APIs are extended to support
setting/querying strings via a context member name.

Pull Request: https://projects.blender.org/blender/blender/pulls/122113
2024-05-27 18:46:19 +02:00
Lukas Tönne
cdf960ecec GPv3: Use "Precision" setting for the fill tool
The Precision setting (aka "fill_factor" in DNA) is used increase or
decrease the size of the image buffer for flood fill and thereby
balance accuracy vs. performance. This was not yet implemented in GPv3.

Pull Request: https://projects.blender.org/blender/blender/pulls/122318
2024-05-27 18:24:16 +02:00
Harley Acheson
392ac52ebb UI: Toggle Camera Guides in Viewport Overlays
Allow toggling camera composition guides in the 3DView Overlay popover.

Pull Request: https://projects.blender.org/blender/blender/pulls/121923
2024-05-27 18:16:04 +02:00
Clément Foucault
8aec5f5e91 EEVEE-Next: Precompute AO/GI quality factor
This avoid some ALU in hot loops of expensive shaders.
2024-05-27 18:14:01 +02:00
Clément Foucault
66af5ed445 EEVEE-Next: Add fast GI max distance
This is implemented as a separate parameter from AO
since the AO can be tweaked for the AO pass.
2024-05-27 18:14:00 +02:00
Clément Foucault
8a7b9f6f66 EEVEE-Next: Add option to turn off GI
This new `Method` property allows to replace Diffuse GI
by simple ambient occlusion. This can be desirable for
performance or look.

This doesn't add the memory savings but there are already
some performance gain by using this option.
2024-05-27 18:14:00 +02:00