Commit Graph

120055 Commits

Author SHA1 Message Date
Iliya Katueshenock
4effcd33a3 Fix: Sort Elements node breaks curves sculpt
Since the node effectively changes the topology of the curves,
the deformed positions from before the node must be saved.

Pull Request: https://projects.blender.org/blender/blender/pulls/117109
2024-01-14 21:33:09 +01:00
Hans Goudey
70d28257e7 Cleanup: Use C++ math types for some sculpt variables 2024-01-14 15:28:08 -05:00
Hans Goudey
000e322ae5 Cleanup: Use functional cast for enum in curves sculpt
Also remove unnecessary storage in classes when it can be a local variable.
2024-01-14 15:28:08 -05:00
Hans Goudey
bb080140c0 Cleanup: Sculpt return sampled area normal by value
Use C++ types and std::optional to clarify that the functions can fail.
2024-01-14 15:28:08 -05:00
Hans Goudey
61c99fbd7c Cleanup: Remove unused arguments in sculpt code
After the previous commit, many `Sculpt` arguments are unused, since
they used to be passed to the node intersection tests but not used there.
2024-01-14 15:28:08 -05:00
Hans Goudey
1b6d93d16b Cleanup: Simplify sculpt affected node gathering
- Move functions to C++ namespace
- Use two functions with simpler responsibilities instead
- Use C++ math functions
- Remove arguments structs left over from before C++ transition
- Return ray distance precalculation by value
2024-01-14 15:28:08 -05:00
Richard Antalik
daa0219a57 VSE: Add retiming operator macros
Add retiming_add_freeze_frame_slide and retiming_add_transition_slide
operator macros to move keys after adding, instead of using fixed
duration.
2024-01-14 19:47:49 +01:00
Richard Antalik
a86ed166d7 VSE: Allow mirror axis crossing when moving transition key
Transition retiming keys move as if they are mirrored across a point.
It is possible to allow them to cross this point instead of limiting
transition duration.

This change itself doesn't really improve usability, but it is needed
for "Add transition and change its size" operator.
2024-01-14 19:47:49 +01:00
Jacques Lucke
665cfbe564 Fix #114442: wrong attribute propagation in repeat zone leads to crash
The refactors the code a bit to make the special case handling of the repeat output
node a bit more local to the left-to-right propagation loop.

Pull Request: https://projects.blender.org/blender/blender/pulls/117071
2024-01-14 14:03:55 +01:00
Campbell Barton
c00cd902ce Cleanup: use usernames in code-comments
Also remove my name in a few cases where it doesn't seem necessary.
2024-01-14 11:50:02 +11:00
Campbell Barton
4e898dd944 Cleanup: spelling in comments 2024-01-14 11:42:50 +11:00
Clément Foucault
f2fe21fa2e Cleanup: EEVEE-Next: Deduplicate code 2024-01-14 11:46:27 +13:00
Clément Foucault
1e16d5da67 EEVEE-Next: Clamp reflection probe before downsampling
Use the same clamp parameter as raytracing as it applies
to indirect lighting.
2024-01-14 11:33:17 +13:00
Clément Foucault
813a98d461 EEVEE-Next: Remove specialization workarounds
This enables the full use of specialization constants
and their advantages on Vulkan and OpenGL
2024-01-14 10:28:30 +13:00
Clément Foucault
df8dea9287 Cleanup: GPU: Remove warning about unused parameter 2024-01-13 20:37:11 +13:00
Clément Foucault
f70b8f76e9 EEVEE-Next: Simplify sphere probe storage
- Remove unlimited mip level.
- Make computation of sampling region simpler.
- Add correct mirroring of UV and border region.
- Fix crash when world probe is smaller than lightprobes.
2024-01-13 20:21:47 +13:00
Clément Foucault
29ec924f9f EEVEE-Next: Simplify sphere lightprobe coordinates
The storage coordinate is left unchanged and is
kept as `ReflectionProbeAtlasCoordinate`.
A new structure `ReflectionProbeCoordinate`
contain scale and offset for efficient sampling
without integer math.
The `ReflectionProbeWriteCoordinate` is only used
during the octahedral map processing.

This also has the benefit to centralize the coordinate
changes to a single class.

Pull Request: https://projects.blender.org/blender/blender/pulls/117011
2024-01-13 02:59:36 +01:00
Jason Fielder
dd0482da76 Metal: GPU: Add support for custom shader tuning parameters
Allows specification of per-shader threadgroup memory tuning
to optimise performance through increase of GPU occupancy.

