Commit Graph

106330 Commits

Author SHA1 Message Date
Clément Foucault
856daa13a5 GL: Remove texture storage workaround
# Conflicts:
#	source/blender/gpu/opengl/gl_backend.cc
2024-01-31 18:12:59 +01:00
Clément Foucault
0673ad344c GL: Remove vertex attrib binding workaround
# Conflicts:
#	source/blender/gpu/opengl/gl_backend.cc
2024-01-31 18:12:59 +01:00
Clément Foucault
a1c5a6b077 GL: Remove copy image workaround
# Conflicts:
#	source/blender/gpu/opengl/gl_backend.cc
2024-01-31 18:12:59 +01:00
Clément Foucault
71904d7fb3 GL: Remove image load/store workaround
# Conflicts:
#	source/blender/gpu/opengl/gl_backend.cc
2024-01-31 18:12:59 +01:00
Clément Foucault
64d1f065e3 GL: Remove base instance workaround 2024-01-31 18:12:59 +01:00
Clément Foucault
6722d40fd5 GL: Remove fixed restart index workaround 2024-01-31 18:12:59 +01:00
Lukas Tönne
7e7165b085 GPv3: Basic vertex group operators
Adds vertex groups and basic operator support to the `GreasePencil` data
block.

Vertex groups in the `GreasePencil` ID are used as the source of truth
for vertex groups names and ordering in the UI. Individual drawings also
have vertex group lists, but they should not be modified directly by
users or the API. The main purpose of storing vertex group names in in a
drawing's `CurveGeometry` is to make it self-contained, so that vertex
weights can be associated with names without requiring the
`GreasePencil` parent data.

Vertex group operators are implemented generically for some ID types.
Grease Pencil needs its own handling in these operators. After
manipulating `vertex_group_names` the `validate_drawing_vertex_groups`
utility function should be called to ensure that drawings only contain a
true subset of the `GreasePencil` data block.

Operators for assigning/removing/selecting/deselecting vertices are also
implemented here. To avoid putting grease pencil logic into the generic
`object_deform.cc` file a number of utility functions have been added in
`BKE_grease_pencil_vgroup.hh`.

Fixes #117337

Pull Request: https://projects.blender.org/blender/blender/pulls/117476
2024-01-31 17:45:59 +01:00
Miguel Pozo
f9a0e825c6 Fix #114691: EEVEE-Next: Dithered transparency closure weights
Remove transparency weight from other closure weights.
Since closure weights take transparency into account,
scaling closure colors by their weight applies alpha pre-multiplication to them,
causing dithered transparency materials to be darker than they should be.

Pull Request: https://projects.blender.org/blender/blender/pulls/117675
2024-01-31 17:22:36 +01:00
Sergey Sharybin
8315143c59 Compositor: Allow early abort of OIDN denoiser
This change makes it so the OIDN is listening to the node execution
being cancelled, allowing for a more instant user feedback on the
compositor graph changes. It is especially visible when dealing with
4k images, and using pre-filter on the guiding passes.

Similar implementation to what Cycles does.

This change covers tiles and full-frame compositors.
The GPU compositor needs extra work to have this supported.

Pull Request: https://projects.blender.org/blender/blender/pulls/117698
2024-01-31 17:12:09 +01:00
Hans Goudey
f04bc75f8c Cleanup: Use std::string for some RNA function return values
This significantly simplifies memory management, mostly by avoiding
the need to free the memory manually. It may also improve performance,
since std::string has an inline buffer that can prevent heap
allocations and it stores the size.

Pull Request: https://projects.blender.org/blender/blender/pulls/117695
2024-01-31 17:08:09 +01:00
Lukas Tönne
c180486c83 GPv3: Use RNA properties for modifier influence panels
Some modifiers were still using `BKE_panel_layout_panel_state_ensure` to
create open/close flag properties at runtime. Should register a RNA
property using `rna_def_modifier_panel_open_prop` instead.

Pull Request: https://projects.blender.org/blender/blender/pulls/117697
2024-01-31 16:35:41 +01:00
Clément Foucault
8c02b6eb24 EEVEE-Next: Add normal layer reuse
This allows to save some space in the gbuffer
and improve write performance.

