Commit Graph

107569 Commits

Author SHA1 Message Date
Hans Goudey
4e196f916c Cleanup: Remove unnecessary AssetListStorage class
This class was just used to hold some functions which can just as well
be declared static outside of any class. It was never even instantiated.
Removing the class removes some indirection in this file that made
the code less readability, and avoids misleading readers.

Pull Request: https://projects.blender.org/blender/blender/pulls/119137
2024-03-07 18:56:24 +01:00
Habib Gahbiche
ab3b8df693 Fix #116249: Compositor: Gizmos ignore backdrop transformations
Consider offset caused by transform and translate nodes in backdrop.

Affected nodes are:
- Corner Pin
- Sun Beams.

The behavior is now slightly different for rotated images (using a transform or rotate node) compared to Tiled compositor: the gizmos might move when image is rotated. The reason is the Full Frame compositor changes the image dimensions after rotation

Pull Request: https://projects.blender.org/blender/blender/pulls/119025
2024-03-07 18:47:28 +01:00
Bastien Montagne
d99fffc460 GPv3: Legacy Conversion: Animation: Optimize fcurves handling.
Did not realize it, but original commit was re-generating some 'static'
strings (at modifier level) for each and every processed FCurves!

Now create these base RNA paths only once per modifier, outside of the
lambda callback.
2024-03-07 17:39:40 +01:00
Sybren A. Stüvel
90ef46baa1 Anim: DNA for Animation data-block
Introduce new DNA for the `Animation` data-block and its sub-data.

This includes the blenkernel code for reading & writing to blend files,
and for memory management (freeing, duplicating). Minimal C++ wrappers
are included, with just the functionality needed for blenkernel to do
its job.

The Outliner code is extended so that it knows about the new data-type,
nothing more.

For more info, see issue #113594.

Pull Request: https://projects.blender.org/blender/blender/pulls/119077
2024-03-07 16:41:25 +01:00
Omar Emara
559ad5e0f9 Compositor: Add utility for sampling buffer at normalized coordinates
This patch adds a new utility method to the MemoryBuffer class to sample
the buffer at normalized coordinates.
2024-03-07 16:56:02 +02:00
Philipp Oeser
77168d960a Merge branch 'blender-v4.1-release' 2024-03-07 15:46:04 +01:00
Sybren A. Stüvel
35a5518379 Cleanup: Sculpting, fix compiler warning
Fix 'unused variable' warning in release-mode builds. The variable is
only used in a `BLI_assert`.

I've assumed that the call to `BKE_sculpt_object_pbvh_ensure()` is still
important, and not just there for the assertion.

No functional changes.

Pull Request: https://projects.blender.org/blender/blender/pulls/119158
2024-03-07 15:43:55 +01:00
Philipp Oeser
5d1d447c2b Fix #114552: Copy material to selected crash on object lacking slot
Caused by 9c1da81a4c.

This happened in the case where objects shared the same data and slots
are assigned to object and receiving object did not have a material slot
yet.

Then, `ob->matbits` may be NULL, now just check for this, too.

Pull Request: https://projects.blender.org/blender/blender/pulls/119161
2024-03-07 15:43:47 +01:00
Omar Emara
5ab0cc8e74 Fix: Interpolation with clamped boundary returns zero
The BLI image interpolation function with clamped boundary returns zero
for out of bound pixels. That's because the neighbour pixel wrapping
condition disregarded the border template argument. To fix this, only
handle that condition if in border mode.

Pull Request: https://projects.blender.org/blender/blender/pulls/119164
2024-03-07 15:34:42 +01:00
Hans Goudey
c8efea42e1 Cleanup: Remove unnecessary braces for container default constructors
These containers (Set, Vector, Map, Span), etc. have default constructors,
making the braces unnecessary for default initialization. Better to depend
on that consistently rather than having braces in some places and not others.
2024-03-07 09:30:23 -05:00
Hans Goudey
d727738157 Cleanup: Comment formatting
Use consistent formatting for multi-line comments.
2024-03-07 09:30:22 -05:00
Hans Goudey
c25a635587 Core: Avoid double map lookup in ID remapping
Theoretically this could improve performance when remapping
many IDs, but the goal is more to have consistent best practices
in the use of `Map`.
2024-03-07 09:30:22 -05:00
Hans Goudey
72758f3296 Cleanup: Use FunctionRef for IDRemapper callback
This avoids the need for a separate argument struct in a few cases
and generally makes the remapping friendlier to use with lambdas.
2024-03-07 09:30:22 -05:00
Hans Goudey
2f0fa33eec Cleanup: Remove unnecessary void keyword in C++ function declarations 2024-03-07 09:30:22 -05:00
Hans Goudey
d22a8b0a16 Cleanup: Remove unnecessary namespace specification 2024-03-07 09:30:22 -05:00
Hans Goudey
8c16d06858 Cleanup: Use reinterpret_cast instead of C-style cast 2024-03-07 09:30:22 -05:00
Hans Goudey
ddc9dcce86 Cleanup: Remove unnecessary AssetLibraryReferenceWrapper class
This class was used to make `AssetLibraryReference` work as a key
in `Map`. But defining a class for that is unnecessary. Instead it's
simpler to just declare the equals and hash operators separately.
Reducing the number of wrappers and indirections should make
this code slightly easier to understand.
2024-03-07 09:30:22 -05:00
Germano Cavalcante
1697f17617 Fix: 'ED_view3d_has_depth_buffer_being_used' not declared
Caused by dd0e60fb51
2024-03-07 11:27:03 -03:00
Germano Cavalcante
dd0e60fb51 3D View: Do not recalculate the depth buffer for 'Auto Depth'
This is a solution to avoid redrawing the depth buffer for each Zoom
with `Auto Depth`.