Authored by Apple: Michael Parkin-White

Pull Request: https://projects.blender.org/blender/blender/pulls/115238
2024-01-12 22:07:46 +01:00
Campbell Barton
cc8c1f882a Cleanup: remove redundant call to set the paint brush 2024-01-13 08:00:16 +11:00
Germano Cavalcante
3dbbe7246a Fix: leak in edit mesh snap cache when changing shapekeys
Do not use `BMEditMesh` as key as it is freed when changing shape-keys.
2024-01-12 17:36:46 -03:00
Jesse Yurkovich
24964575e7 Fix #116317: Ensure that USD materials reside in a Prim Scope
There's been feedback that placing them inside a Scope better aligns
with other DCCs and makes some aspects of tooling more consistent in the
ecosystem.

Note: it was not a spec violation to have the typeless def that we used
before.

Pull Request: https://projects.blender.org/blender/blender/pulls/116460
2024-01-12 20:31:40 +01:00
Harley Acheson
458ef077c9 UI: Don't Emboss Within a Stack of Buttons
Only emboss individual buts or the bottom of a stacked group.

Pull Request: https://projects.blender.org/blender/blender/pulls/116921
2024-01-12 19:58:42 +01:00
Thomas Barlow
5139a9c064 Fix: foreach_get/set does not work on multidimensional arrays
The foreach_get/foreach_set methods of bpy_prop_array get/set the entire
contents of the array, but they were checking that the length of the
input sequence was equal to the length of the current array dimension
rather than the total length of all dimensions of the array.

This would read/write memory after the end of the passed in sequence
when the property was a multidimensional array. Performing
`foreach_get` with a Python list with length matching the length of the
current dimension of a multidimensional array would crash a debug build
due to the trailing pad bytes of the temporarily allocated array being
overwritten.

This patch fixes `pyprop_array_foreach_getset` by changing the function
used to get the expected sequence size, to the RNA function that gets
the total length of the array across all its dimensions.

The tests have be updated to additionally test multidimensional array
properties.

Pull Request: https://projects.blender.org/blender/blender/pulls/116457
2024-01-12 18:38:32 +01:00
Aras Pranckevicius
9c7b3659e2 VSE: speed up solid color effect
It's pretty simple, but threading it, and making it write out whole
pixel at a time (instead of one byte at a time) still makes it faster.

4K resolution, five Color strips blended over each other, playback on
Windows/VS2022, Ryzen 5950X:
- Playback 9.2FPS -> 11.5FPS
- do_solid_color for one effect, median time 7.7ms -> 3.8ms

Additionally, the solid color on byte output was not doing float->byte
color rounding & clamping properly, and on float output it was writing
255.0 into alpha instead of 1.0. So fix that too.

Pull Request: https://projects.blender.org/blender/blender/pulls/117058
2024-01-12 18:04:38 +01:00
Aaron Carlisle
67b21ce54d UI: Clarify Liquid Diffusion/Viscosity Properties
The viscosity panel was confusing for users because viscosity
is defined by the base and exponent properties in the Diffusion panel.

What this setting actually does is use a special solver algorithm that is designed for high viscosity liquids.
See 635694c0ff for details.

The below changes are designed to better represent this to the user.

- Move the "Viscosity" Panel to a sub panel of "Diffusion"
- Rename "Viscosity" to "High Viscosity Solver" to better represent what this property does
- Update `use_viscosity` tooltip to better explain that this uses a different solver algorithm.

Pull Request: https://projects.blender.org/blender/blender/pulls/116118
2024-01-12 16:55:05 +01:00
Damien Picard
17b32e1d0d Python API: Add new method to move view layers
This commit adds a new method Scene.view_layers.move(). It acts the
same as Object.modifiers.move(), taking two arguments from_index
and to_index.

Pull Request: https://projects.blender.org/blender/blender/pulls/117037
2024-01-12 16:34:37 +01:00
Christoph Lendenfeld
37421d12bd Fix #73524: Autokey inserts keyframes into the driver FCurve
When autokeying a property with a driver, the code added
the keyframe into the drivers FCurve.

Judging by the code the intention was to be able to quickly
set up driven keys by modifying the driven value and have that
reflected in the driver curve.

However that idea was blocked by the fact that you can't actually
change the value of a property that is driven.
In addition to that it's quite unexpected and the result is hardly
communicated to the user.