Pull Request: https://projects.blender.org/blender/blender/pulls/117131
2024-01-31 15:36:42 +01:00
Miguel Pozo
ebf9572330 Fix: EEVEE-Next: Remove duplicated translucent weight
It was first added in 5a2aceb671
and again on fdcc8dc689
2024-01-31 15:34:39 +01:00
Philipp Oeser
cbc5d861db Fix #117672: Translation of enum button tooltips broken
Caused by 90c4e2e6ec.

We are now getting the enum item via
`RNA_property_enum_item_from_value_gettexted` (as opposed to
`RNA_property_enum_items_gettexted` prior to 90c4e2e6ec).

The former does not translate the description (whereas the later does)
which I think is just an oversight.

To resolve, now add description translation to
`RNA_property_enum_item_from_value_gettexted`.

Pull Request: https://projects.blender.org/blender/blender/pulls/117693
2024-01-31 14:56:25 +01:00
Jacques Lucke
9ad46ebd2f Cleanup: quiet warning 2024-01-31 14:16:22 +01:00
Jacques Lucke
de991c084b BLI: improve BitVector move constructor
This can potentially lead to a small speedup when the inline buffer
is very large (we don't use that anywhere), but more importantly
also quiets a wrong gcc `-Warray-bounds` warning.
2024-01-31 13:52:50 +01:00
Lukas Tönne
53da2b2d48 Support for enum items parameter in rna_idprop_ui_create
This is an optional parameter for int properties, which then show up as
enum properties.

Included fix: reset ID properties' enum items when the `items` parameter is `None`.

Example usage:
```python
import rna_prop_ui
# Add a regular int property.
rna_prop_ui.rna_idprop_ui_create(D.objects['Cube'], "test", default=123, min=-3, max=500)
# Change to an enum property with items (min/max are ignored).
rna_prop_ui.rna_idprop_ui_create(D.objects['Cube'], "test", default=0, min=-10, max=10, items=[("APPLES", "Apples", ""), ("ORANGES", "Oranges", "")])
# Switch back to regular int property.
rna_prop_ui.rna_idprop_ui_create(D.objects['Cube'], "test", default=1, min=0, max=10)
```

Pull Request: https://projects.blender.org/blender/blender/pulls/117289
2024-01-31 13:27:15 +01:00
Clément Foucault
1524dfa0ad DRW: Workaround Mesa shader compilation
This avoid the following error
`Unknown NIR alu instr: div 32    %17 = ineg %16`

This is a debug shader so cost isn't important.
A bug report will be done upstream.
2024-01-31 13:05:55 +01:00
Jacques Lucke
8ec4f2ada9 Geometry Nodes: add two default items to the Menu Switch node
This is similar to the other Switch nodes and makes the node more
useful by default.
2024-01-31 12:50:08 +01:00
Jacques Lucke
f0f304e240 WM: restart auto-save timer when saving manually
When auto-save is slow it can be very intrusive because it freezes Blender at
unexpected times. Often people have a habit of saving frequently anyway, even
more often than auto-save would. In this case it seems unnecessary to auto-save
as well.

This patch restarts the auto-save timer when the user is saving manually to avoid
the unexpected freeze in many cases.

Pull Request: https://projects.blender.org/blender/blender/pulls/117690
2024-01-31 12:35:56 +01:00
Jacques Lucke
dca80b9bc2 Geometry Nodes: fix linked bake is not loaded 2024-01-31 12:32:27 +01:00
Omar Emara
51aac62006 Fix: Output of Color Ramp node is slightly off
The output of the Color Ramp node in the GPU compositor and EEVEE is
slightly off. That's because the factor is evaluated directly at the
sampler without proper half pixel offsets to account for the sampler's
linear interpolation, which this patch adds.

Pull Request: https://projects.blender.org/blender/blender/pulls/117677
2024-01-31 10:48:46 +01:00
Clément Foucault
58ceeee6f4 Fix: EEVEE-Next: Shader compilation of test shader 2024-01-31 10:40:23 +01:00
Clément Foucault
0ddda9f4b1 EEVEE-Next: Move some renderpass to deferred combined pass
This avoids some complexity inside the material shader.
Also fixes broken light pass that were being colored.

Pull Request: https://projects.blender.org/blender/blender/pulls/117687
2024-01-31 10:36:25 +01:00
Harley Acheson
6cc80f1213 UI: Panel Chevron Positioning
Interface_panel chevron was too low. Bumping it up a bit, but also
leaving a bit lower when open (down).

Pull Request: https://projects.blender.org/blender/blender/pulls/117680
2024-01-31 00:30:05 +01:00
Campbell Barton
7400b0432c Revert "Fix building with Python 3.12"
This reverts commit f9729a311c.

Reverting because this lost the underlying type information of the
constants.
2024-01-31 09:24:40 +11:00
Campbell Barton
f9729a311c Fix building with Python 3.12
Freestyle was using static PyLongObject's which relied on setting the
it's integer value directly. Replace with PyLong_FromLong(..) which
is used everywhere else.

One reference to the internal integer value needed to be kept because
Nature_Type sub-classes PyLong.
2024-01-31 08:49:48 +11:00
Harley Acheson
8d48770418 UI: Consistent Use of Chevron Disclosure Icons
For icons that represent collapsible and collapsed content we use a
variety of icons: chevrons and closed triangles of varying
proportions. This PR makes everything use a chevron for consistency.

Pull Request: https://projects.blender.org/blender/blender/pulls/116240
2024-01-30 22:35:15 +01:00
Hans Goudey
69d2dd0731 Cleanup: Remove unnecessary keywords in C++ headers 2024-01-30 14:56:04 -05:00
Hans Goudey
19e2b13cec Cleanup: Move BKE_key.h to C++ 2024-01-30 14:42:13 -05:00
Clément Foucault
fdcc8dc689 EEVEE-Next: Add missing translucent weight in deferred
This makes mixed translucent BSDF behave correctly.
2024-01-30 20:35:55 +01:00
Clément Foucault
95b523f268 Cleanup: EEVEE-Next: Replace unused Gbuffer struct 2024-01-30 20:35:55 +01:00
Harley Acheson
8f6ee910ba UI: Remove Blender Logo Alert Icon
As discussed in the UI Module Meeting we don't have an acceptable use
case for dialogs that use the Blender logo. Removing this image from
the project since this is now exposed through dialog customization.

Pull Request: https://projects.blender.org/blender/blender/pulls/117676
2024-01-30 20:22:38 +01:00
Miguel Pozo
5a2aceb671 Fix: EEVEE-Next: Add missing translucent weight 2024-01-30 20:15:10 +01:00
Omar Emara
049b0e6539 Compositor: Rewrite and optimize Double Edge Mask node
This patch rewrites and optimizes the Double Edge Mask node to be orders
of magnitude faster. For a 1k complex mask, it is 650x faster, while for
a 1k simple mask, it is only 50x faster.

This improvement is attributed to the use of a new Jump Flooding
algorithm as well as multi-threading, matching the GPU implementation.

The result of the new implementation differs in that the boundaries of
the masks are now identified as the last pixels inside the mask.

Pull Request: https://projects.blender.org/blender/blender/pulls/117545
2024-01-30 19:49:32 +01:00
Omar Emara
316f14b834 Compositor: Unify behavior of Z Combine node across CPU and GPU
The GPU implementation of the Use Alpha option of the Z Combine node
only worked if the first image is closer, since it sampled the alpha
channel from it and used it for mixing. Instead, the mix factor should
depend on the closer pixel, like the CPU implementation.
2024-01-30 18:48:58 +02:00
Omar Emara
5d0b506463 Fix: Z Combine node switches inputs when changing Use Alpha
The Z Combine node switches its inputs when changing the Use Alpha
option if both Z values are equal. That's because the operations used by
the node internally use two different conditions, less than and less
than or equal. This patch fixes that by unifying it to the less than
case.
2024-01-30 18:45:40 +02:00
Jacques Lucke
f358843108 UI: simplify layout panels C++ API
This simplifies the C++ API for making layout panels. Now it is also more similar to the Python API.
`uiLayoutPanel` is like `layout.panel` and `uiLayoutPanelProp` is like `layout.panel_prop`.

Both, `uiLayoutPanel` and `uiLayoutPanelProp`, now exist in two variants. One that takes a label
parameter and one that does not. If the label is passed in, only the panel body layout is returned.
Otherwise, the header and body are returned for more customization.

Pull Request: https://projects.blender.org/blender/blender/pulls/117670
2024-01-30 17:44:56 +01:00
Lukas Tönne
78a0127356 Grease Pencil: Fix opacity modifier vertex weight factor
This should be applied _after_ the opacity bias.
2024-01-30 17:38:30 +01:00
Clément Foucault
953774fab5 Fix: EEVEE-Next: Shader compilation warnings in surfel list
False warnings about variable being used before initialization.
2024-01-30 17:27:00 +01:00
Clément Foucault
39397fd73e Cleanup: EEVEE-Next: Fix compilation warnings in shadow tests
Warnings were variable used before initialization.
2024-01-30 17:27:00 +01:00
Lukas Tönne
237babd2e8 Fix default weight in grease pencil modifiers when vertex group not set
Grease pencil modifiers were using a default weight of 1.0 if the
influence vertex group is not found. Whether or not that is correct
depends on whether a vertex group is set (name not empty). In case the
name is set but the group is not found a weight of zero should be used.
This can happen in GP3 when no vertex is assigned to a vertex group,
since each drawing only has a subset of all the vertex groups.

A utility function was added to make this consistent and less error
prone.

Pull Request: https://projects.blender.org/blender/blender/pulls/117671
2024-01-30 17:19:35 +01:00
Sybren A. Stüvel
236881ff9c Anim: Armature, move notifiers from setters to updaters
Move WM notifiers from property setter functions to
`RNA_def_property_update` call.

This actually makes them work properly, for example setting
`bone_collection.is_solo` from Python now actually updates the armature
in the 3D Viewport. Toggling the property from the UI already worked
(for other reasons, apparently), masking this issue.
2024-01-30 17:12:17 +01:00
Sybren A. Stüvel
f2e7f26072 UI: Tree view, no longer auto-expand clicked item
When clicking on an expandable item in the tree view, it used to
automatically expand that item. This has now been removed; clicking just
makes that item the active one.

This impacts all tree views. The authors of the following ones have been
consulted on this, and all agreed it was a good idea:

- Asset Catalogs
- Bone Collections
- Grease Pencil Layers
- Node Panels
- Light Linking (uses tree view, but just to present a flat list)
2024-01-30 15:57:51 +01:00
Jacques Lucke
c87f235598 Cleanup: make format 2024-01-30 15:14:39 +01:00
Hans Goudey
8d4643af63 Fix: GPv3: Don't ignore influence in thickness modifier
Also make some cleanups in the area, using more standard
variable names and removing an unused include.
2024-01-30 08:44:41 -05:00
Hans Goudey
35f949531f Cleanup: Fix warning of deprecated value in Paint struct
Instead of using the deprecated tag, just add it to the name.
2024-01-30 08:41:58 -05:00
Hans Goudey
29df9e5e14 Fix: Warning about string use after scope in macro 2024-01-30 08:30:57 -05:00
YimingWu
4722c801c5 GPv3: Thickness modifier
Thickness modifier ported to Grease Pencil v3.

Note: Uniform thickness range and UI step changed to better
match new thickness of blender unit.

![image](/attachments/2e9c9bfa-d869-4bec-a529-c3833390a201)

Pull Request: https://projects.blender.org/blender/blender/pulls/117631
2024-01-30 13:04:30 +01:00
Pratik Borhade
ed458b5e69 Fix #113774: Select objects doesn't work for multiple selected Collections
Current method only considers first selected collection in the outliner
tree. This restricts user from selecting objects of multiple selected
collections. To fix this, first gather all the selected collections in
list with the help of `outliner_collect_selected_collections` traverse
function. Then iterate through layer collections to select base/objects

Pull Request: https://projects.blender.org/blender/blender/pulls/113831
2024-01-30 12:30:59 +01:00