Commit Graph

131808 Commits

Author SHA1 Message Date
sjfricke
c9c01724b9 Vulkan: Add shaderClipDistance feature
Various GLSL shaders use gl_ClipDistance and without the feature
enabled validation layers errors are triggered

Pull Request: https://projects.blender.org/blender/blender/pulls/116530
2024-01-15 15:02:19 +01:00
Hans Goudey
34e39c6b53 Cleanup: Add missing include and forward declaration to DRW header 2024-01-15 08:31:19 -05:00
Hans Goudey
f9fbf832f5 Fix #114244: Smooth operators destroy sharp edge tags
After the replacement of auto smooth with a modifier, sharp edges are
always used, so the "shade smooth", "shade flat", and "smooth by angle"
operators cleared the attribute. However, often users spend significant
time manually tagging edges sharp, and the operators make it too easy to
lose that data.

To keep the old behavior by default, add an option called "Keep Sharp
Edges". Though this can make the operators "ineffective" at their goal
of changing the way the meshes look, or result in redundant data stored
on the mesh, it's a much safer default, especially as users get used to
the new workflow.

Pull Request: https://projects.blender.org/blender/blender/pulls/117069
2024-01-15 14:05:24 +01:00
Thomas Dinges
2975abbf3e Cleanup: Make format 2024-01-15 13:58:17 +01:00
Miguel Pozo
333a5b513b GPU: Assert framebuffer operations match attachment layout
Ensure attachment states and load/store configs don't get out of sync
with the framebuffer layout.
In theory, a Framebuffer could have empty attachments interleaved with
valid ones so checking just the attachments "length" is not enough.
What this does instead is to ensure that valid attachments have a valid
config and that null attachments either don't have a matching config or
have an IGNORE/DONT_CARE one.

Pull Request: https://projects.blender.org/blender/blender/pulls/117073
2024-01-15 13:25:20 +01:00
Bastien Montagne
a4331be6c4 Cleanup: Rename BLI_libblock_ensure_unique_name to use BKE_ prefix.
`BLI_` name was given in some cleanup commit long ago (641d4e2b7f),
assuming this was a mistake...
2024-01-15 13:04:00 +01:00
Campbell Barton
6f3702740b Cleanup: order checks to skip redundant function calls 2024-01-15 22:57:28 +11:00
Pratik Borhade
195bb4f8f5 Fix #115192: Inconsistent behavior renaming data-blocks
This is due to `BLI_findstring` returning wrong id from passed name.
Two IDs can have same name before making them unique so it can return
wrong id. To fix this, pass id argument instead of id_name to
`BLI_libblock_ensure_unique_name` and skip the use of `BLI_findstring`

Pull Request: https://projects.blender.org/blender/blender/pulls/116246
2024-01-15 12:45:45 +01:00
Philipp Oeser
4da32e9334 Fix #106425: Mantaflow guiding with domains is broken
Caused by e968b4197b / 67e23b4b29

Since culprit commits, we are not running `MANTA::initGuiding` /
`fluid_alloc_guiding` if guiding is meant to be pulled from other
domains (it does work with effectors though). This is because atm. only
the `FLUID_DOMAIN_ACTIVE_GUIDE` flag sets `mUsingGuiding` to true
(activated in `update_obstacleflags`, so only for effectors).

So to fix this, we have to ensure that `MANTA::initGuiding` runs (also
if guiding is pulled from domains), but also make sure we dont run into
the crashes from T102257.

It seems that the real reason we were getting crashes in T102257 is that
67e23b4b29 made it so that resetting the cache (including a call to
`fluid_modifier_reset_ex`) in `fluid_modifier_processDomain` happens
**after** `FluidDomainSettings.active_fields` have been updated (this
happens in `update_flowsflags` & `update_obstacleflags`).
But `fluid_modifier_reset_ex` also resets
`FluidDomainSettings.active_fields`. If we then update pointers later in
`fluid_modifier_processDomain`, we never get anything in the guiding
related pointers for the new `mCurrentID` (specifically `mPhiGuideIn`
will be a nullptr). This is the real reason `initGuiding()` runs a
second time (it does once for `fluid_modifier_init` then again as a
consequence of the call to `manta_guiding`).

This patch proposes to move the resetting process from 67e23b4b29
**above** the refreshing of the `FluidDomainSettings.active_fields`,
this way these field stay intact, we do get the first run of
`initGuiding()` from `fluid_modifier_init`, manta pointers get updated
with intact fields afterwards (so we then get a valid `mPhiGuideIn`),
which then prevents the second run from `manta_guiding` to actually call
the python script again.

