Commit Graph

92745 Commits

Author SHA1 Message Date
Kévin Dietrich ca346d2176 Merge remote-tracking branch 'origin/blender-v3.2-release' 2022-06-01 07:02:32 +02:00
Kévin Dietrich 54d076b20d Fix T98526: broken corner attributes with GPU subdivision
Although reusing the same patch coordinate for all corner pointing the
same vertex works for interpolation vertices, it does work for
interpolation face varying attributes. So we need to keep the original
patch coordinates around for face varying interpolation. This was caused
by the previous fix (a5dcae0c64).
2022-06-01 07:02:05 +02:00
Campbell Barton 46cb24e7c2 Merge branch 'blender-v3.2-release' 2022-06-01 14:31:55 +10:00
Campbell Barton 0e8d6c2828 Cleanup: conversion from enum/int warning 2022-06-01 14:30:57 +10:00
Chris Blackbourn 65e7d49939 Fix T89726: Fix hitbox of axis gizmo in UV Editor
Use the scale from the wmGizmo.matrix_final as a reference for the
arrow head-size.

Reviewed By: campbellbarton

Ref D15056
2022-06-01 14:23:37 +10:00
Jesse Yurkovich ee57afe7e1 Merge remote-tracking branch 'origin/blender-v3.2-release' 2022-05-31 21:09:35 -07:00
Jesse Yurkovich 12642bdeab Fix T96984: Create new image.browse operator for uiTemplateImage layouts
The existing BUTTONS_OT_file_browse operator that's used for
uiTemplateImage layouts fails to work correctly with UDIM textures.

This is mainly due to it not realizing that it must tokenize the
filepath before signaling that an update has been made. It also doesn't
work correctly when executing its SHIFT-click behavior to open the image
in an external application. Lastly, it doesn't set the filters to Images
and Movies which is suboptimal for the user.

The new operator takes the unique features of BUTTONS_OT_file_browse
and creates a customized variant better suited for images.

Differential Revision: https://developer.blender.org/D14824
2022-05-31 20:57:33 -07:00
Joseph Eagar b38a59881b Merge branch 'blender-v3.2-release' 2022-05-31 16:35:22 -07:00
Joseph Eagar 6cee404914 GPU subdiv: Fix edit mode vertex color not being uploaded properly
Also cleaned up the code a tad bit.  Note that I
found two more bugs:

* GPU subdivision attribute interpolation
  is producing visual artifacts.
* "Show on cage" mode for subdivision surface
  just shows black colors.
2022-05-31 16:32:42 -07:00
Joseph Eagar 75162ab8c2 Fix T97408: Temporary fix for attribute convert undo
Sculpt undo now detects if an attribute layer has
changed type/domain and unconverts it back.  This
is a temporary workaround to a more fundamental
bug in the undo system.

Memfile undo assumes it can always rebuild the
application state from the prior undo step,
which isn't true with incremental undo systems.

The correct fix is to push an extra undo step prior
to running an operator if an incremental undo system
is active and the operator is using memfile undo.
2022-05-31 15:46:09 -07:00
Joseph Eagar 79cee340a8 Merge branch 'blender-v3.2-release' 2022-05-31 12:45:24 -07:00
Joseph Eagar 511a08585d Fix T98364: Remove improper OPTYPE_UNDO flags
Removed OPTYPE_UNDO flags from the swap brush colors and
sample color operators.  These types of operators are
not supposed to be undoable in the first place.  Also
memfile undo is too buggy for it.
2022-05-31 12:43:07 -07:00
Jacques Lucke b9f29a0f64 Merge branch 'blender-v3.2-release' 2022-05-31 20:44:56 +02:00
Jacques Lucke 0f47506cde Fix T98501: setting node socket default value is very slow
The issue was that the extend socket (the last empty socket in
Input/Output nodes) was repeatedly removed and added again,
which caused more updates than necessary. Now, the extend
socket is kept if it existed already.