The solution is to not insert keyframes to drivers using the
autokeying system.

Also Fixes #95866

This was discussed in the A&R module meeting
https://devtalk.blender.org/t/2024-01-11-animation-rigging-module-meeting/32888#patch-review-decision-time-5
and the consensus was the feature to set up driven keys would be great,
 but since it's not working at all currently it's better to get rid of the bugs.

Pull Request: https://projects.blender.org/blender/blender/pulls/116927
2024-01-12 16:33:43 +01:00
Bastien Montagne
4fe4a52cd7 Fix missing tagging of collections in some BKE_collections codepath.
In particular, while Object (un)linking was already tagged in relevant
BKE code, collection (un)linking was not in several cases.

This was (partially) done by user code, though almost never for the
whole hierarchy of parents.

Technically, the tag is done as part of
`collection_object_cache_free_parent_recursive`/`collection_object_cache_free`,
since currently clearing this cache is done everytime to collection
hierarchy or their content is modified.

It also removes `collection_tag_update_parent_recursive`, which was
already doing something similar, but was only called from code
adding/removing objects to collections, and was walking the same parent
hierarchy as `collection_object_cache_free_parent_recursive`.

This commit implements the decision made in #116601, to tag modified
data as close as possible from the code modifying it.

---------------------

This has an impact on deg tagging, which takes over twice as much cycles
with this commit compared to previous code  when opening a Pets production
file with several liboverrides (`deggraph_id_tag_update_single_flag` goes
from less than 0.03% to over 0.06%).

The overhead remains extremely low though, and is totally unmeasurable in
global execution timing. Timing of the liboverride processing on opening
the production file also did not show any measurable differences.

Pull Request: https://projects.blender.org/blender/blender/pulls/116986
2024-01-12 16:24:22 +01:00
Thomas Barlow
2a97516610 RNA: Use PROP_RAW_BOOLEAN with single-byte PROP_BOOLEAN raw types
The PROP_RAW_BOOLEAN raw type exists, but was only used as a fallback in
bpy_rna.cc#foreach_getset to help construct an input RawArray for
PROP_BOOLEAN properties without raw access.

Using the PROP_RAW_BOOLEAN raw type for PROP_BOOLEAN properties where
possible will make it so that almost all PROP_BOOLEAN properties are
considered compatible with bool buffers in bpy_rna.cc#foreach_getset,
which should simplify efficient access to bool properties of collection
items with bpy_rna.cc#foreach_getset.

Only about 50 PROP_BOOLEAN properties have raw access because most
either don't use #RNA_def_property_boolean_sdna or use a bitmask, which
disables raw access. Even fewer of these properties belong to a
StructRNA used by a collection property with raw access.

PROP_BOOLEAN properties with raw access, but which use a type larger
than a single byte are rarer still, and will remain using their existing
raw type because they cannot have raw access as bool.

Pull Request: https://projects.blender.org/blender/blender/pulls/116673
2024-01-12 16:04:47 +01:00
Tomoaki Kawada
da685008be Fix: Align buttons context's dir with actually present attributes
Pull Request: https://projects.blender.org/blender/blender/pulls/116556
2024-01-12 16:02:19 +01:00
Bastien Montagne
5877d1e396 Fix #116029: Regression: Ctrl+Z breaks vertex paint.
In the end it was a dummy mistake in own 94e6ab6d71 refactor, which
broke the 'restore on undo' case for ID pointers when the old and new
pointers remain exactly the same.

Many thanks to Campbell (@ideasman42) for investigating and identifying
the actual issue.
2024-01-12 15:54:54 +01:00
Philipp Oeser
0061f2f650 PyAPI: add preferences.filepaths.asset_libraries.new/remove methods
Can be convenient to do this from python (e.g. afaict, these preferences
are not used from Application Templates userpref.blend, but could now at
least be configured via the template script __init__.py)

Pull Request: https://projects.blender.org/blender/blender/pulls/116381
2024-01-12 15:42:37 +01:00
Philipp Oeser
5f26858931 Fix #116848 : Mask handles set to "Free" ignore theme color
Reason is that `.handle_free` and `.handle_sel_free` are never really
defined as RGBA defaults in `U_theme_default` `.space_image` (nor
`.space_clip` and `.space_graph` ) with full alpha (as opposed to the
other handle types).

If we read these with `immUniformThemeColor` then we are ending up with
with zero alpha.

