Commit Graph

120055 Commits

Author SHA1 Message Date
Campbell Barton
83ffadb248 Cleanup: reduce right-shift 2024-08-28 16:30:57 +10:00
Campbell Barton
b30bbcb17d Cleanup: remove duplicate function call & null check 2024-08-28 15:42:13 +10:00
Harley Acheson
c30d7bb458 UI: Fix Docking Issues for Very Narrow Areas
When docking to very narrow areas it is only possible to dock to a
subset of three zones. This PR corrects mistakes in that code so that
you can correctly dock to tiny areas.

Pull Request: https://projects.blender.org/blender/blender/pulls/126868
2024-08-28 05:32:23 +02:00
Campbell Barton
ab261355ab UI: clarify "show faces" description
The text made it seem the overlay *only* highlighted selected faces
when this applies to unselected faces too.
2024-08-28 13:11:43 +10:00
Harley Acheson
9665b32320 UI: Remove OPTYPE_INTERNAL from SCREEN_OT_area_join
SCREEN_OT_area_join now works when called from a menu item, shortcut,
or quick favorites, so remove OPTYPE_INTERNAL so it can be found in
operator search.

Pull Request: https://projects.blender.org/blender/blender/pulls/126862
2024-08-28 01:56:44 +02:00
Harley Acheson
f40cd831fd UI: Hide Timeline Scrollbars When Very Short
If the Timeline is sized too short to show any of the scrubbing area,
then the scrollbars obscure the time line and current frame marker.
This PR hides the scrollbars in this case. Also for similar cases with
Dope Sheet, Graph Editor, and the embedded Graph Editor/DopeSheet in
Movie Clip Editor.