Differential Revision: https://developer.blender.org/D15084
2022-05-31 20:43:53 +02:00
Jacques Lucke 5c80bcf8c2 Functions: speedup preparing multi-function parameters
My benchmark which spend most time preparing function parameters
takes `250 ms` now, from `510 ms` before. This is mainly achieved by
doing less unnecessary work and by giving the compiler more inlined
code to optimize.

* Reserve correct vector sizes and use unchecked `append` function.
* Construct `GVArray` parameters directly in the vector, instead of
  moving/copying them in the vector afterwards.
* Inline some constructors, because that allows the compiler understand
  what is happening, resulting in less code.

This probably has negilible impact on the user experience currently,
because there are other bottlenecks.

Differential Revision: https://developer.blender.org/D15009
2022-05-31 20:41:01 +02:00
Jacques Lucke 484ea573af Merge branch 'blender-v3.2-release' 2022-05-31 19:24:56 +02:00
Jacques Lucke dc389a6152 Fix T98454: subdivision doesn't propagate int attributes
Differential Revision: https://developer.blender.org/D15083
2022-05-31 19:23:52 +02:00
Hans Goudey a1830859fa Curves: Add soft selection in sculpt mode
This commit adds a float selection to curve control points or curves,
a sculpt tool to paint the selection, and uses the selection influence
in the existing sculpt brushes.

The selection is the inverse of the "mask" from mesh sculpt mode
currently. That change is described in more detail here: T97903

Since some sculpt tools are really "per curve" tools, they use the
average point selection of all of their points. The delete brush
considers a curve selected if any of its points have a non-zero
selection.

There is a new option to choose the selection domain, which affects how
painting the selection works. You can also turn the selection off by
clicking on the active domain.

Sculpt brushes can be faster when the selection is small, because
finding selected curves or points is generally faster than the
existing brush intersection and distance checks.

The main limitation currently is that we can't see the selection in the
viewport by default. For now, to see the selection one has to add a
simple material to the curves object as shown in the differential
revision. And one has to switch to Material Preview in the 3d view.

Differential Revision: https://developer.blender.org/D14934
2022-05-31 19:00:24 +02:00
Jacques Lucke 96f20ddc1e Geometry Nodes: Don't allow UI attributes as modifier field inputs
This is an extension of 4669178fc3, applying the same changes to
attributes chosen in the field inputs of the geometry nodes modifier.
If a UI/internal attribute is used, the attribute name button will
have a red alert. Adding a disabled hint is currently a bit more complex.

Also hide UI attributes in attribute search for the named attribute node.

Part of D14934
2022-05-31 18:58:54 +02:00
Hans Goudey a40b611128 Cleanup: Improve const correctness of ID functions
These functions don't change their inputs, so they can be const,
which is a bit more intuitive and clean to use for callers.

Differential Revision: https://developer.blender.org/D14943
2022-05-31 17:31:32 +02:00
Johnny Matthews 908dfd5e0d Merge branch 'blender-v3.2-release' 2022-05-31 10:15:40 -05:00
Johnny Matthews 52cb24a779 Fix T98500: Wrong Selection in Duplicate Points
Differential Revision: https://developer.blender.org/D15071
2022-05-31 10:07:56 -05:00
Hans Goudey 3060b98842 Cleanup: Simplify dependencies for GMP math header
Previously, the base math headers included GMP headers in all cases.
This was problematic because we don't want all modules that use the
math headers to depend on GMP, and the unnecessary includes could
theoretically have detrimental effects to compile times.

Now `BLI_math_mpq.hh` depends on `BLI_math_base.hh`, so if a file
needs to use exact arithmatic, it can just include the former.

