Commit Graph

103705 Commits

Author SHA1 Message Date
Guillermo Venegas
4f6785774a UI: Fix scrollbar highlighting outside of regions
Remove scrollbar influence when the mouse cursor is outside
of that region.

Pull Request: https://projects.blender.org/blender/blender/pulls/105973
2023-08-22 00:47:11 +02:00
Germano Cavalcante
c02f2f4947 Fix #109454: Snapping from Tools doesn't work if Depth option is not Surface
Regression introduced in 69d6222481.

In that commit the `Depth` option of the placement started to override
the snap toggle. So only the `Suface` value had snap.

This commit also changes the behavior when triggering Placement.
Previously, snapping was forcefully enabled (in the case of `Surface`)
and snapping elements other than Face were used.

Now snap is only enabled if toggle is enabled.
2023-08-21 15:24:47 -03:00
Jesse Yurkovich
baa8f663a2 Fix (unreported) nullptr access in BKE_fcurve_handles_recalc_ex
Don't access fields of the potentially null `FCurve` struct before it's
been validated.

Pull Request: https://projects.blender.org/blender/blender/pulls/111315
2023-08-21 20:15:22 +02:00
Germano Cavalcante
5da64ff596 Fix #111355: Crash when calling operator 'TEXT_OT_save'
Crash occurs when calling with `EXEC_DEFAULT` context.

In this case `text->filepath` might be `nullptr` and cause a crash.

Fix by raising a Python error message in this case.
2023-08-21 15:10:42 -03:00
Richard Antalik
9269afda59 Fix VSE strip text crashing on assert
Rectangle of text drawn on strip could be inverted, which triggered
assert in `UI_view2d_view_to_region_rcti_clip()`.

This was because scrollbar width was added to left side of rectangle.
Since now scrollers are drawn on right side, this offset is replaced
with same offset as is used for strip handles. Both sides of rectangle
are clamped to same range, so it will not get inverted.
2023-08-21 18:26:09 +02:00
Habib Gahbiche
7d9214d30f Cleanup: i18n: remove extraction macro from some geometry nodes
Followup to #107258. Change was missed because development of
Kuwahara filter started before #107258 landed.

Pull Request: https://projects.blender.org/blender/blender/pulls/111151
2023-08-21 16:48:24 +02:00
Germano Cavalcante
f1c6d61854 Fix #111342: Auto Perspective locks viewport into camera
In 384c2e1f36 it was assumed that `VIEWOPS_FLAG_PERSP_ENSURE` only
takes effect if Auto Perspective is enabled in preferences.

But that option is still required in camera view mode.

Therefore always set `VIEWOPS_FLAG_PERSP_ENSURE` if a navigation mode
requires it.

And add a comment explaining the reason.
2023-08-21 11:19:02 -03:00
Miguel Pozo
f57a8f07c0 Fix: EEVEE-Next: World Volume compilation error
Add missing model matrix.
2023-08-21 15:48:48 +02:00
Lukas Tönne
ea3d85b9d7 Node panels: RNA for node group interfaces
Part 2/3 of #109135, #110272

Defines the RNA API for the new node tree interfaces.

The bulk of the RNA definition lives in `rna_node_tree_interface.cc`. The legacy socket interfaces remain in place and will be removed later.

Since the socket items share the `bNodeSocketValueXXX` structs with the `bNodeSocket` types they also use the same RNA. The `rna_def_node_socket_interface_subtypes` function is exposed so that when defining the interface RNA it can use the same code as the regular socket RNA.