Pull Request: https://projects.blender.org/blender/blender/pulls/126806
2024-08-27 21:18:10 +02:00
Bastien Montagne
5eb80b1fa0 Refactor: Eyedropper: Use C++ new/delete allocations.
Pretty trivial. Part of the effort to make PointerRNA non-trivial (#122431).
2024-08-27 19:23:44 +02:00
Sybren A. Stüvel
841669c79e Anim: Fix library override on action slot
Assigning an Action slot changes two RNA properties on the `AnimData` struct:
- `action_slot`: pointer property used for the selector in the UI, and
- `action_slot_handle`: int property that's the ground truth of the assigned slot.

With this commit, there will only be an override operation stored for the
`action_slot_handle` property, and the pointer property will be ignored.

This also cleans up some other library overrides related things:
- Disallow overriding slot properties (like the slot name).
- Properly handle slot assignment in the case where the library did not have an `AnimData` at the time of the creation of the override, but when it does when applying the override (in `rna_AnimaData_override_apply()`).

Fixes #125978

Pull Request: https://projects.blender.org/blender/blender/pulls/126828
2024-08-27 18:11:45 +02:00
Sybren A. Stüvel
d3c4760617 Cleanup: expand documentation of Action::assign_id()
No functional changes.
2024-08-27 18:08:45 +02:00
Nathan Vegdahl
72aaecae51 Cleanup: improve some code documentation in the animation code 2024-08-27 17:44:50 +02:00
Alaska
6ccb33e9fe Shader: Add Metallic BSDF Node
Add Metallic BSDF Node to the shader editor.

This node can primarily be used to create more realistic looking
metallic materials than the existing Glossy BSDF node.

This commit does not add any new closures to Cycles, it simply exposes
existing closures that were previous hard to access on their own.

- Exposes the F82 fresnel type that is currently used by the
metallic component of the Principled BSDF. Results should match
between the Metallic BSDF and Principled BSDF when using the same
settings.
- Exposes the Physical Conductor fresnel type that was previously
limited to custom OSL scripts. The Conductor fresnel type accepts
IOR and Extinction coefficients to define the appearance of the
material based off real life measurements.

EEVEE only supports the F82 fresnel type with internal code to convert
the the physical conductor inputs in to a colour format for F82,
which can lead to noticeable rendering differences with
some configurations.

Pull Request: https://projects.blender.org/blender/blender/pulls/114958
2024-08-27 17:20:46 +02:00
Nathan Vegdahl
e3311e48c0 Fix: crash when loading layered animation with channel groups
The issue was that the forward compatibility saving code was setting the
group's `channels` listbase to point at the forward-compatible fcurve
listbase, but the `channels` listbase wasn't later getting cleared when
loading the groups as part of a layered action. In fact, the listbase
pointers were being completely ignored in that case because they aren't
relevant to groups on layered actions, and therefore weren't getting
remapped to the new correct memory addresses of the fcurves.

The end result was that after loading, the group's `channels` listbase
would be non-null and pointing to invalid memory, and there are some
code paths that then try to use that listbase, resulting in a segfault.

This commit fixes the issue by ensuring that the groups' `channels`
listbases are cleared when loading them as part of a layered action.
Additionally, we now also clear them after they're set during
forward-compatibly saving, the lack of which wasn't immediately
causing problems but was nevertheless incorrect.

Pull Request: https://projects.blender.org/blender/blender/pulls/126834
2024-08-27 17:02:18 +02:00
Hans Goudey
6b281264b2 Refactor: Sculpt: Remove PBVH BMesh pointer
Part of #118145.
In order to reduce the purview of the sculpt BVH tree and clarify its
responsibility, replace the geometry back pointer with just passing
the BMesh pointer as an argument where necessary or retrieving it
from the object instead.
2024-08-27 10:59:06 -04:00
Philipp Oeser
6036163e14 Fix #126728: Movie Clip Editor "Sync Visible Range" option not working
True for both `Graph` and `Dopesheet` views in the MCE.

For all other time-based editors, the main region (`RGN_TYPE_WINDOW`) is
of interest to be tagged for syncing `V2D_VIEWSYNC_SCREEN_TIME`. In the
case of the Movie Clip Editor however, the `Graph` and `Dopesheet`
regions in question are of type `RGN_TYPE_PREVIEW`.

So to resolve, we have to take this into account in view2d_sync RNA code

NOTE: this PR does not add versioning code, so any "falsely" tagged
`Graph` and `Dopesheet` view will "loose" the setting (will have to be
enabled again on the "right" region), this could be added though -- it
would be impossible to tell **which**  view exactly, so on each
`RGN_TYPE_WINDOW` encountered, we'd have to then tag **both** `Graph`
and `Dopesheet` afaict

Pull Request: https://projects.blender.org/blender/blender/pulls/126785
2024-08-27 16:54:32 +02:00
Ray Molenkamp
82a4291596 Fix #126798: launcher manifest not linked leading to startup issues
The manifest was not linked, leading blender-launcher not to look in
the blender.crt folder for the vcruntime140.dll. Causing issues for
systems where this binary was not available elsewhere (like pristine
windows installs)
2024-08-27 08:02:20 -06:00
Jeroen Bakker
f19675ffca Vulkan: Incorrect default for missing orco
When orcos are not available in the geometry data it is bound with
a default buffer. This buffer was initialized with only zeros. But
orcos required to read the 0, 0, 0, 1.

Fixes `render/shader/tex_voronoi.blend` render test.

Pull Request: https://projects.blender.org/blender/blender/pulls/126838
2024-08-27 16:00:00 +02:00
Hans Goudey
e7d43d07a1 Sculpt: Specialize some pose fake neighbors calculation
Move the outer loop to happen after the mesh data has been
retrieved. Though this doesn't address the problematic
algorithmic complexity of the algorithm, it should at least
reduce some overhead, and it removes a few more uses of
the `PBVHVertRef` API that we are working to remove.
2024-08-27 09:48:19 -04:00
Bastien Montagne
733ed5dc83 Refactor: Move some UI-related allocations to use C++ new/delete.
Mainly changes some UI-internal structs allocation, and the Panel
runtime custom data storage.

These changes from C-style alloc/free to C++ new/delete are a step
towards making PointerRNA non-trivial (part of #122431).

Pull Request: https://projects.blender.org/blender/blender/pulls/126698
2024-08-27 15:35:18 +02:00
Jeroen Bakker
8e80cfdfd9 EEVEE: Enable Shader Specialization Spatial Denoise
Spatial denoise uses shader specialization. The current shader had
this disabled for OpenGL and Vulkan. As OpenGL and Vulkan supports
shader specialization it is fine to enable them. Would result in
better optimized shaders.

I checked other shaders as well. This was the only one ignoring shader
specialization.

Pull Request: https://projects.blender.org/blender/blender/pulls/126830
2024-08-27 15:30:26 +02:00
Sybren A. Stüvel
f018c4a989 Anim: always allow unassigning the action slot
Setting `id.animation_data.action_slot = None` should always be
possible, even when there is no Action assigned (that is, when
`id.animation_data.action = None`). In that case `.action_slot` should
already be `None`, and so writing its current value should not cause any
errors.

Pull Request: https://projects.blender.org/blender/blender/pulls/126827
2024-08-27 14:53:55 +02:00
Jacques Lucke
51f7936335 Nodes: expose unique identifier for node panels in RNA
This adds a new read-only `persistent_uid` property to `NodeTreeInterfacePanel` in RNA.
This integer remains the same even if the panel is moved around or the file is reopened.
Internally, the property exists already, this patch just exposes it.

Pull Request: https://projects.blender.org/blender/blender/pulls/126797
2024-08-27 13:47:11 +02:00
Omar Emara
96416f5401 Refactor: Abstract away the ShaderOperation class
This patch abstracts away the ShaderOperation class into an asbtract
PixelOperation class, which the ShaderOperation now implemenets. This
makes way for a new subclass that uses FN multi-functions for evaluation
for the new CPU compositor.

Reference #125968.
2024-08-27 14:42:11 +03:00
Pratik Borhade
1dbb88070b Fix #126677: Pin to last is possible on override object modifier
It is possible to change th order of library override modifier with pin
to last option. This breaks the modifier order and also introduces a
copy of modifier after reopening the linked file. To fix this issue,
do not set `PROPOVERRIDE_OVERRIDABLE_LIBRARY` on `use_pin_to_last`
property.

Pull Request: https://projects.blender.org/blender/blender/pulls/126813
2024-08-27 13:41:41 +02:00
Bastien Montagne
7ff1d5d9e4 Fix #82514: Default Value for Viewport Display Color's Alpha Wrong.
For now duplicate default diffuse color values into RNA code too. Sad
work-around, but fixes the problem, until we get rid of hacks like
'interpret 4 consecutive floats in DNA as an array of 4 floats in RNA'.
2024-08-27 13:25:14 +02:00
Jeroen Bakker
660e571969 Vulkan: Recycle resources when rendering in background
When rendering in background there is no swap chain in play and
resources would never be collected. Resulting in out of resources and
crashes.

This PR is an initial fix what cycles resource pools every time a layer
has been rendered. It counts the render hierarchy
(GPU_rendering_begin/end) to identify if the background render is
completed and if so would cycle to the next resource pool.

Pull Request: https://projects.blender.org/blender/blender/pulls/126819
2024-08-27 10:09:53 +02:00
Sean Kim
7e6a401423 Cleanup: Group StrokeCache Displacement Smear variables together
Part of #126672.

Pull Request: https://projects.blender.org/blender/blender/pulls/126724
2024-08-27 04:06:15 +02:00
Jesse Yurkovich
f78d3af9c8 USD: Fix UsdStage leak occurring when python hooks throw exceptions
If a USD python hook throws an exception during processing, the USD
stage ptr is "leaked" because the destructor is not called on the
argument class we pass into the python call.

This leak prevents the stage from reaching a reference count of 0 later
and the file is kept open. All attempts to use the same USD file again
will be met with the following error:
`Coding Error: in _CreateNew at line 617 of C:\db\build\S\VS1564R\build\usd\src\external_usd\pxr\usd\sdf\layer.cpp -- A layer already exists with identifier 'path.usda'`

Instead of passing our class into the call normally, which boost::python
would see as needing to make a copy, use a `ref` instead, bypassing the
problem.

Additional details and repro in the PR. Test coverage to follow.
Pull Request: https://projects.blender.org/blender/blender/pulls/126298
2024-08-27 04:03:30 +02:00
Sean Kim
e27aa63db7 Cleanup: Consolidate clay thumb brush variables
Part of #126672.

* Collects related variables into the `clay_thumb_brush` anonymous struct.
* Use `std::array` instead of raw array for the rolling stabilizer
  average.

Pull Request: https://projects.blender.org/blender/blender/pulls/126719
2024-08-27 03:50:55 +02:00
Sean Kim
b2b1e8e7df Cleanup: Organize Sculpt Paint brush related variables
Moves related variables that are only used by the paint brush into the
existing `paint_brush` anonymous `struct` & removes the `hardness`
property from said `struct` as it is used by most brushes and not just
the paint brush.

Pull Request: https://projects.blender.org/blender/blender/pulls/126712
2024-08-27 03:38:24 +02:00
Sean Kim
2c2b6009c1 Refactor: Restructure mirror modifier sculpt data
Part of #126672.

* Groups related mirror modifier data in an anonymous
  `mirror_mod_clip` `struct`.
* Stores the inverse of the related matrix to avoid having to
  recalculate it multiple times per brush stroke.

Pull Request: https://projects.blender.org/blender/blender/pulls/126717
2024-08-27 03:29:51 +02:00
Bastien Montagne
bb24677a76 Cleanup: Rename CustomData_copy to CustomData_initi_from.
And same for the `copy_layout` function. These functions do not free any
potentially existing data in destination, but expect it to be uninitialized.
Hopefully these new names will make it more clear and avoid bugs like #122160.
2024-08-26 19:11:02 +02:00
Bastien Montagne
ea2f40748c Fix #122160: GPv3: Edit mode Undo memory leak.
`CustomData_copy` expects uninitialized destination customdata, so in
case the destination has been previously initialized, it needs to be
freed with `CustomData_free` first.

Also added related comments to the BKE CustomData API.

Pull Request: https://projects.blender.org/blender/blender/pulls/126794
2024-08-26 18:47:36 +02:00
Omar Emara
b61e618886 Cleanup: Remove unused function 2024-08-26 14:44:36 +03:00
Omar Emara
9c3eb49f8b Cleanup: Compositor: Generalize naming of shader operations
This patch generalizes the naming of shader operations into "Pixel
Operations" to prepare for CPU-side support.
2024-08-26 14:38:10 +03:00
Pratik Borhade
d2c38d3fdc Fix #126535: Missing gamma socket subtype when grouped
When the gamma node is selected and grouped, the gamma socket has
missing float subtype, this is due to the wrong value in `node_declare`.

Pull Request: https://projects.blender.org/blender/blender/pulls/126679
2024-08-26 13:07:36 +02:00
Jeroen Bakker
dc8f5d5b89 Fix #125333: EEVEE: Trigger render step between rendering of samples
EEVEE doesn't trigger a render step between samples which leads to not recycling
memory on Metal backend leading to slower animation rendering and even out of
memory.

This PR uses the same approach as for workbench to solve the issue.

NOTE: Fix needs to be backported to 4.2
Pull Request: https://projects.blender.org/blender/blender/pulls/126781
2024-08-26 12:53:42 +02:00
Jeroen Bakker
78af1722cf Fix #123787: EEVEE: RDNA2 shadow of tiny geom
Workaround for RDNA2 shadow rendering when the geometry it needs
to render is to tiny. In this case the rasterizer can skip triangles
leading to incorrect shadow.

This issue has been forwarded to AMD, but this is a temp workaround
for the current drivers. Note that this workaround adds a performance
penalty of around 50% in selected scenes.

Pull Request: https://projects.blender.org/blender/blender/pulls/126693
2024-08-26 12:45:18 +02:00
Julian Eisel
a57fbe3861 Cleanup: Use const context in tool system API
Pass the context using const where it makes sense. Had some own code
that called some of these functions, so I had to keep context non-const
there too for no good reason.
2024-08-26 10:58:12 +02:00
YimingWu
81870ce418 Cleanup: Use const char* in declaring imb_exr_get_pass().
GCC would give a warning if the argument type does not match.
2024-08-26 13:53:02 +08:00
Campbell Barton
d9cfb9fea2 Fix #126573: Crash calling popups without a "window" set 2024-08-26 12:33:29 +10:00
Campbell Barton
5cb29528e6 Cleanup: spelling in comments 2024-08-26 11:50:15 +10:00
Campbell Barton
9a9df2aad7 Cleanup: use BM_DISK_EDGE_NEXT macro 2024-08-26 11:50:12 +10:00
Campbell Barton
40f96afa61 Cleanup: various non-functional changes
- Use const arguments.
- Remove redundant cast.
- Use ELEM macro.
- Use boolean & nullptr literals.
2024-08-26 11:50:12 +10:00
Campbell Barton
74f240c3ce Cleanup: move assignment to outer loop 2024-08-26 11:43:37 +10:00
Jesse Yurkovich
b265161aea USD: Add more thorough testing of various material setups
Newly validates the following:
- Image mapping transforms on import and export
- Typical normal map setups on import and export
- Alpha-clip node setups on import (was already tested for export)

Pull Request: https://projects.blender.org/blender/blender/pulls/126776
2024-08-26 03:26:32 +02:00
Jesse Yurkovich
6bd515e0d2 Fix: USD: Use correct data type for UsdPreviewSurface normal input
The `normal` input on the UsdPreviewSurface is defined as being of type
`normal3f` rather than a plain old `float3` [1].

Found while adding more test coverage for material reading/writing.

The following could also be seen from `usdchecker` when run over files
produced by Blender:
`Incorrect type for /root/_materials/Material/Principled_BSDF.inputs:normal. Expected 'normal3f'; got 'float3'. (fails 'ShaderPropertyTypeConformanceChecker')`

[1] https://openusd.org/release/spec_usdpreviewsurface.html#preview-surface

Pull Request: https://projects.blender.org/blender/blender/pulls/126747
2024-08-25 05:57:29 +02:00
Harley Acheson
a0df365b77 UI: Add Snapping to Docking Status Bar Entries
While docking, show snapping keys on status bar.

Pull Request: https://projects.blender.org/blender/blender/pulls/126742
2024-08-25 00:31:50 +02:00
Harley Acheson
503cb7bfee UI: Correction to Space Image image_space_name_get
This corrects a small typo in #126584 that results in getting an index
from rna_enum_space_image_mode_items but getting the name from
rna_enum_space_image_mode_all_items.

Pull Request: https://projects.blender.org/blender/blender/pulls/126741
2024-08-24 21:32:17 +02:00
Jonas Holzman
13eb41959e Fix: UI: Editor window(s) title update when using interactive docking
When using Interactive Docking, window titles are not properly updated.
This change makes sure they get updated in `area_join_modal`.

Pull Request: https://projects.blender.org/blender/blender/pulls/126383
2024-08-24 21:08:05 +02:00
Jesse Yurkovich
3a81bde896 Fix #125184: Guard against incorrect material subsets during USD import
USD Meshes and their UsdGeomSubset prims only support "face" element
types but our importer was not checking to ensure this was the case.
Additionally, we should guard against out of range indices being used
in general.

Both situations will now also print an obvious warning level log
statement allowing technical users to better toubleshoot on their own.

Test coverage will be added separately in the near future to ensure
multi-material scenarios are handled correctly.

Pull Request: https://projects.blender.org/blender/blender/pulls/126714
2024-08-24 06:54:43 +02:00