Commit Graph

109068 Commits

Author SHA1 Message Date
Falk David
370712fc1b Fix #121354: GPv3: object mode selection outline too big
This was caused by c2504eb779.
The commit changed the factor for the radii, but didn't update the
overlay code for the outlines.

This fix makes sure we're using the right conversion factor.
2024-05-02 16:32:06 +02:00
Julian Eisel
d4fc167db1 Asset Shelf: Add region poll mechanism for initialization
Allows running some action when the context changes to make the
asset shelf region visible. Also add an option for when whether the
shelf should be visible by default when the poll succeeds.

Pull Request: https://projects.blender.org/blender/blender/pulls/121315
2024-05-02 10:27:55 -04:00
Julian Eisel
471378c666 Assets: Sort assets by catalog
Sort assets in asset shelf and asset browser by catalogs (and within
catalogs by name like before). This groups similar assets better,
reducing visual noise and making specific assets easier to find.

Pull Request: https://projects.blender.org/blender/blender/pulls/121316
2024-05-02 10:26:02 -04:00
Sergey Sharybin
1b0012d51c Refactor: Require C++ for users of BLI_simd.h
This is because sse2neon.h might be used to emulate SSE intrinsics
on ARM64 architecture, and it uses some preprocessor which is not
available for C language when using MSVC.

The old-style math file math_matrix.c uses this header, so needed
to become C++. Simple rename did not work since there is a new math
utility math_matrix.cc exists. Following some existing convention
the math_matrix.c is renamed to math_matrix_c.cc. Eventually all the
code should switch to use C++ style math, and the C style removed,
so it seems reasonable to not mix old and new style of API in the
same file.

There should be no functional changes.

Pull Request: https://projects.blender.org/blender/blender/pulls/121335
2024-05-02 16:22:19 +02:00
Hans Goudey
a214d00f28 UI: Check for object modifier support in operator poll functions
Check whether the object supports modifiers in the clear and
copy to selected operators.
2024-05-02 10:12:46 -04:00
Falk David
cd93b6c925 Cleanup: GPv3: Compiler warning
Makes the function static and removes an unnecessary comment.
2024-05-02 14:56:55 +02:00
Campbell Barton
1b788f3a84 Fix #120778: Depth navigation no longer works for non-geometry objects
Regression in [0] that changed behavior of depth drawing to exclude
overlays which are needed so users can box-zoom to an armature or camera
for example. Add `V3D_DEPTH_NO_OVERLAY` when no overlays are desired.

[0]: 5fea1eda36
2024-05-02 22:36:05 +10:00
Campbell Barton
f15646df59 Fix failure to draw onto a surface with GPv3
GP_PROJECT_DEPTH_VIEW never used a surface depth and would
always use object-origin instead.
2024-05-02 22:34:43 +10:00
Lukas Stockner
17f2cdd104 Cycles: Add thin film iridescence to Principled BSDF
This is an implementation of thin film iridescence in the Principled BSDF based on "A Practical Extension to Microfacet Theory for the Modeling of Varying Iridescence".

There are still several open topics that are left for future work:
- Currently, the thin film only affects dielectric Fresnel, not metallic. Properly specifying thin films on metals requires a proper conductive Fresnel term with complex IOR inputs, any attempt of trying to hack it into the F82 model we currently use for the Principled BSDF is fundamentally flawed. In the future, we'll add a node for proper conductive Fresnel, including thin films.
- The F0/F90 control is not very elegantly implemented right now. It fundamentally works, but enabling thin film while using a Specular Tint causes a jump in appearance since the models integrate it differently. Then again, thin film interference is a physical effect, so of course a non-physical tweak doesn't play nicely with it.
- The white point handling is currently quite crude. In short: The code computes XYZ values of the reflectance spectrum, but we'd need the XYZ values of the product of the reflectance spectrum and the neutral illuminant of the working color space. Currently, this is addressed by just dividing by the XYZ values of the illuminant, but it would be better to do a proper chromatic adaptation transform or to use the proper reference curves for the working space instead of the XYZ curves from the paper.

Pull Request: https://projects.blender.org/blender/blender/pulls/118477
2024-05-02 14:28:44 +02:00
YimingWu
e8d028b7a5 Fix #121338: Depthdropper ensure viewport camera
Depthdropper should ensure that the viewport is in camera view to use
active camera position, otherwise it should still use rv3d->viewinv[3]
to ensure correct distance result.

Pull Request: https://projects.blender.org/blender/blender/pulls/121339
2024-05-02 13:24:22 +02:00
Amelie Fondevilla
725408e842 GPv3: Extrude operator
Implementation of the extrude operator for Grease Pencil v3.
If an endpoint is selected, the extrusion will extend the stroke.
If an inner point is selected, the extrusion will create a new stroke tied to the one that is selected.

Change of behavior from gpv2: the endpoints of a cyclic curve follow the same behavior as inner points.

