Commit Graph

105939 Commits

Author SHA1 Message Date
Jeroen Bakker
8954099042 EEVEE: Fix Lights On High-res Monitors
When using EEVEE on high resolution monitors the light buffers might not
get initialized as there are range checks that pass in the first try.

- number of tiles needed is larger than the max_tile_count_threshold
- total_word_count is smaller than max_word_count_threshold as it is
  never set (still initialized to zero.

Solution is to not exit on the first try. In a later stage we might want
to use something that doesn't require any looping.

Fixes: #117128
Pull Request: https://projects.blender.org/blender/blender/pulls/117164
2024-01-16 13:29:25 +01:00
Falk David
c4aef91652 Fix: GPv3: Selection not working in crazyspace
The check if the number of layers in the original and evaluated objects match was inverted.
2024-01-16 10:54:58 +01:00
Sybren A. Stüvel
211f6ddd29 Refactor: Anim, add ATTR_WARN_UNUSED_RESULT to some functions
Add `ATTR_WARN_UNUSED_RESULT` to the
`BKE_animsys_eval_context_construct` and
`BKE_animsys_eval_context_construct_at` functions. They are pure
functions, and without using their returned value they are pointless.

No functional changes.
2024-01-16 10:48:44 +01:00
Omar Emara
753c52ba15 Fix: Sequencer crash with scene strip of no composite output
If a scene sequencer strip references a scene with no composite output,
it will crash due to null image buffer output. This patch fixes that by
allocating an empty buffer in those cases.

Pull Request: https://projects.blender.org/blender/blender/pulls/117135
2024-01-16 09:13:30 +01:00
Campbell Barton
a294a9083e UI: don't show property shortcuts in menus
Operator shortcuts aren't shown in this case,
use the same logic for properties.
2024-01-16 14:09:37 +11:00
Hans Goudey
17040a0b24 Fix #117108: Memory leak report with static select engine data
Now that the select engine data uses non-trivial objects in its global
data, storing it at the global scope causes trouble due to arbitrary
construction and destruction order. Instead use the construct on first use
idiom to make the order clear. Though this struct probably shouldn't be
static at all, it does simplify memory management as well, it's nice to
remove the need to manually clear the arrays.

Pull Request: https://projects.blender.org/blender/blender/pulls/117147
2024-01-16 01:55:18 +01:00
Hans Goudey
da5d3c11b6 UI: Consistent capitalization in operator description
The HIG mentions that these descriptions and messages
generally don't capitalize names of specific concepts or things.
2024-01-15 13:30:35 -05:00
Harley Acheson
dc18622572 Fix: Handle Deleted Files in the Recent List
Handle items in the Open Recent list being unavailable. Keep current
overall behavior, but show "File Not Found" on the tooltip.

Pull Request: https://projects.blender.org/blender/blender/pulls/117139
2024-01-15 19:23:01 +01:00
Hans Goudey
3e76a1a6c2 Cleanup: Move BKE_lib_id.h to C++ 2024-01-15 12:44:14 -05:00
Hans Goudey
ca560cd15e Cleanup: Move BKE_undo_system.h to C++ 2024-01-15 12:44:13 -05:00
Sebastian Parborg
5c32b9ad38 VSE: Speed up "Alpha Over/Under" if the pixels are fully transparent or opaque
Before we always did a float conversion of the colors even if we
wouldn't use the result.
Because the float conversion does alpha premultiplication, we can
use some shortcuts to skip a lot of computations

In a edit with a lot of fully transparent pixels, I observed a reduction
in total render time from 1m 31s to 1m 17s.

Pull Request: https://projects.blender.org/blender/blender/pulls/117134
2024-01-15 18:12:51 +01:00
Hans Goudey
78587261da Cleanup: Use standard variable name for mesh face corner normals 2024-01-15 11:39:50 -05:00
Hans Goudey
62dbef895b Mesh: Add missing sharing of cached face corner normals
Sharing of the normals cache between copied meshes was missing from
89e3ba4e25, which under-represented the benefits of the
change. In a simple file where geometry nodes causes a re-evaluation
without changing the normals, this increased FPS from 2.6 to 14.
2024-01-15 11:19:49 -05:00
Thomas Barlow
fdb56c4e8d RNA: Speed up raw array access when the property is stored contiguously
Recent and ongoing efforts have changed many properties to be stored
contiguously in memory, e.g. mesh attributes. This patch updates
rna_raw_access to make use of this and copy the entire contiguous block
of memory when the property is stored contiguously.

This is faster and scales much better with larger arrays.

Pull Request: https://projects.blender.org/blender/blender/pulls/116015
2024-01-15 17:17:02 +01:00
Falk David
35e8959d77 GPv3: Add function to get the index of a layer 2024-01-15 17:01:54 +01:00
Miguel Pozo
ef6b6031de Fix #117123: EEVEE: Broken Specular BSDF
Add missing disable sss flag
2024-01-15 16:57:18 +01:00
Aras Pranckevicius
709b00179f VSE: add Bicubic filtering option, and optimize bicubic performance
Part of overall "improve filtering situation" (#116980) task:

* Add Bicubic filtering option to strip Transform "Filter" setting.
Previously this option only existed in Transform Effect "Interpolation"
setting.
  - With this addition, it feels like the transform effect could
    possibly be marked as legacy/deprecated, since the regular Transform
    that is on all strips can do everything that Transform Effect did?
* Speed up bicubic filtering (used now in VSE, but also in CPU Compositor,
  image paint, etc.) by slightly simplifying the code and using some SIMD.
  Upscaling 96x54 image to 3840x2160 resolution, using Bicubic filtering:
  - Windows (VS2022, Ryzen 5950X): 35.5ms -> 15.1ms
  - Mac (clang 15, M1 Max): 29.6ms -> 24.4ms
* Add gtest coverage for bicubic functionality.

Pull Request: https://projects.blender.org/blender/blender/pulls/117100
2024-01-15 16:38:41 +01:00
Sybren A. Stüvel
21f9fee58f Anim: after deleting bone collection, activate the proper one
Fix an issue where, after deleting the active bone collection, the
incorrect bone collection became the active one.

The solution was to store the active bone collection index before
deletion, instead of after.
2024-01-15 15:58:38 +01:00
Miguel Pozo
c4add0c19a FIx: EEVEE-Next: PlanaProbePipeline gbuffer layout 2024-01-15 15:50:12 +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
Sybren A. Stüvel
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
015555b07a.
2024-01-15 11:36:48 +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
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
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