Commit Graph

128309 Commits

Author SHA1 Message Date
Miguel Pozo
0dfcde3fde Fix: EEVEE-Next: Ensure volume property textures are cleared
Clear volume property textures when there's no valid world volume
shader.

Pull Request: https://projects.blender.org/blender/blender/pulls/112871
2023-09-25 19:54:51 +02:00
Brecht Van Lommel
a469640861 USD: improve I/O of emission color in preview surface
Don't export color if strength is 0, and on import set strength to 1 when
there is a color. This is more important now that the default is color white
and strength 0 in the Principled BSDF.

Ref #99447
Ref #112848
2023-09-25 19:51:31 +02:00
Brecht Van Lommel
3d38b51435 Shaders: add "Weight" to Transmission/Subsurface/Coat/Sheen socket names
Ref #99447
Ref #112848
2023-09-25 19:51:27 +02:00
Brecht Van Lommel
1d265eed5d Shaders: rename Specular to Specular IOR Level in Principled BSDF
To clarify that this is no longer the primary control, but rather
and adjustment on IOR.

Ref #99447
Ref #112552
2023-09-25 19:51:22 +02:00
Brecht Van Lommel
239edb27ad EEVEE: optimize principled BSDF by skipping unused components
Ref #99447
Ref #112848
2023-09-25 19:51:17 +02:00
Alaska
a03ee1af81 Shaders: clamp various shader inputs for Principled BSDF
Ref #99447

Pull Request: https://projects.blender.org/blender/blender/pulls/112774
2023-09-25 19:51:12 +02:00
Lukas Stockner
6e2f29b421 Shader: change Specular input on Principled BSDF to affect IOR
This keeps the behavior similar to the Disney BRDF, where 0.5
is neutral and lower/higher values respectively decrease/increase
the dielectric specular. But it's more correct in that it's not
an arbitrary scale on Fresnel, but rather adjusting the IOR.

Ref #99447
Ref #112848

Pull Request: https://projects.blender.org/blender/blender/pulls/112552
2023-09-25 19:51:02 +02:00
Brecht Van Lommel
3d986b81c5 Shaders: move subsurface scale input below radius in Principled BSDF
To help clarify that this is a scale on the radius.

Ref #99447
Ref #112848
2023-09-25 19:50:56 +02:00
Brecht Van Lommel
3e3bdc9b89 Shader: rename subsurface scattering methods and change default
Clarify that one was specifically designed for skin shading.

Ref #99447
Ref #112848
2023-09-25 19:50:50 +02:00
Brecht Van Lommel
334027063e Shader: use single Principled BSDF input for metallic and specular tint
To match Standard Surface and OpenPBR.

Ref #99447
Ref #112848
2023-09-25 19:50:44 +02:00
Brecht Van Lommel
ca5f1c0f00 Shaders: rename Principled BSDF Emission to Emission Color
Ref #99447
Ref #112848
2023-09-25 19:50:41 +02:00
Weizhen Huang
def9b76207 Shader: Change specular tint in Principled BSDF from float to color
For more artistic control. Tints the reflection of dielectric materials
at normal incidence.

Ref #99447

Pull Request: https://projects.blender.org/blender/blender/pulls/112192
2023-09-25 19:42:05 +02:00
Lukas Stockner
86156566a7 Cycles: Add Metallic Tint to Principled BSDF using F82-Tint model
With the default value, this is backwards-compatible.

Ref #99447

Pull Request: https://projects.blender.org/blender/blender/pulls/112551
2023-09-25 19:42:05 +02:00
Lukas Stockner
7eead8912d Fix Cycles OSL potentially skipping closures when using layering
Pull Request: https://projects.blender.org/blender/blender/pulls/112213
2023-09-25 19:42:05 +02:00
Hans Goudey
7e0691d027 Fix: Grammar in operator description 2023-09-25 13:25:32 -04:00
Pablo Vazquez
9a3131323b UI: About: Update links and labels
Following f7af45ccfd, rename link labels:

