Commit Graph

120055 Commits

Author SHA1 Message Date
Hans Goudey
c87e51790d Cleanup: Make format 2024-01-31 22:01:30 -05:00
Hans Goudey
ed500d93b4 Cleanup: Pass const context to asset function 2024-01-31 21:18:09 -05:00
Hans Goudey
fac27b1b6b Cleanup: Replace most used of SWAP macro with std::swap
Also remove / replace use of the math vector double swapping functions.
2024-01-31 21:12:16 -05:00
Philipp Oeser
33fc594da1 Fix #117679: operator_menu_enum crashes for an unfound property
Caused by d6a6c3e1fc.

Code from d6a6c3e1fc was trying to get enum items for a property even if
the property itself was not found.

Now return early here (same as to how an early return happens if the
operator was not found).

Pull Request: https://projects.blender.org/blender/blender/pulls/117691
2024-02-01 01:50:55 +01:00
Harley Acheson
93562a1cc5 UI: Image Rotate
Operator to rotate images in 90 degree increments.

Pull Request: https://projects.blender.org/blender/blender/pulls/117352
2024-01-31 23:36:28 +01:00
Hans Goudey
9c3aa8b824 Cleanup: Use StringRef arguments for some UI button functions
The benefits are O(1) access to the string size, clearer ownership,
and easily accessible utility functions. For now, only change functions
where the string is clearly non-null. It's not clear in what cases some
other functions recieve null strings.
2024-01-31 17:16:25 -05:00
Hans Goudey
5fa61ee620 Cleanup: Move remaining spreadsheet editor code to C++ namespace 2024-01-31 16:32:10 -05:00
Hans Goudey
1934075d97 Fix: Memory leak in gizmo tooltip function 2024-01-31 16:05:57 -05:00
Sean Kim
b0063a4690 Cleanup: Perform cleanup on sculpt_automasking.cc
* Add documentation / comments
* Apply const where possible to cache_init function codepath
* Minor cleanup of conditionals and initialization

Contains changes that were deferred from #117316

Pull Request: https://projects.blender.org/blender/blender/pulls/117651
2024-01-31 21:43:02 +01:00
Hans Goudey
7b77ba3cde Cleanup: Make format 2024-01-31 14:28:38 -05:00
Hans Goudey
02895d342c Cleanup: Small changes to asset shelf code
- Remove unnecessary use of "shelf" namespace inside that namespace
- Remove unused function declaration
- Don't bother passing a pointer to a pointer to the region data,
  that didn't accomplish anything and added unnecessary complexity
2024-01-31 14:25:21 -05:00
Hans Goudey
7fa5fc02b7 Cleanup: Move BLF headers to C++ 2024-01-31 14:04:56 -05:00
Hans Goudey
e89b4927e4 Cleanup: UI: Remove unused button creation functions 2024-01-31 13:45:26 -05:00
Hans Goudey
2571bb18be Cleanup: UI: Remove unnecessary function for setting button string 2024-01-31 13:42:57 -05:00
Hans Goudey
ac42aaafb1 Fix #117661: Knife Project crashes
KnifeTool_OpData is now non-trivial and needs to initialized properly
when allocated.
2024-01-31 13:31:39 -05:00
Julian Plak
38e7b4e473 Geometry Nodes: Improve attribute text overlay readability
Improve readability for GN Viewer Node attribute text by adding text
shadow. Also adds similar shadow for bone names.

Pull Request: https://projects.blender.org/blender/blender/pulls/116528
2024-01-31 19:21:49 +01:00
Richard Antalik
fa6384eb39 Fix #92140: Can't assign shortcuts to tools
Set operator context for VSE tool panel and pass correct
space_type and region_type to WM_keymap_find_all().

Pull Request: https://projects.blender.org/blender/blender/pulls/105959
2024-01-31 19:04:09 +01:00
Hans Goudey
a1792e98a4 Cleanup: Use std::string for RNA path functions
Use an optional string instead of a manually allocated char pointer.
Optional is used because sometimes `nullptr` was returned. It's
still inconsistent though, because often "" or ".." was returned
instead.
2024-01-31 13:00:28 -05:00
Hans Goudey
b720891288 Cleanup: General C++ cleanup for internal RNA headers 2024-01-31 13:00:28 -05:00
Hans Goudey
de26427bb1 Cleanup: Move internal RNA headers to C++ 2024-01-31 13:00:28 -05:00
Richard Antalik
8a96f0fb06 Fix #116411: Sound animation not working correctly
This was caused by global variable `sound_cfra` not being updated when
rendering sequencer data. This global variable could cause problems in
other cases though, so it is removed. Functions that are used to set
anomation buffers now accept frame as argument.

Pull Request: https://projects.blender.org/blender/blender/pulls/117345
2024-01-31 18:57:06 +01:00
Richard Antalik
048cece74d UI: Show folders when selecting font
On some systems, fonts may be categorized in folders, in which case user
sees nothing by default.

Pull Request: https://projects.blender.org/blender/blender/pulls/117389
2024-01-31 18:56:24 +01:00
Clément Foucault
c0c3565714 GL: Remove geometry shader invocations workaround
# Conflicts:
#	source/blender/gpu/opengl/gl_backend.cc

# Conflicts:
#	source/blender/gpu/opengl/gl_shader.cc

Pull Request: https://projects.blender.org/blender/blender/pulls/116600
2024-01-31 18:13:02 +01:00
Clément Foucault
1ddc35ac88 GL: Remove texture gather workaround
# Conflicts:
#	source/blender/gpu/opengl/gl_backend.cc

# Conflicts:
#	source/blender/gpu/opengl/gl_shader.cc
2024-01-31 18:12:59 +01:00
Clément Foucault
749a3880de GL: Remove cube map array workaround 2024-01-31 18:12:59 +01:00
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