Differential Revision: https://developer.blender.org/D15079
2022-05-31 16:55:14 +02:00
Hans Goudey a746cef825 Cleanup: Move lib_override.c to C++
This will allow easier const correctness and use of
nicer data structures like `Vector` and `Map`.
2022-05-31 16:19:50 +02:00
Kévin Dietrich d356a4f280 Merge remote-tracking branch 'origin/blender-v3.2-release' 2022-05-31 16:18:42 +02:00
Kévin Dietrich a5dcae0c64 Fix T97877: broken shadows with GPU subdivision
Issues stems from the mesh not being watertight. This was caused by
floating point precision issues when evaluating patch coordinates at
patch boundaries (loops/corners in different patches pointing to the same
vertex). To fix this we ensure that all loops pointing to the same vertex
share the same patch coordinate. This keeps code simple, and does not
require to track precision issues in floating point math all over the
place.
2022-05-31 16:18:08 +02:00
Hans Goudey 4669178fc3 Attributes: Hide internal UI attributes and disallow procedural access
This commit hides "UI attributes" described in T97452 from the UI lists
in mesh, curve, and point cloud properties, and disallow accessing them
in geometry nodes.

Internal UI attributes like selection and hiding values should use the
attribute system for simplicity and performance, but we don't want to
expose those attributes in the attribute panel, which is meant for
regular user interaction. Procedural access may be misleading or cause
problems, as described in the design task above.

These attributes are added by two upcoming patches: D14934, D14685

Differential Revision: https://developer.blender.org/D15069
2022-05-31 13:20:16 +02:00
Julian Eisel 39c14f4e84 Merge branch 'blender-v3.2-release' 2022-05-31 12:29:41 +02:00
Julian Eisel 765c16bbd0 Fix wrong asset dropped when dragging from loc. of just cleared asset
See previous commit for an explanation of what went wrong. Similar to
the fix there, we also have to update the dragged data (e.g. the
data-block) referenced by the button.

Committing separately since this could cause further issues.
2022-05-31 12:28:58 +02:00
Julian Eisel 75ef51cc80 Fix T95394: Crash when dragging from location of just cleared asset
In Blender buttons are recreated over redraws, except of the active
button which is kept alive, and replaces the new version of itself in
the new redraw. In order to do that, the button needs to be recognized.
This process of recognizing and matching buttons from different redraws
isn't always bullet-proof. That's okay-ish, but we have to make sure
that the relevant data of the old active button is updated with the
newest data.

Here the matching would go wrong, and the new active button was
recognized as the old active button, which was in fact removed when the
asset was cleared. This patch makes sure the image buffer attached to
the buttons is updated when buttons were recognized as matching.

Note that the dragging will still use the wrong data-block, this will be
fixed in the following commit.
2022-05-31 12:27:52 +02:00
Campbell Barton 0d7e0ffdb5 Cleanup: tabs to spaces for CMake files & sort file-lists 2022-05-31 18:18:24 +10:00
Hans Goudey 247ceca629 Merge branch 'blender-v3.2-release' 2022-05-31 10:06:22 +02:00
Hans Goudey 18a17d4291 Fix T98403: Crash applying modifiers on non-mesh objects
The operator assumed it was called on a mesh object, which has
mostly been the case because of lack of support for other object
types, but the new curves object is supported, which is the situation
in the report.

Differential Revision: https://developer.blender.org/D15063
2022-05-31 10:05:48 +02:00
Iyad Ahmed a30e67813d OBJ: Enable undo for experimental OBJ importer
The new OBJ importer operator didn't register an undo event.
This commit enables the register and undo flags for the operator.

Reviewed By: Bastien Montagne, Aras Pranckevicius, Serhiy Striletksy
Differential Revision: https://developer.blender.org/D15051
2022-05-31 11:00:14 +03:00
Jeroen Bakker a3a138b41b Merge branch 'blender-v3.2-release' 2022-05-31 09:52:32 +02:00
Julien Kaspar 1ebc0ebdc0 UI: Correct sculpt tooltips
Some of the tools in sculpt mode were still referring to the previously  experimental sculpt vertex colors.
They should instead refer to color attributes.

Reviewed By: jbakker