* Release Notes -> What's New
* Development Fund -> Donate

The description are left as is since they
are still correct, just the labels to be more
in line with language used in blender.org
2023-09-25 18:40:36 +02:00
Pablo Vazquez
f7af45ccfd UI: Splash: Small changes to links and labels
* Rename "Development Fund" to "Donate", more in line with
  the language used in blender.org
* Rename "Release Notes" to "What's New". A bit more inviting
  to click and sounds less technical.
* In "Getting Started", remove "Credits" since it it nos related
  to getting started, and add relevant links already present
  in the Help menu.

Pull Request: https://projects.blender.org/blender/blender/pulls/112741
2023-09-25 18:09:02 +02:00
Sybren A. Stüvel
b8c96d1b03 Fix #112059: Anim, Unable to add drivers to bone collections visibility
Previously it was possible to use drivers to manipulate armature layer
visibility, and now it's also possible to animate & drive bone collection
visibility.
2023-09-25 18:02:47 +02:00
Sergey Sharybin
19db9a213e Light linking: Allow re-ordering in the light linking collections
The order of collections in the light linking collection is important
as it is used for tie-breaking when the same object is reachable from
multiple linked collections with different light linking state.

This commit utilizes the generic tree view reordering operations to
allow insertion of elements to a specific location and to re-order
existing objects and collections in the light linking collection.

It is possible to re-order both collections and objects, even tough
re-ordering objects does not really make a difference for the light
linking behavior. It is not possible to place an object before
collections.

Pull Request: https://projects.blender.org/blender/blender/pulls/112849
2023-09-25 18:00:28 +02:00
Sybren A. Stüvel
ac1c5d943c Anim: make ANIM_bonecolor_posebone_get handle const only
The color returned by `ANIM_bonecolor_posebone_get()` is not supposed
to be edited, so just return it as `const` and take a `const bPoseChannel`
as argument.