So in the Image Editor or Movie Clip Editor, we only see the grey
"Outline" (if the mask display is set to this - which is by default),
the handles themselves are in visible, making it look like those were
always drawn in grey and the Preference would have no effect.

We also dont really have a preference color defined for free handles
(they are set to black).

So there are two possible solutions:
- [1] come up with a good color, define as RGBA default in
`U_theme_default` and overwrite user Preferences in `do_versions_theme`
(with a version bump)
- [2] read existing Preferences with `immUniformThemeColor3` (instead of
`immUniformThemeColor`) to work around the alpha problem

This patch uses the second (and less disruptive) solution.

Pull Request: https://projects.blender.org/blender/blender/pulls/116898
2024-01-12 15:42:00 +01:00
Christoph Lendenfeld
f24b7749b5 Refactor: keyingsets.cc
No functional changes.

Clean up the code by:
* renaming variable `ks` to `keyingset`
* renaming variable `ksi` to `keyingset_info`
* renaming variable `ksp` to `keyingset_path`
* moving variables closer to where they are used
* making variables const if possible
* use `LISTBASE_FOREACH_MUTABLE` where applicable
* Fix comment style
* Remove comments that provide no extra information

Pull Request: https://projects.blender.org/blender/blender/pulls/117062
2024-01-12 15:14:09 +01:00
Jeroen Bakker
d6f98dbd3f Cleanup: Make format 2024-01-12 15:14:00 +01:00
Jonas Holzman
15c0a1eaf5 Python API: Make Screen.show_fullscreen true also in fullscreen mode
Previously it would only do this in maximized mode, not the full fullscreen
mode which was confusing.

Pull Request: https://projects.blender.org/blender/blender/pulls/116788
2024-01-12 15:09:24 +01:00
Jason Fielder
7eee954d9d Fix #116216: Only support Memoryless texture flag on TBDR GPUs
Change limits MTLStorageModeMemoryless to device which
support this feature.

Authored by Apple: Michael Parkin-White
Pull Request: https://projects.blender.org/blender/blender/pulls/116250
2024-01-12 15:08:46 +01:00
Hans Goudey
3da4df6856 Fix: Broken sculpt face set undo restore after recent cleanup
Mistake in a76b2bfbcc. Resolves #117022
2024-01-12 08:54:37 -05:00
Hans Goudey
bf6eda3073 Fix: Build error from renamed header 2024-01-12 08:37:27 -05:00
Iliya Katushenock
37b2c12cfa Geometry Nodes: Sort Elements node
Implements the design in #109983

Pull Request: https://projects.blender.org/blender/blender/pulls/114194
2024-01-12 14:30:34 +01:00
Jeroen Bakker
4ac0267567 OpenGL: Specialization Constants
This PR adds support for specialization constants for the OpenGL
backend. The minimum OpenGL version we are targetting doesn't
have native support for specialization constants. We simulate this
by keeping track of shader programs for each set of specialization
constants that are being used.

Specialization constants can be used to reduce shader complexity
and improve performance as less registry and/or spilling is done.

This requires the ability to recompile GLShaders. In order to do this
we need to keep track of the sources that are used when the shader
was compiled. For static sources we only store references
(`GLSource::source_ref`), for dynamically generated sources we keep
a copy of the source (`GLSource::source`).

When recompiling the shader GLSL source-code is generated for the
constants stored in `Shader::constants`. When compiling the previous
GLSource that contains specialization constants is then replaced
by the new version.

Pull Request: https://projects.blender.org/blender/blender/pulls/116926
2024-01-12 14:28:50 +01:00
Iliya Katushenock
23122338cb Nodes: debug print for bNodeTreeZones
Pull Request: https://projects.blender.org/blender/blender/pulls/116903
2024-01-12 13:56:28 +01:00
Antonio Vazquez
814ff41ed5 GPv3: Add Assign material menu
Adds a menu to assign a material from a list as is in GPv2.

Related to #114190.

Pull Request: https://projects.blender.org/blender/blender/pulls/114637
2024-01-12 13:40:00 +01:00
Damien Picard
3bd41cf9bc I18n: Go over TIP_ and IFACE_ usages, change to RPT_ when relevant
The previous commit introduced a new `RPT_()` macro to translate
strings which are not tooltips or regular interface elements, but
longer reports or statuses.

This commit uses the new macro to translate many strings all over the
UI.

Most of it is a simple replace from `TIP_()` or `IFACE_()` to
`RPT_()`, but there are some additional changes:
- A few translations inside `BKE_report()` are removed altogether
  because they are already handled by the translation system.