Pull Request: https://projects.blender.org/blender/blender/pulls/110952
2023-08-21 15:40:19 +02:00
Bastien Montagne
f052b18a65 Always clear 'fake user' flag from linked data.
Using this flag from linked data is always a double-edge sword, in one
end some user have been relying on it to keep around data that is not
really used as ID (like e.g. text data-blocks, node trees, see
e.g.  #103687, #105687). On the other end, it often causes over-keeping
of linked data reference in production files.

From now on, when an unused linked data is to be kept around, users
should create an ID property to reference it.

Implements #106321.

Pull Request: https://projects.blender.org/blender/blender/pulls/111042
2023-08-21 15:33:25 +02:00
Alaska
7f65080ab4 Fix #111277: NaN in Vector Displacement leading to render errors
Fixes NaN in Vector Displacement node caused by the normalization of
0, 0, 0 vectors.

This fixes both visual rendering issues and an "illegal address" error
on the GPU. The "illegal address" error came from the Light Tree
Sampling code not handling the NaN normals well, leading to weird code
paths being taken, eventually leading to a kernel_assert and a
user facing illegal address error.

Pull Request: https://projects.blender.org/blender/blender/pulls/111294
2023-08-21 15:22:03 +02:00
Jeroen Bakker
785e03b13f Cleanup: Reduce VKDebug Messenger Complexity
Reduces the complexity of VKDebug messenger_callback.
2023-08-21 15:03:33 +02:00
Bastien Montagne
b3c7f3c8a9 UI: Add initial UI support for ID pointers custom properties.
Customprops to IDs are supported since years through code, but were
never exposed directly in the UI of customporperties.

This commit mainly:
* Adds a new `DATA_BLOCK` type to UI customprops types.
* Exposes the existing `id_type` settings to python API.

Pull Request: https://projects.blender.org/blender/blender/pulls/110458
2023-08-21 14:14:26 +02:00
Amelie Fondevilla
3dc93d6e38 GPv3: Display layer groups in grease pencil dopesheet
This patch adds a new type of channel for grease pencil layer groups, which works as an expandable summary channel of layers inside the group.

Pull Request: https://projects.blender.org/blender/blender/pulls/111015
2023-08-21 10:51:00 +02:00
Jeroen Bakker
9df5f2c495 Vulkan: Indirect Drawing
This PR implements indirect drawing for the Vulkan backend. Indirect
drawing is a requirement for workbench-next.

NOTE: that this is one of multiple changes needed to get to the same
support level. With this patch only objects at the center of the world
are drawn correctly.

Pull Request: https://projects.blender.org/blender/blender/pulls/111334
2023-08-21 08:55:55 +02:00
Campbell Barton
eee33ce2df Cleanup: replace strcpy with BLI_strncpy 2023-08-21 11:09:18 +10:00
Campbell Barton
1c7adc61ae Cleanup: de-duplicate comments & expand on why UV's are clipped 2023-08-21 10:36:41 +10:00
Campbell Barton
33a05725be Cleanup: spelling in comments 2023-08-21 10:05:45 +10:00
Clément Foucault
65f91bd53a Fix: DRW: Broken debug decimal display
This is a temporary fix. A better fix
that display the non-scientific notation
would be better.
2023-08-20 17:52:48 +02:00
Clément Foucault
b4b5977aed DRW: Guard debug lib using defines
This allows adding debug calls to library
sources and not trigger an error for
all shaders that reference the lib.
The particular shader that need to use
it can set `drw_debug_print_enable` and
`drw_debug_draw_enable` in their main file
and it will trigger the injection of the
debug functions.
2023-08-20 17:52:48 +02:00
Hans Goudey
39a40d6f84 Cleanup: Subdiv: Replace "stack or buffer" storage with C++ classes
Blender's C++ data structures have configurable inline buffers used to
avoid allocation when the needed size is small. Use them in multires
code instead of an uglier C solution.

Pull Request: https://projects.blender.org/blender/blender/pulls/111070
2023-08-20 00:25:45 +02:00
Harley Acheson
b25b13a90b Fix #111278: UI Text Extension of Selection
Recent refactors could cause movement of selection endpoints when
extending (holding shift). This ensures that only the cursor side moves
during selection extension.

Pull Request: https://projects.blender.org/blender/blender/pulls/111288
2023-08-19 19:19:57 +02:00
Campbell Barton
5a8cb665e0 Cleanup: various non-functional C++ changes 2023-08-19 23:52:47 +10:00
Campbell Barton
faa3ef6ad5 Cleanup: format 2023-08-19 23:52:47 +10:00
Campbell Barton
4f72240c1d Cleanup: spelling (correct correction), update dictionary 2023-08-19 20:19:13 +10:00
Campbell Barton
20b4a77872 datatoc: exclude the initial C-style comment from GLSL/MSL/Cuda files
Add optional argument `STRIP_LEADING_C_COMMENTS` to CMake macros:
data_to_c_simple & data_to_c.

Strip leading C-style comments that don't bloat binary size.
Comments are replaced with blank lines so line numbers in error messages
match. Reduces Blender's binary size by ~70kb.
2023-08-19 17:57:12 +10:00
Campbell Barton
63c1a26069 Cleanup: move GLSL comments to the file start
This has the benefit that leading comments may be stripped,
reducing the binary size (not yet supported).
2023-08-19 17:56:48 +10:00
Campbell Barton
04bf0f3eb6 License headers: add SPDX copyright entries for '*.msl' files 2023-08-19 17:41:14 +10:00
Campbell Barton
add2a656da Cleanup: spelling, use C-style in GLSL 2023-08-19 17:13:05 +10:00
Harley Acheson
1ce9c2b1f8 Fix #111086: Ignore Scroller Zones in Invisible Regions
If a region is hidden then there is no reason to detect or
consider its (also hidden) scroller action zones.

Pull Request: https://projects.blender.org/blender/blender/pulls/111126
2023-08-18 21:31:35 +02:00
Ray Molenkamp
e2af12d368 Cleanup: Update copyright to the new format
Had put my name here since the choice was between the foundation
and me personally, with the blender authors file now being in
place this can be cleaned up.
2023-08-18 11:58:37 -06:00
Harley Acheson
9e71b84f1d UI: Error Logging for Some Screen Operations
WM_report on the unlikely event when an area (smaller than minimums) is
within the combined operation bounds (close or join) and interferes.

Pull Request: https://projects.blender.org/blender/blender/pulls/111280
2023-08-18 19:53:18 +02:00
Ray Molenkamp
0df3aedfa8 CMake/MSVC: Only generate/install stripped PDB for release builds
This renames the WITH_WINDOWS_PDB and WITH_WINDOWS_STRIPPED_PDB cmake
options to WITH_WINDOWS_RELEASE_PDB WITH_WINDOWS_RELEASE_STRIPPED_PDB

The Stripped PDB isn't cost free to generate, and is only needed for
builds that are distributed to end users. There is no benefit in making
one for a debug build as the debugger locally will prefer to use the
bigger un-stripped PDB anyhow.

This also stops the copy/install of the PDB for anything but a release
build, this file is about 1.6G for a debug build, and there is really
no need to do this for local development, as the debugger will find/use
the PDB from its original location.

This brings down the time needed for an incremental link on a debug
build by about 30% (10->7 seconds on my local system)
2023-08-18 10:20:36 -06:00
Bastien Montagne
99e78f1c7a Cleanup: Move Object' FluidModifier internal data handling from 'lib_link' into 'read_data' code.
The only acceptable case to handle internal data in 'lib_link' code is
when it depends on other IDs info. Otherwise, it should be done in
'read_data' code (and versioning if relevant).
2023-08-18 17:31:06 +02:00
Christoph Lendenfeld
0c26d4cc3e Fix: Number input on slider
When using a slider it is possible to enter numbers for an exact value
However that input was capped between 0 and 1,
which is no longer correct since the range can be arbitrary.

Additionally it was divided by 100 because the slider
operator system assumed we'd be working with percentages.

This fixes both of these issues.

Pull Request: https://projects.blender.org/blender/blender/pulls/111269
2023-08-18 17:29:41 +02:00
Weizhen Huang
8367167626 Render: default roughness distribution to Multiscatter GGX
for glass, glossy and principled BSDF. It is more energy-preserving than
GGX, and with the albedo scaling instead of random walk (888bdc1419) the
render time stays reasonable.

Task: #99447

Pull Request: https://projects.blender.org/blender/blender/pulls/111267
2023-08-18 15:51:30 +02:00
Falk David
24082ceecc Cleanup: GPv3: Constructors and destructors
The `TreeNode`, `Layer` and `LayerGroup` constructors and destructors
had some inconsistencies. Now the code is a bit more clean and shared.
2023-08-18 15:06:18 +02:00
Bastien Montagne
f954329376 Cleanup: Move FCurve's internal data hanlding from 'lib_lkink' to 'read_data' code.
Deciding to forcefully set an ID pointer to null is not ID lib_linking
process, but internal data management.
2023-08-18 14:58:44 +02:00
Bastien Montagne
77eb7898e9 Cleanup: Comment in liboverride hierarchy handling code. 2023-08-18 14:23:41 +02:00
Bastien Montagne
dfb002bac6 Cleanup: Move Workspace's internal data handling from 'lib_link' to 'read_data' code.
Decision to clear the pinned scene ID in case of linked data _is_
internal data handling, and not related to updating relationships to
other IDs.
2023-08-18 14:23:18 +02:00
RedMser
baeeff9a84 Fix: crash in liboverride hierarchy ensure
Add null checks to logging and fix typo in if-check.

Pull Request: https://projects.blender.org/blender/blender/pulls/111055
2023-08-18 14:20:34 +02:00
Weizhen Huang
6f8011edf7 Cycles: new Principled Hair BSDF variant with elliptical cross-section support
Implements the paper [A Microfacet-based Hair Scattering
Model](https://onlinelibrary.wiley.com/doi/full/10.1111/cgf.14588) by
Weizhen Huang, Matthias B. Hullin and Johannes Hanika.

### Features:
- This is a far-field model, as opposed to the previous near-field
Principled Hair BSDF model. The hair is expected to be less noisy, but
lower roughness values takes longer to render due to numerical
integration along the hair width. The hair also appears to be flat when
viewed up-close.
- The longitudinal width of the scattering lobe differs along the
azimuth, providing a higher contrast compared to the evenly spread
scattering in the near-field Principled Hair BSDF model. For a more
detailed comparison, please refer to the original paper.
- Supports elliptical cross-sections, adding more realism as human hairs
are usually elliptical. The orientation of the cross-section is aligned
with the curve normal, which can be adjusted using geometry nodes.
Default is minimal twist. During sampling, light rays that hit outside
the hair width will continue propogating as if the material is
transparent.
- There is non-physical modulation factors for the first three
lobes (Reflection, Transmission, Secondary Reflection).

### Missing:
- A good default for cross-section orientation. There was an
attempt (9039f76928) to default the orientation to align with the curve
normal in the mathematical sense, but the stability (when animated) is
unclear and it would be a hassle to generalise to all curve types. After
the model is in main, we could experiment with the geometry nodes team
to see what works the best as a default.

Co-authored-by: Lukas Stockner <lukas.stockner@freenet.de>
Pull Request: https://projects.blender.org/blender/blender/pulls/105600
2023-08-18 12:46:13 +02:00
Falk David
d06a6105a7 Fix: GPv3: TreeNode::is_locked() function
The function returned `true` for the root node, which it shouldn't.
2023-08-18 12:44:11 +02:00
Falk David
725f1dbf2d Revert: GPv3: DNA rename of name
Partially reverts b14a0ee57e.

Instead of renaming the DNA field, use namespaces in C++ to resolve
name collisions (which is the reason this change was done
in the first place).
2023-08-18 12:44:11 +02:00
Hannes Loeschke
eda58d6419 Fix #110635: VSE: strip color multiplication affecting alpha channel
Factor of Color>Multiply should not have an effect on the alpha channel.
Alpha values can be adjusted separately by the factor associated to blend mode.
Factors below 1.0 reducing alpha would reduce color twice, while factors
above 1.0 would be clamped to 1.0.

- Removed ops on alpha channel in multiBuf()
- Removed adjustement of ibuf-planes since alpha channel is no longer
  modified

Pull Request: https://projects.blender.org/blender/blender/pulls/110984
2023-08-18 12:36:03 +02:00
Bastien Montagne
591c778b33 Fix (unreported) memleak in Particle lib_link code.
The potential data already read in `instance_weights` listbase needs to
be freed, instead of just clearing the listbase.

Also move some (very old!) versioning code out of Particle's 'lib_link'
code into proper versioning code.
2023-08-18 11:22:50 +02:00
Omar Emara
726ba534fc Realtime Compositor: Support realization of transformations
This patch adds support for the realization of transformations of
operation inputs in the Realtime Compositor. Input socket declarations
can now include a preference to what sort of realization needs to
happen.

All inputs specify realization on the operation domain by default
because that is needed for the correct operation of most operations.

Nodes may choose not to be realized on the operation domain, like the
MapUV, Plane Deform, and Bokeh Blur nodes; that's because their inputs
are treated as transform-less image objects.

Nodes may chose to realize their rotation or scale, like operations that
are not rotation or scale invariant and thus need images of identity
transformations. No nodes are declared as such so far, as this is still
being considered by developers and test builds be published for testing.

This patch coincidentally also fixes #102252 by declaring the Bokeh input
of the Bokeh Blur node to need realization of rotation. Which is the only
functional change of the patch.

Fixes #102252.

Pull Request: https://projects.blender.org/blender/blender/pulls/111179
2023-08-18 10:00:16 +02:00
Christoph Lendenfeld
e42c70fd31 Fix #110053: Crash on linked animation data with drivers
When copying (CTRL+L->Animation Data) a driver between two objects
that are linked with library overrides, `AnimData` was not created.
This did crash Blender when it tried to use the `nullptr`

The reason it crashed is because the function
`DEG_id_tag_update()`
was never called.

Fix it by restructuring the code so the function gets called

Pull Request: https://projects.blender.org/blender/blender/pulls/110795
2023-08-18 09:17:55 +02:00
Jeroen Bakker
82c1b9f684 Vulkan: Remove Unneeded Workaround for Shader Interfaces
All shaders have been patched and an error will be generated when using
incompatible shaders, no need to have workaround in the code anymore.
2023-08-18 08:57:37 +02:00
Jeroen Bakker
8477f62ba1 Vulkan: Detect Vulkan Incompatibility When Running OpenGL/MTL
Now that all shaders have been converted to be Vulkan Compatible it is
safe to test for incompatibility when running in OpenGL or MTL.

This detection is only done when blender is compiled in debug mode.
2023-08-18 08:48:22 +02:00