This makes the function usable in a wider range of situations, for example
the drawing code (which shouldn't alter any of these colors).
2023-09-25 17:29:04 +02:00
Pablo Vazquez
05fc31f27f UI: Remove redundant "Context Menu" in menu titles
Context menus are a type of menu, like header menus, there is no need to mention
the type as part of the name since it is implied by context.

Pull Request: https://projects.blender.org/blender/blender/pulls/112662
2023-09-25 16:25:55 +02:00
Sergey Sharybin
489693ef6d Light linking: Use checkbox icons for state indication
This is as per design task #104972

The same icons as exclusion in the outliner are used.

Pull Request: https://projects.blender.org/blender/blender/pulls/112857
2023-09-25 15:29:49 +02:00
persun
90d8a07213 UI: Move "Reset Recent" inside a menu
Move the File Browser's `Reset Recent` button into a menu to prevent
accidental clicks of a destructive operation.

Also rename it to a more descriptive  `Clear Recent Items`, and since
the word "Reset" is used for resetting values to default.

Pull Request: https://projects.blender.org/blender/blender/pulls/112853
2023-09-25 15:15:53 +02:00
Clément Foucault
f2fb74d30c Fix #112802: EEVEE-Next: Invalid weight when mixing closures
This was caused by a weight of 0 leading to `x = 0 / 0` which
resulted in NaNs and missing closure data.

Pull Request: https://projects.blender.org/blender/blender/pulls/112855
2023-09-25 15:14:45 +02:00
Omar Emara
6b53fd5cf6 Realtime Compositor: Allow more result types
Previously, the Result class was reserved for inputs and outputs of
operations, so its allowed types were naturally those exposed to the
user. However, we now use the Result class internally for intermediate
results, so it now makes sense to expend the allowed types.

The types are now divided into two categories, those that are user
facing and need to be handled in implicit operations and those that
are internal and can be exempt from such handling. Internal types are
reserved for texture results, as the single value mechanism is only
useful for user facing results.

The patch merely adjusts the switch cases across the code base, adding
one new internal type as an example.

Pull Request: https://projects.blender.org/blender/blender/pulls/112414
2023-09-25 15:12:52 +02:00
Michael Jones
b7fe84d9bc Cycles: Fix #107714: Leak during MetalRT BVH buid
This patch fixes the memory leak described in #107714 by adding an `@autoreleasepool` around Metal BVH builds. Certain NSObjects were being retained indefinitely, specifically ones which had been value-passed via an NSArray into acceleration structure descriptors.

Pull Request: https://projects.blender.org/blender/blender/pulls/112820
2023-09-25 14:57:17 +02:00
Michael Jones
b8833a7f8c Cycles: Disable NanoVDB if not needed when specialising Metal PSOs
This patch adds a check to see whether we're actually using NanoVDB textures, and if not, removes `#define WITH_NANOVDB` when generating the scene-optimised kernels. This results in marginally faster render times (maybe 2 or 3%) for scenes that do not use NanoVDB. The generic kernels are unaffected, so this will not impact responsiveness on first render.

Pull Request: https://projects.blender.org/blender/blender/pulls/112822
2023-09-25 14:56:58 +02:00
Colin Basnett
166f7c7a98 Assets: Add full_path attribute to AssetRepresentation
The current documentation on `AssetRepresentation.full_library_path` indicates
that it will give the fully qualified path to the asset (the path to the
`.blend` file extended with the path to the asset).

This is not the case however, and it only returns the path to the `.blend`
file, leaving there no way to actually get an easy-to-use path to the asset.

This commit adds a new `full_path` property to `AssetRepresentation` that lets
the user get the fully qualified path to the asset. The documentation for the
`full_library_path` has been updated to accurately reflect what it does.
2023-09-25 14:53:41 +02:00
Sybren A. Stüvel
eab95fa2aa Anim: enable visual keying of IK-influenced bones
Enable visual keying of bones that are influenced by an IK constraint.
This wasn't possible before, as the visual keying system only checked
constraints on the bone itself, and not whether the bone was part of an
IK chain.

This commit introduces a new `bPoseChannel::constflag` value
`PCHAN_INFLUENCED_BY_IK` that is set whenever the pose bone is part of
an IK chain.

The `pchan->constflag` field is computed during depsgraph evaluation. If
the depsgraph is active, it is now also written back to the original
pchan, so that it can be used in the "should visual keying be used"
function.

Fixes: #76791 "Different results when keyframing visual transforms and
applying transforms manually on IK constraint". Note that visually
keying does *not* copy the visual pose to the current pose. Furthermore,
when visually keying only part of the IK chain, the result of
re-evaluating the IK constraint (for example by moving the scene forward
and then backward by one frame) may still produce a different result, as
the IK chain now has a different start orientation.

Note that commit explicitly does not cover Spline IK constraints. They
can introduce heavy shear, especially with the default settings, which
cannot be represented by keys on loc/rot/scale.

For historical reference: 876cfc837e
introduces the 'use visual keying' preference option, where Blender
automatically chooses whether or not to use visual keying. This is why
there is a function at all that determines whether to use visual keying
or not.
2023-09-25 14:37:22 +02:00
Sybren A. Stüvel
caf46c9fbb Refactor: anim, rename flag PCHAN_HAS_TARGET to PCHAN_HAS_NO_TARGET
Rename the `bPoseChannel::flag` `PCHAN_HAS_TARGET` to `PCHAN_HAS_NO_TARGET`
as that is actually the meaning of the flag (in the majority of the code).

Since the flag was so confusingly named, there were some mixups in the
armature overlay drawing code as well, which have been fixed now too.
2023-09-25 14:33:51 +02:00
Sybren A. Stüvel
0ddd0460f0 Anim, when removing bone constraints, clear the constflag
When removing all constraints from pose bones, just reset the `constflag`
field to `0`, instead of clearing out specific flags. It was already
missing a flag that should have been cleared.

Effectively no functional changes, just a nice cleanup.
2023-09-25 14:33:51 +02:00
Sybren A. Stüvel
05b725c744 Anim: redefine PCHAN_HAS_CONST flag to mean "has a constraint"
Change the definition of the `PCHAN_HAS_CONST` pose channel flag. It used
to mean "has a constraint that is not IK or Spline IK", and now it just
means "has a constraint".

This has no direct effect yet, as the flag is only used in drawing code
when there is no (spline) IK constraint. However, I feel that the flag
name should match its expected behaviour, and IMO, in this case, making
that behaviour simpler is better than documenting more.
2023-09-25 14:33:51 +02:00
Sybren A. Stüvel
12fc4b6c58 Refactor: anim, change if-elseif-else chain to switch + reduce iterations
Refactor `BKE_pose_channel_copy_data()` so that it iterates over the entire
armature only once (instead of twice), and to use a `switch` instead of
a chain of `if`/`else if`/`else` clauses.

No functional changes.
2023-09-25 14:33:51 +02:00
Sybren A. Stüvel
69bf3f4e9a Refactor: simplify visualkey_can_use() function
Just some reordering to simplify things, and to put the cheapest checks
first.

No functional changes, except for the addition of a `BLI_assert()` to
check cases in which this function shouldn't be called anyway.
2023-09-25 14:33:51 +02:00
Sybren A. Stüvel
08f1ec65c7 Refactor: anim, avoid function call in draw_bone_relations()
Avoid a call to `bone.as_posebone()`, as the result of that call is already
stored in the `pchan` variable.

No functional changes.
2023-09-25 14:33:51 +02:00
Hans Goudey
6875925efa Geometry Nodes: Add option to force inputs to be single values
Add a checkbox to node group inputs to force inputs to be single values
and not accept varying fields. While this could also be done more
automatically, and it could be argued that requiring the flexibility is
helpful for users who want to use attributes, there are cases where the
field inferencing doesn't work, or the "use attribute" option is just
unhelpful. People use workarounds with primitive nodes to get the same
behavior anyway.

Pull Request: https://projects.blender.org/blender/blender/pulls/112745
2023-09-25 13:39:44 +02:00
Omar Emara
869d0aeaa1 Fix: Cached distortion grids are not reset
The patch that introduced distortion grids forgot to reset them in the
static cache manager.
2023-09-25 14:13:42 +03:00
Miguel Pozo
8fbfc991a5 Fix: EEVEE-Next: Surfel debug draw
Regression after 5ad7d81549.
2023-09-25 12:55:23 +02:00
Jeroen Bakker
a6d6251b6e Fix #111532: Partial Update Byte Data Texture with Scaling Broken
When texture painting on a Non-color byte texture with Texture limit active
(or the texture didn't fit on the GPU) the data for partial updating of a GPU
texture was incorrect.

`gpu_texture_update_scaled` expects an input buffer clipped to
the bounds of the input area that needs to be updated. In case for Byte
textures with Non Color colorspace  it received the unmodified input
buffer, resulting in incorrect data to be uploaded to the GPU texture.

This PR fixes this by selecting the non-optimized branch when the
texture is a Byte buffer with Data color space and scaling should
happen.

Pull Request: https://projects.blender.org/blender/blender/pulls/112834
2023-09-25 12:46:17 +02:00
Miguel Pozo
eefeb3ee22 Fix #112675: Workbench: Shadows disabled for active object 2023-09-25 12:43:26 +02:00
Falk David
16e195a111 Cleanup: GPv3 layer tree manipulations
In preparation of https://projects.blender.org/blender/blender/pulls/112535, we need to make sure all layer tree manipulations are in functions on the `GreasePencil` struct so we can keep the `CustomData` for layers in sync with the layer tree.

 This PR makes sure that all the functions that change the layer tree in any way are `protected` on the `LayerGroup` class. The `GreasePencil` struct is declared `friend` with `LayerGroup`.

We also cleanup and remove a lot of code duplication between layers and layer groups and try to write functions in a generic way for `TreeNode` (both layers and layer groups are tree nodes).

Pull Request: https://projects.blender.org/blender/blender/pulls/112837
2023-09-25 12:11:18 +02:00
Alexander Gavrilov
2abd026cfe Anim: remove the deprecated use_inherit_scale bone property.
This boolean property has been replaced with an enum all the way
back in 2019, so it is time to remove it completely. It is purely
an RNA wrapper around the real enum property, so the only thing
this change can break is some python scripts and add-ons.

Pull Request: https://projects.blender.org/blender/blender/pulls/112836
2023-09-25 11:13:36 +02:00
Jacques Lucke
8362563949 UI: show recently selected items at the top of searches
The goal is to make the search faster to use by dynamically adapting to the user.
This can be achieved using the simple but common approach of showing recently
selected items at the top. Note, that the "matching score" between the query and
each search item still has precedence when determining the order. So the last used
item is only at the top, if there is no other search item that matches the query better.

Besides making the search generally faster to use, my hope is that this can also
reduce the need for manually weighting search items in some places. This is
because while the ordering might not be perfect the first time, it will always be
once the user selected the element that should be at the top once.

This patch includes:
* Support for taking recent searches into account in string searching.
* Keep track of a global list of recent searches.
* Store recent searches on disk similar to recently opened files.
* A new setting in the user preferences that allows disabling the functionality.
  This can be used if deterministic key strokes are required, e.g. for automated tests.

In the future this could be improved in different ways:
* Add some kind of separator in the search list to indicate which elements are at
  the top because they have been used recently.
* Store the recent search items per search, instead of in a global list. This way
  it could adapt to the user even better.

Pull Request: https://projects.blender.org/blender/blender/pulls/110828
2023-09-25 10:56:12 +02:00
Jeroen Bakker
676a03cf1e Cleanup: Make format 2023-09-25 09:35:00 +02:00
Campbell Barton
e38ff7c06d Cleanup: use C++ comments for disabled code 2023-09-25 17:06:04 +10:00
Omar Emara
acb88528a5 Realtime Compositor: Implement Inpaint node
This patch implements the Inpaint node for the Realtime Compositor. The
inpainting region is filled by sampling the color of the nearest boundary pixel
if it is not further than the user supplied distance. Additionally, a lateral
blur is applied in the tangential path to the inpainting boundary to smooth out
the inpainted region.

The implementation is not identical to the existing CPU implementation due to
technical infeasibility. In particular, the CPU implementation uses a Manhattan
distance transform, while the GPU implementation uses an Euclidean one, which is
a consequence of the use of the Jump Flooding algorithm. Furthermore, the CPU
uses a serial convolution starting from the boundary outwards, while the GPU
uses a lateral Gaussian blur in the direction tangent to the boundary.

Pull Request: https://projects.blender.org/blender/blender/pulls/111792
2023-09-25 08:45:46 +02:00
Omar Emara
5008938a1c Realtime Compositor: Implement Double Edge Mask node
This patch implements the Double Edge Mask node for the Realtime
Compositor. The implementation is primarily based on the 1+JFA Jump
Flooding algorithm, which was also introduced in this commit.

Pull Request: https://projects.blender.org/blender/blender/pulls/112223
2023-09-25 08:35:42 +02:00
Peng Yan
f59ef84835 Cleanup: avoid redundant loop extruding face regions
Correct typo in bmo_extrude.cc that lead to a redundant loop over
a vertices faces.
2023-09-25 16:02:11 +10:00
Campbell Barton
6c91e1c205 Cleanup: spelling in comments 2023-09-25 15:25:43 +10:00
Campbell Barton
1a5326fe02 Cleanup: remove commented DNA_struct_member_exists check 2023-09-25 13:25:37 +10:00