The solution is to move the `ED_view3d_depth_override` function out of
`ED_view3d_autodist` and only call `ED_view3d_depth_override` if the
depth buffer is not used by any current engine.

Pull Request: https://projects.blender.org/blender/blender/pulls/113026
2024-03-07 15:16:41 +01:00
Lukas Tönne
645aeb9dbe Fix #119055: GPv3: Set end caps correctly with hard eraser
The hard eraser changes end caps to "flat" when cutting strokes. This
requires detecting when the start or end points of a stroke have been
cut.

The previous method relied on checking the next curve's start point for
cuts to determine end point cuts, but this only holds true for cutting
strokes in the middle. When only the start point is cut the preceding
curve should not be affected.

The new test uses local properties of the `PointTransferData` to detect
unchanged source curve end points, instead of doing a look-ahead for the
next curve. This works using the source point indices, which are
inverted for end points. Combined with checking for the `is_cut` flag
this gives a reliable answer to when a stroke end point is cut.

Pull Request: https://projects.blender.org/blender/blender/pulls/119151
2024-03-07 15:15:57 +01:00
Philipp Oeser
74665e0e38 Merge branch 'blender-v4.1-release' 2024-03-07 11:32:26 +01:00
Philipp Oeser
1f62fca321 Fix #116339: "Show Hidden Objects" operator's options missing
The property is actually there, but was marked PROP_SKIP_SAVE |
PROP_HIDDEN in 4234cddda9

This PR removes this again (with the consequence that shortcuts/menu
entries will now remember the select setting from the last time).

This is now in line to how editmode does this (the "Reveal Hidden"
operator).

Pull Request: https://projects.blender.org/blender/blender/pulls/119153
2024-03-07 11:31:41 +01:00
Philipp Oeser
d5fe4c40ed Fix #79961: Outliner Data API crash with a MeshSkinVertex in editmode
When in mesh editmode, skin_vertices point to bmesh customdata, the
skin_vertices data is empty since custom data is stored per element
instead of a single array there (same es UVs etc.).

Fix similar to 3e2619b3e7, 5179b8236b (basically disallowing the
access in editmode).

Pull Request: https://projects.blender.org/blender/blender/pulls/119149
2024-03-07 11:30:58 +01:00
Campbell Barton
0cd414120b Unbreak build on macOS with AppleClang from recent cleanup
Exact an exact match with Clang broke building when the compiler ID
was "AppleClang", reverting parts of [0].

[0]: 6549019ae1
2024-03-07 19:56:58 +11:00
Campbell Barton
6549019ae1 Cleanup: use STREQUAL instead of MATCHES for exact comparisons
MATCHES takes a REGEX and searches the input for a match,
this isn't necessary for CMAKE_SYSTEM_PROCESSOR & CMAKE_*_COMPILER_ID.
2024-03-07 17:56:41 +11:00
Hans Goudey
1e1d7034ec Cleanup: Move GPU_uniform_buffer.h to C++ 2024-03-06 21:54:28 -05:00
Campbell Barton
2d3a1aa238 Cleanup: spelling in comments 2024-03-07 13:29:18 +11:00
Campbell Barton
9796805bb8 Cleanup: sort CMake source files 2024-03-07 13:29:09 +11:00
Harley Acheson
6618755912 UI: Improvements to Confirmation of Save Startup
A more informative confirmation dialog to confirm that the user wishes
to save new default startup file.

Pull Request: https://projects.blender.org/blender/blender/pulls/117152
2024-03-07 00:19:31 +01:00
Harley Acheson
00b4fdce2c UI: Improvements to Confirmation of Load Factory
A more informative confirmation dialog to confirm that the user wishes
to load factory startup and settings.

Pull Request: https://projects.blender.org/blender/blender/pulls/117153
2024-03-06 23:25:52 +01:00
Harley Acheson
3bacd93ba6 UI: Improvements to Confirmation of Load Factory Preferences
A more informative confirmation dialog to confirm that the user wishes
to load factory user preferences.

Pull Request: https://projects.blender.org/blender/blender/pulls/117151
2024-03-06 22:57:36 +01:00
Germano Cavalcante
06bc23f08e Fix: warnings caused by d53d7dea71
`sub_v3_v3v3` was being used with `float2`
And unused function.