Pull Request: https://projects.blender.org/blender/blender/pulls/121249
2024-05-02 12:51:30 +02:00
Christoph Lendenfeld
5b7a0ed1b5 Refactor: move keyingset enums to animrig
No functional changes expected.

This PR moves the enums
`eModifyKey_Modes` and `eModifyKey_Returns` to animrig
as enum classes.

Functions that take or return that value were also modified.

Pull Request: https://projects.blender.org/blender/blender/pulls/121132
2024-05-02 12:00:37 +02:00
Campbell Barton
530999fb76 Cleanup: add missing SPDX-FileCopyrightText 2024-05-02 16:46:26 +10:00
Campbell Barton
f6b7464b4c Cleanup: spelling in comments 2024-05-02 16:44:10 +10:00
Campbell Barton
41c43c9e87 Cleanup: use const pointers 2024-05-02 16:11:03 +10:00
Campbell Barton
523d84db85 Fix incorrect XDG_CURRENT_DESKTOP check
The string was checked for equality when the spec allows for `:`
delimiter characters.
2024-05-02 10:20:58 +10:00
Campbell Barton
594ee2c766 BLI_string: add BLI_string_elem_split_by_delim
Add a utility function to check if one string contains another
when split by a delimiter.
2024-05-02 10:20:56 +10:00
Jacques Lucke
5bc949b4a7 Fix: avoid tagging file as modified when clicking in node editor 2024-05-02 01:43:45 +02:00
Jacques Lucke
6cb9b7299d Fix: sample grid node uses wrong enum for data type
The used enum used the term "Value" instead of "Float".
Also the default value was wrong.
2024-05-01 23:29:56 +02:00
Jacques Lucke
ebd2762239 Fix: crash when applying geometry nodes with bake node 2024-05-01 23:11:58 +02:00
Iliya Katueshenock
831e91c357 Geometry Nodes: support working with raw matrix values
These nodes allow working with the raw values that make up a matrix.
This can be used to construct a 4x4 matrix directly, without using the
`Combine Transform` node. This allows building transforms with arbitrary
skew, or projection matrices.

Pull Request: https://projects.blender.org/blender/blender/pulls/121283
2024-05-01 21:31:08 +02:00
Jacques Lucke
17cc5d694c Fix #121214: invalid owner_tree pointer when node tree is overridden 2024-05-01 21:29:04 +02:00
Aras Pranckevicius
877558858b Cleanup: Remove unused BLF matrix functionality
It was added back in 2010 (b25c32393d), but looks like nothing
whatsoever uses it by now. It is not exposed to Python either.

Pull Request: https://projects.blender.org/blender/blender/pulls/121207
2024-05-01 20:59:10 +02:00
Hans Goudey
4dbdd925d4 Assets: Add equality operators to AssetWeakReference 2024-05-01 13:24:39 -04:00
Hans Goudey
9c1fe82e06 UI: Enable "apply" handler for preview tile buttons
For example, allow calling an operator when clicking on a
preview tile button. Useful for brush assets where clicking
on an asset shelf item activates the brush.
2024-05-01 13:17:44 -04:00
Hans Goudey
b7a959061d Asset Shelf: Expose two functions publicly
Unused for now. Will be used by brush assets.
2024-05-01 13:11:56 -04:00
Hans Goudey
c2d1e2f1c8 Cleanup: Remove redundancy in a couple asset shelf function names
The "asset_shelf_" prefix is redundant with the namespace.
2024-05-01 13:11:55 -04:00
Hans Goudey
fb8f0311bd Assets: Expose function to find asset from a weak reference
Unused for now, will be used by brush assets operators.
2024-05-01 13:11:55 -04:00
Hans Goudey
14e8d0d9aa UI: Use "label tooltip" as a fallback for quick favorites menu text
Useful when the button has no display text but has been set up
to have a quickly accessible tooltip in its place (for example
a brush asset item in the asset shelf).
2024-05-01 13:11:55 -04:00
Hans Goudey
09c0dec2a3 UI: Adjust gesture operator descriptions to avoid second person
Use the imperative tense as described by the HIG.

Pull Request: https://projects.blender.org/blender/blender/pulls/121309
2024-05-01 19:01:28 +02:00
Hans Goudey
d4981e0de3 Cleanup: Tweak naming in file forwardcompat dialog
Make the function naming more generic so extending it in the future
(with asset blend file information for example) won't have to adjust
the function names to correct the semantics itself.
2024-05-01 12:26:58 -04:00
Hans Goudey
a3f87ceb35 Cleanup: Correct comment in keymap operator name guessing
PAINT_OT operators are not skipped here.
2024-05-01 12:26:58 -04:00
Miguel Pozo
67d292c0e9 Fix: EEVEE-Next: Never tag default materials as GPU_MAT_USE_DEFAULT
Fix issue from a8f8745dcb
2024-05-01 18:03:36 +02:00
Hans Goudey
c9625cbc7b Brush: Rename BKE_paint_toolslots_brush_validate function
Change from the brush assets branch. Arguably the funciton name
is just as clear this way anyway.
2024-05-01 11:49:48 -04:00
Hans Goudey
c549c1b29c Brush: Add Main argument to BKE_paint_ensure
This is used by the brush assets branch. Though it is unused currently, the
argument is added now to reduce the trivial boilerplate changes in the diff.
2024-05-01 11:49:48 -04:00
Hans Goudey
722ad638c5 UI: Add optional icon argument to search visit params
Allows adding an icon to some search items, similar to what is done
manually for property search. Used for asset catalog search in the
brush assets branch, but more widely useful too.
2024-05-01 11:49:48 -04:00
Clément Foucault
9ff39b5fe9 Cleanup: EEVEE-Next: Fix warning and naming style 2024-05-01 17:45:15 +02:00
Harley Acheson
529b8786f8 UI: Custom Text and Confirmation Button Text for Props Confirm
For operators that use WM_operator_props_popup_confirm allow custom
title and confirmation button text.