Differential Revision: https://developer.blender.org/D15073
2022-05-31 09:51:26 +02:00
Campbell Barton 993fd985f0 Cleanup: remove UV handling from OBJECT_OT_modifier_convert
It doesn't make sense to merge UV's when applying a particle-system.
2022-05-31 17:42:44 +10:00
Campbell Barton c338388354 Cleanup: rename ED_object_modifier_convert to make it's use clearer
This function is specific to particle-systems which wasn't obvious,
leading to an error in [0] which added UV handling which doesn't make
sense.
2022-05-31 17:40:02 +10:00
Campbell Barton c8058e51ee RNA: add macros for EnumPropertyItem layout elements
Add the following macros for enums as support for these features wasn't
all that obvious and there were some inconsistencies in their use.

- RNA_ENUM_ITEM_HEADING(name, description)
- RNA_ENUM_ITEM_SEPR
- RNA_ENUM_ITEM_SEPR_COLUMN
2022-05-31 14:19:06 +10:00
Campbell Barton 94444aaadf PyDoc: de-duplicate enums for rna_rna.c & bpy_props.c
Lists of items for bpy.props were duplicated 3 times, now all enums are
defined once in rna_rna.c and referenced from bpy.props doc-strings.
2022-05-31 14:19:06 +10:00
Campbell Barton ed2a345402 PyAPI: add _bpy.rna_enum_items_static() for accessing internal enum data
This is method is intended for internal use
(introspection for generating API docs).
2022-05-31 14:07:08 +10:00
Campbell Barton 7056c7520a RNA: avoid non-standard enum item (enum section using single space)
Also removes stray semicolon in RNA_enum_items.h
2022-05-31 14:07:06 +10:00
Hans Goudey ca59391704 Cleanup: Remove outdated comment 2022-05-30 19:30:52 +02:00
Dominik Fill f523fb1dc9 Fix T96157: Make size of Frame Node label independent from Line Width
This commits corrects the calculation of the Frame Node label size,
making it independent of the 'Line Width' user preference.

Since `U.dpi` is actually DPI divided by `U.pixelsize` and `U.pixelsize`
is calculated from line-width multiplying by `U.pixelsize` undoes
the connection between line-width and label size.
It now stays the same, regardless of the line-width setting.

Reviewed By: Julian Eisel, Harley Acheson

Differential Revision: https://developer.blender.org/D14338
2022-05-30 19:26:03 +02:00
Dominik Fill c8cef83fae Fix T96157: Make size of Frame Node label independent from Line Width
This commits corrects the calculation of the Frame Node label size,
making it independent of the 'Line Width' user preference.

Since `U.dpi` is actually DPI divided by `U.pixelsize` and `U.pixelsize`
is calculated from line-width multiplying by `U.pixelsize` undoes
the connection between line-width and label size.
It now stays the same, regardless of the line-width setting.

Reviewed By: Julian Eisel, Harley Acheson

Differential Revision: https://developer.blender.org/D14338
2022-05-30 19:19:07 +02:00
Hans Goudey b24e091c5a Cleanup: Move attribute.c to C++ 2022-05-30 18:06:39 +02:00
Hans Goudey 3f9376851b Cleanup: Clang tidy
Mostly duplicate includes, also use nullptr, and using default
member initializers.
2022-05-30 17:46:44 +02:00
Bastien Montagne 3437cf155e LibOverride: Add full support for camera's background images.
Add support for adding (inserting) new background images into an
override of a linked Camera ID.

Request from the Blender studio.

This ended up being more involved than expected as it uncovered some
latent issues with existing background images code. Noticiably, a new
`BKE_camera_background_image_copy` had to be added to handle copying
of background images in a proper, generic ID-management way.
2022-05-30 17:43:22 +02:00
Hans Goudey a5d9b3442d Cleanup: Move attribute domain count out of enum
The number of attribute domains is not an attribute domain.
This way it doesn't have to be handled in switch statements.

Differential Revision: https://developer.blender.org/D15065
2022-05-30 17:30:37 +02:00
Bastien Montagne 4267c6280a Fix (unreported) missing rna_path function for BackgroundImage struct. 2022-05-30 17:16:13 +02:00