The fix from e968b4197b is then not needed and reverted in this patch.

This should be good for LTS I think.

Pull Request: https://projects.blender.org/blender/blender/pulls/117067
2024-01-15 12:31:44 +01:00
Miguel Pozo
3feeede7bb Fix: EEVEE-Next: Nvidia compilation error
Workaround for:
error G30CBC1D0: C1317:
qualified actual parameter #3 cannot be converted to less qualified parameter
2024-01-15 12:15:08 +01:00
Bastien Montagne
11158458ce I18N: Updated UI translations from git/weblate repo (24a48aa5c83ddfa2). 2024-01-15 11:59:54 +01:00
acbb91b192 Fix: Anim, replace last arm.collections.all with arm.collections_all
Replace the last occurrences of `arm.collections.all` to
`arm.collections_all`. This has been the API since
015555b07a0aa8fa5e0ca8692eafd2c44dca429e.
2024-01-15 11:36:48 +01:00
Jeroen Bakker
6e2572116d EEVEE: Fix running render tests
Render test would hide objects from probes. It still referred to
the old name of the spherical probes. This change will replace it
with the correct name.

It also hides objects from the planar probes as they were also
recently added.

Pull Request: https://projects.blender.org/blender/blender/pulls/116093
2024-01-15 08:36:56 +01:00
Jeroen Bakker
f4632e1da0 Fix: EEVEE: Potential Read From Unallocated Memory
Generated copies of GLSL sources are kept in a std::string and
it was always accessed by a long living StringRefNull which lead
to potential read from unallocated memory as std::strings are
not null terminated.

Pull Request: https://projects.blender.org/blender/blender/pulls/117120
2024-01-15 08:27:17 +01:00
Damien Picard
299e112d1a UI: improve unit names
This commit tweaks some unit names:

- Remove `name_alt` for square mile "sq m" and cubic mile "cu m" as
  they could easily be confused with meters.
- Correct plural forms for the ton units: rename "ton" to "tonne" for
  the metric ton, and "tonnes" to "tons" for the imperial (short) ton.
  Identifiers are unchanged.
- Swap `name_short` and `name_alt` for metric ton, hour, and second,
  as `name_short` is used for UI display and should use the official
  symbol. Keep the other form as `name_alt` for input.
- Use "t" and "tn" respectively as short names for the metric and
  imperial (short) ton.
- Rename radian's short name "r" to "rad", keep it as alt name.
- Introduce alt names for km/h (kph), arcminutes (amin),
  arcseconds (asec), for convenience.

References:
- https://en.wikipedia.org/wiki/Ton
- https://en.wikipedia.org/wiki/Tonne

Ref: !116762
2024-01-15 18:04:38 +11:00
Campbell Barton
5082b644da Cleanup: use "space_text" prefix for functions taking a SpaceText
Differentiate between utility functions that take a Text & a SpaceText.
Also pass in const arguments.
2024-01-15 15:33:00 +11:00
Campbell Barton
0efb5a39e2 UI: show shortcut for "View Selected" in the pie menu
Remove redundant use_all_regions property in the key-map,
while this isn't wrong it causes the properties not to match
the pie menu item, the shortcut then fails to display.
2024-01-15 14:35:23 +11:00
Campbell Barton
1fd2573b53 Fix #92478: Shortcuts not shown in pie menu tooltips 2024-01-15 14:35:20 +11:00
Campbell Barton
fb532784e1 Docs: add doc-strings for some GPU_matrix functions
Also note the use of flat-array length for PyRNA foreach get/set.
2024-01-15 14:28:37 +11:00
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
Aaron Carlisle
c892260b09 Fix: Formatting
Fixes formatting in abb9fc9b2ff3f756fbf4abb4304d0cd9d4aedbfc
2024-01-14 00:19:53 -05:00
Aaron Carlisle
abb9fc9b2f Tools: Weekly report script ignore commits to .profile repo
Weekly report commits should not be in the list of commits
2024-01-13 20:09:08 -05: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
Campbell Barton
6e9e1557bb Cleanup: tabs to spaces 2024-01-14 11:37:04 +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
Brecht Van Lommel
303c19f736 Fix: API doc build error after adding missing texture_node to context 2024-01-12 17:11:09 +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 635694c0ff8fc5c9828bf920ecb81bb9bf792a82 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