Pull Request: https://projects.blender.org/blender/blender/pulls/121287
2024-05-01 16:29:19 +02:00
Clément Foucault
ab30784076 EEVEE-Next: Implement spherical harmonic deringing
This avoids negative color darkening caused by strong
directionnal lighting.

However, this reduce the contrast a lot since the
deringing is done on the unclampped spherical harmonics
which is itself extracted from unclamped values from
the world.

The solution to this is to add the parameter for
clamping the world light. This setting will be
reused for #68478.

Fix #116036

Pull Request: https://projects.blender.org/blender/blender/pulls/121303
2024-05-01 16:18:51 +02:00
Clément Foucault
3f1dbf2843 Fix: EEVEE-Next: Thickness versionning affecting startup.blend
This limits the thickness node addition to material using
screen space refraction.
2024-05-01 16:18:35 +02:00
Nathan Vegdahl
3b3364faf9 Fix: add missing depsgraph tag for anim Strip keyframe Python API
This caused a weird situation where after keys were inserted, the
animation of the affected object(s) wouldn't actually change in
the 3D viewport (even with scrubbing) until the keys were touched
in one of the animation editors.

Pull Request: https://projects.blender.org/blender/blender/pulls/121302
2024-05-01 16:08:20 +02:00
Iliya Katueshenock
5fa98aa0fd Cleanup: Camel case for node size enum items
Pull Request: https://projects.blender.org/blender/blender/pulls/121297
2024-05-01 15:27:34 +02:00
Pratik Borhade
a42e2a5a29 GPv3: Mask toggle in dopesheet channel
Add `use_mask` property in dopesheet layer channel.
Also add an icon to the `use_mask` property.

Pull Request: https://projects.blender.org/blender/blender/pulls/121259
2024-05-01 15:10:22 +02:00
Laurynas Duburas
d7b72b4979 Fix: Missing topology update setting curves handle type
If both segment handles are `Vector`, changing their type only changes
handle behavior, but doesn't add curvature to the segment. For `Vector`
segments only one step is designated in the evaluated offsets cache,
so  `all_bezier_offsets` has to be recalculated. As an optimization,
it would be possible to track if there was any `Vector` handle and
rebuild topology only when it is needed.

Pull Request: https://projects.blender.org/blender/blender/pulls/121292
2024-05-01 14:48:52 +02:00
Pratik Borhade
3c336c82cc Fix #121248: Crash executing node tool operator without active node
Calling `NODE_OT_select_same_type_step` when no node is active triggers
the crash.

Pull Request: https://projects.blender.org/blender/blender/pulls/121252
2024-05-01 14:48:12 +02:00
Clément Foucault
ff15d31bc1 EEVEE-Next: Forgot version bump
Sorry.
2024-05-01 14:47:18 +02:00
Clément Foucault
826d2ed4ec EEVEE-Next: Move shadow resolution scale to the sampling panel 2024-05-01 14:45:51 +02:00
Clément Foucault
b4be13ad8a EEVEE-Next: Clamp shadow_resolution_scale to 1
Scaling up the resolution is currently ill defined for
sun shadows. This might be reintroduced when #121293 lands.
Fix #121196
2024-05-01 14:44:30 +02:00
Habib Gahbiche
483c854612 Compositor: implement interpolation methods for Translate node
Compositor: Expose interpolation methods Nearest, Bilinear and Bicubic to the user for translate node

This is part of #119592.

Pull Request: https://projects.blender.org/blender/blender/pulls/119603
2024-05-01 14:44:01 +02:00
Hans Goudey
e63c8bb3c2 UI: Add Modifiers submenu to 3D view header
Add a menu similar to the "Object > Constraints" menu that allows adding,
copying, and clearing modifiers. The "copy all modifiers to selected" and
"clear modifiers" operators are new, to mirror the functionality we already
have for constraints.

The "Add" menu is the same that's used in the property editor. In the 3D
view, modifiers are always added to all selected objects.

Part of #120230

Pull Request: https://projects.blender.org/blender/blender/pulls/121286
2024-05-01 14:15:53 +02:00