- Messages inside `UI_but_disable()` are no longer translated
  manually, but they are handled by a new regex in the translation
  system.

Pull Request: https://projects.blender.org/blender/blender/pulls/116804

Pull Request: https://projects.blender.org/blender/blender/pulls/116804
2024-01-12 13:37:32 +01:00
Damien Picard
5db82be74f Fix #76101: I18n: add new preference to translate reports
Translation of the UI is currently split into 3 preferences:
interface, tooltips, and new data. The distinction between interface
and tooltips is currently unclear as tooltips also include a lot of
messages not displayed in the actual tooltips on mouse hover.

These include reports to the Info Editor, information in editor
headers and footers, and statuses in panels.

In order to limit the use of `TIP_()` to actual tooltips, this commit
introduces a new preference for this extra information: "Reports".

New translation macros are introduced: `RPT_()` and `CTX_RPT_()`, as
well as their equivalent for the Python API, `pgettext_rpt_()`, to be
imported as `rpt_()`.

Pull Request: https://projects.blender.org/blender/blender/pulls/116804
2024-01-12 13:37:29 +01:00
Iliya Katueshenock
ff38836c93 GP3: Select Alternate: Speedup
Implementation change to better use cache by using simpler operation in main loop.
Also avoiding module operations from the loop over all points (module is costly).
On small drawings, the increase can reach 2x.

- Small size of curves / low amount of points (50 curves, size = curve_index) (50 repeats):
  - Timer 'Old': (Average: 2277 ns, Min: 1900 ns, Last: 2000 ns).
  - Timer 'New': (Average: 1314 ns, Min: 1000 ns, Last: 1200 ns).
- 5000 curves, 1000 points. Multithreading is used (50 repeats):
  - Timer 'Old': (Average: 1.1 ms, Min: 0.9 ms, Last: 1.1 ms).
  - Timer 'New': (Average: 0.7 ms, Min: 0.5 ms, Last: 0.6 ms).
- 5000 curves, 1000 points. Multithreading is disabled (50 repeats):
  - Timer 'Old': (Average: 9.2 ms, Min: 5.6 ms, Last: 15.5 ms).
  - Timer 'New': (Average: 7.7 ms, Min: 4.4 ms, Last: 8.5 ms).

Benchmark branch: 1a7d622483/source/blender/editors/curves/intern/curves_selection.cc (L267)

Pull Request: https://projects.blender.org/blender/blender/pulls/110279
2024-01-12 13:06:30 +01:00
Omar Emara
e84dc990b1 Realtime Compositor: Implement Vector Blur node
This patch implements the Vector Blur node for the Realtime Compositor.
The implementation is a direct and mostly identical port of the EEVEE
motion blur implementation with the necessary adjustments to make it
work with the compositor.

The exposed parameters in the node does not match those exposed in
EEVEE, so only the parameters shared between both are currently
implemented. In the future, we should make a decision to either unify
both, or just consider them independent implementations, with the
possibility of sharing the full or part of the code.

Further, it would also make sense to port the implementation to the CPU
compositor, since the new implementation is higher in quality while also
being faster.

The default value of the node shutter setting was changed to 0.25 to
approximately match the default settings of EEVEE and Cycles, since in
their default settings, they evaluate the previous and next frames at
plus and minus 0.25.

Pull Request: https://projects.blender.org/blender/blender/pulls/116977
2024-01-12 12:12:01 +01:00
Antonio Vazquez
c964b79edf GPv3: Copy Materials to Selected operator
Conversion of GPv2 operator to duplicate materials between grease pencil objects.

Pull Request: https://projects.blender.org/blender/blender/pulls/115535
2024-01-12 11:20:35 +01:00
Bastien Montagne
da1ed32f76 Fix #116734: Measure Tool Undo crash.
The ruler code would add new (GP) ID and link it to current scene outside
of any depsgraph tagging and/or undo step writing.

Now always add this 'util' GP data earlier, in a context where there is a clear
undo step written. Also fixes the missing tagging and relations updates.

Pull Request: https://projects.blender.org/blender/blender/pulls/116751
2024-01-12 11:13:41 +01:00
Casey Bianco-Davis
33b4964c0c GPv3: Sample color
This adds the ability to use the `sample color` operator in GPv3

Pull Request: https://projects.blender.org/blender/blender/pulls/116235
2024-01-12 11:11:55 +01:00