Ref. d53d7dea71
2024-03-06 18:16:03 -03:00
Hans Goudey
eb8557f8a7 Cleanup: Use snake case for function names in file list 2024-03-06 14:31:51 -05:00
Germano Cavalcante
7f1b70ac50 Fix: errors in the Edge Slide computed direction
The Edge Slide code was practically redone to correct errors and to
enable this operator to become a generic transform operator.

The errors are;
1. Unpredictable slide direction when the vertex "slides" over multiple
    edges.
2. Incorrect direction when the sliding edge has disconnected faces.

The fixes were:
- When the sliding direction splits into multiple directions, the
  chosen target is now the intersection of the destination edge lines
  (instead of the average point or a randon point)
- If the edge faces disconnect, the vertex slides in different
  directions on each face.

Other changes:
- Use C++ for Array e Vector types.
- Create methods to access or edit struct parameters.
- Use `TransData` to access the initial position of the vertex.
- Acess slide vertice by reference.
2024-03-06 15:58:20 -03:00
Miguel Pozo
1dd57369f2 Cleanup: EEVEE-Next: Remove unused parameter 2024-03-06 19:32:47 +01:00
Germano Cavalcante
b4f1d15af6 Cleanup: generalize Vert Slide data with common C++ and transform types
Changes:
- Use C++ for Array e Vector types.
- Create methods to access or edit struct parameters.
- Use `TransData` to access the initial position of the vertex.

These changes will allow Vert Slide to be compatible with other
transform "convert_types".
2024-03-06 15:18:28 -03:00
Hans Goudey
82240c12b8 Merge branch 'blender-v4.1-release' 2024-03-06 12:40:42 -05:00
Bartosz Kosiorek
bfee43a5c9 UI: Add input descriptions for Principled BSDF parameters
Pull Request: https://projects.blender.org/blender/blender/pulls/119131
2024-03-06 18:24:23 +01:00
Hans Goudey
d196046a3a Fix: Zeroed transform with asset object drag & drop
In future files from 4.2, `object_to_world` is moved to a runtime struct
and therefore isn't saved in files. It was always considered runtime information
though, since it's built by depsgraph evaluation and copied back to the original
object. Therefore to have the proper data in `object_to_world` we need to
evaluate the depsgraph.

This partially solves #118694, but there is still an issue with the snap cursor
system never running before using the `plane_omat` value.
2024-03-06 12:24:08 -05:00
Brecht Van Lommel
0d15abe683 Merge branch 'blender-v4.1-release' 2024-03-06 18:03:42 +01:00
Brecht Van Lommel
d08f63e7cb Fix #116956: Bake multires crash with simplify subdivision
Ignore simplification for the purpose of baking. Thanks to Philipp for
suggesting the fix.
2024-03-06 17:56:34 +01:00
Germano Cavalcante
2d50a41d77 Edge Slide: use snap system to check sliding vertex visibility
This is a different solution to #32068

The sliding edge occlusion test is done to prevent a non-visible
reference vertex from being used to calculate the factor direction.

This commit changes the behavior, but the difference is difficult to
notice.

The changes in behavior are:
- Other objects affect occlusion.
- Slide direction is used to test occlusion instead of edge.
- The reference point is now the point whose direction is visible and
  is closest to the mouse cursor.
2024-03-06 13:50:27 -03:00
Germano Cavalcante
d53d7dea71 Cleanup: Use C++ types for vectors
And remove unused members.
2024-03-06 13:50:27 -03:00
Germano Cavalcante
388448cdcb Fix: wrong drawing of Edge Slide with Even for inner sliding vertex
The code checked to see if `v_side` existed to create the drawing, but
the direction can exist without a `BMVert` in the target.

Remove this `v_side` member as there is really no use for it.
2024-03-06 13:50:27 -03:00
Germano Cavalcante
3ad1fb520c Cleanup: move the Vert Slide data creation code to the mesh convert file 2024-03-06 13:50:27 -03:00
Germano Cavalcante
6888d7bc87 Cleanup: move the Edge Slide data creation code to the mesh convert file
tmp
tmp
2024-03-06 13:50:27 -03:00
Brecht Van Lommel
060878b286 Merge branch 'blender-v4.1-release' 2024-03-06 17:49:35 +01:00
Brecht Van Lommel
ee98482b44 Fix #119058: Crash with OpenGL render and 3D viewport lock rotation 2024-03-06 17:46:08 +01:00
Hans Goudey
0ca9f633a2 Curves: Disable draw tool radius preview
Currently user feedback suggests this overlay is getting in the way
more often then not, since it is usually quite large compared to the
scale of the model. In the future it could be enabled/disabled based
on the "strand/strip" display option, which is planned to move to
objects instead of the scene in the future. However, until then, it
seems better to disable the preview.
2024-03-06 11:11:25 -05:00
Bastien Montagne
ea73438e8a LibOverride: Use new BKE_id_copy_in_lib to create ID in libraries.
This replaces the somewhat hackish and usafe code used previously.

Also fixes a potential bug, where the newly created `local_id` was
dereferenced before checking for it to be non-null.

Pull Request: https://projects.blender.org/blender/blender/pulls/108328
2024-03-06 17:05:13 +01:00