Commit Graph

100284 Commits

Author SHA1 Message Date
Brecht Van Lommel
2efb3fc91a Fix build error with non-unity build 2023-06-09 14:44:08 +02:00
Julian Eisel
9b83e9b60c Refactor: Get rid of asset handle in most asset-list iterators
`AssetHandle` is meant as temporary design and should be replaced by
`AssetRepresentation`. This moves us another step closer to that.

There's now an iterator for the asset-list that provides an asset
representation instead of an asset handle. Use that whenever the
representation provides all necessary data (i.e. when no preview image
access is required).
2023-06-09 14:32:55 +02:00
Jacques Lucke
b8474d87b3 Merge branch 'blender-v3.6-release' 2023-06-09 14:19:27 +02:00
Jacques Lucke
5f7be257b8 Fix #107473: make links connected to unavailable sockets invalid
Such links shouldn't be considered at all. In fact, they might be removed
automatically in the future.
2023-06-09 14:14:47 +02:00
Germano Cavalcante
5621154185 Transform: Remove current 'Snap Base' in 'Set Snap Base' mode
The current `Snap Base` was available and displayed to allow snapping
to `Edge Perpendicular`.

However, the usefulness of perpendicular snapping in `Set Snap Base`
mode is questionable and can sometimes cause inconvenience.

Also, removing the current `Snap Base` indicator (the `X` drawing)
makes the intention of the operation more apparent.

Therefore, this commit removes both the indicator and the effect of the
current `Snap Base` in `Set Snap Base` mode.

Pull Request: https://projects.blender.org/blender/blender/pulls/108776
2023-06-09 14:12:15 +02:00
Hans Goudey
6ceb6fa27a Cleanup: Fix mistakenly nested loops in versioning code
Merge error in a previous commit.
2023-06-09 08:02:32 -04:00
Germano Cavalcante
2f88b12fc5 Fix missing versioning for 4d6da30d16
The lack of versioning caused the Placement Tool's "Snap To" to appear
as a white field.
2023-06-09 09:04:04 -03:00
Hans Goudey
46cf093270 Mesh: Remove face map list, convert to integer attribute
Face maps were added as a prototype of a new rigging solution during
2.8 development. Their storage is redundant with the newer generic
attribute system (specifically with integer face attributes), and
they were never used much. This commit removes the face map list
and converts the storage to an attribute with the name `face_maps`.
There is nowhere to store the face map names anymore, so those
are not kept.

It probably still makes sense to have a feature like mesh face gizmo
selection for rigging. But the design and implementation woulds likely
have to change significantly, including possibly changing the storage
type, and making use of the generic attribute system instead of a
special type.

See #105317 for more discussion.
2023-06-09 13:54:52 +02:00
Jacques Lucke
9f0efb6390 Merge branch 'blender-v3.6-release' 2023-06-09 13:53:27 +02:00
Jacques Lucke
b344e4ba61 Fix #108704: missing redraw after timeline scrubbing with temporal denoise
The issue was caused by 037b3f87bd.
2023-06-09 13:49:31 +02:00
Sergey Sharybin
e682133d2d Fix use of nullptr field to calculate array size
Is probably harmless in practice, but the ASAN was generating an
error about it:

  draw_manager_data.cc:187:59: runtime error: member access within null pointer of type 'struct DRWUniformChunk'

Pull Request: https://projects.blender.org/blender/blender/pulls/108798
2023-06-09 12:34:53 +02:00
Julian Eisel
0044c93e84 Cleanup: Use ID type enum instead of unsafe integer
Adds type safety and removes need for explicit casts.
2023-06-09 12:27:23 +02:00
Sergey Sharybin
c70a1595ef Fix uninitialized alpha channel in classic Kuwahara filter
Was only happening for the tiled compositor implementation.

This is likely to be the source of flackey tests on the
buildbot.

Also, the reference image was empty because of this, so
it needs to be re-generated.

Pull Request: https://projects.blender.org/blender/blender/pulls/108800
2023-06-09 12:15:56 +02:00
Sybren A. Stüvel
6452eccc80 #107126: Make FCurve.update() also deduplicate keys
The RNA function `FCurve.update()` now also deduplicates keys. This is done
in a way that is independent of key selection; simply the last key in the
list of keyframes 'wins' and overwrites earlier ones. It is exactly the
same as `FCurve.keyframe_points.deduplicate()`.
2023-06-09 12:06:27 +02:00
Jeroen Bakker
f5dd7d5e6c Vulkan: Fix Workbench Normals
Workbench normals where inverted resulting to drawing artifacts like:
- Black pixels during matcaps (normals contained NAN values)
- Studio light inverted

The root cause for this was that Vulkan default to determine if a
primitive is facing the camera should be switched. The default was still
incorrect.

Although this fixes it, a better solution is to determine the front
facing based on if the viewport should be switched. As all rendering
occurs when the viewport is inverted it doesn't matter at this moment.

Pull Request: https://projects.blender.org/blender/blender/pulls/108797
2023-06-09 11:54:06 +02:00
Jacques Lucke
d154ebfa83 RNA: support compiling rna files as C++ code
Compiling files in `makesrna` as C code is often a bit annoying when converting
other files to C++ (#103343). That's because one often had to introduce additional
C wrappers.

The goal of this patch is to support compiling rna files as C++ code. This mostly
required changes in `makesrna.c` to make the generated code compatible with C
and C++. The cmake code had to change a bit as well because we need to pass
different compiler options for C++ code to avoid some warnings.

This commit also converts a few rna files to C++ already, although that is mostly
just for testing. The rest of the files are expected to be converted after this patch
is merged.

It's possible, even likely, that `makesrna.c` has to change a little bit more to
support C++, but that is hard to know without converting all files first.

Co-authored-by: Lukas Tönne <lukas@blender.org>
Co-authored-by: Ray Molenkamp <github@lazydodo.com>

Pull Request: https://projects.blender.org/blender/blender/pulls/108290
2023-06-09 11:45:41 +02:00
Bastien Montagne
7ef8389dad Fix #108746: Defaults / Save startup file don't save the window size.
Hopefully now the behavior is fully consistent with before the refactor,
current implemented one by this commit:

- When loading factory settings file on startup, go full-screen.
- In all other startup cases, use size as stored in the startup .blend
  file.

Regression from ebb5643e59 and 32bbfbb06e.
2023-06-09 11:29:15 +02:00
Pratik Borhade
34bca3be26 Merge branch 'blender-v3.6-release' 2023-06-09 14:52:46 +05:30
Pratik Borhade
9735b8ee71 Fix #106966: Register undo-step when unlinking data-block
When unlinking IDs like GN tree, materials, etc. undo step is not created.
To fix this, assign `undo_push_label` a string value for registering an
undo-step (with the help of `ED_undo_push`)

Pull Request: https://projects.blender.org/blender/blender/pulls/108452
2023-06-09 11:20:41 +02:00
Sergey Sharybin
884b1e8cc3 BLI: Add math::exp() function
Covers both arithmetic and vectorized types.

Pull Request: https://projects.blender.org/blender/blender/pulls/108793
2023-06-09 10:33:29 +02:00
Clément Foucault
31c986998b Metal: Fix operator precedence bug 2023-06-09 10:15:04 +02:00
Chris Blackbourn
0050a67c7a Merge branch 'blender-v3.6-release' 2023-06-09 15:35:04 +12:00
Chris Blackbourn
31ce143569 Fix #108786: Logic errors with pinned islands inside uv packer
Pinning information was accidentally skipped inside of the
UV packing engine because of their ordering.

This was most noticeable when using the "Bounding Box" shape
method, causing some pinned islands to be moved when they
should have been locked in place.
2023-06-09 15:29:43 +12:00
Campbell Barton
2f1899a7fa Cleanup: spelling in comments 2023-06-09 11:40:50 +10:00
Campbell Barton
4805930084 Cleanup: use 'r_' prefix for return argument 2023-06-09 11:39:25 +10:00
Campbell Barton
896c8d7a13 Cleanup: move space_console & space_info to C++ 2023-06-09 11:28:29 +10:00
Campbell Barton
b7d2ff61bc Fix building with MSVC (address errors) 2023-06-09 11:14:13 +10:00
Germano Cavalcante
0ed8195486 Fix assert failing after 4d6da30d16
Assert can be triggered if only `SCE_SNAP_MODE_FACE_NEAREST` is used.
2023-06-08 22:08:02 -03:00
Campbell Barton
55c05e037b Fix error building from missing includes 2023-06-09 09:49:02 +10:00
Joseph Eagar
2ed675c3fb Cleanup: move bmesh_interp.c to c++ 2023-06-08 14:59:31 -07:00
Hans Goudey
65d8cfd82d BLI: Add hash function to quaternion type
Just reuse the 4D vector hash.
This allows creating a CPPType for math::Quaternion.
2023-06-08 17:42:36 -04:00
Hans Goudey
04422064fb Cleanup: Fix mistaken dependency between rotation headers
The quaternion header depended on the old C header where it doesn't
need to with a better alternative in the newer C++ types. Also remove an
unused function in another header.
2023-06-08 17:33:47 -04:00
Hans Goudey
65d294c385 Geometry Nodes: Use smaller grain size for sampe nearest surface node
This increases the framerate in a production file from about 2.3 to 2.5
FPS, and reduces gaps in a profile where the CPU was waiting for just
a few threads to finish the BVH tree lookups. If BVH lookups become
faster in the future, this grain size could be increased.
2023-06-08 16:26:11 -04:00
Hans Goudey
38833a20a6 Merge branch 'blender-v3.6-release' 2023-06-08 15:59:10 -04:00
Hans Goudey
fd74b280d9 Fix: Amend previous windows build error fix
Thanks to Ray for helping with this!
2023-06-08 15:55:47 -04:00
Hans Goudey
38eb063c0c Merge branch 'blender-v3.6-release' 2023-06-08 15:34:41 -04:00
Hans Goudey
0dde6ab424 Fix: Build error after previous remesh fix
MSVC requires some coddling to understand these templates.
2023-06-08 15:32:57 -04:00
Julian Eisel
631e5d5d4f Asset system: Store ID type in asset representation
No user visible changes expected.

This brings us another step closer to replacing the temporary asset
handle design with the proper asset representation design. I held off
with this a bit because we eventually want to support non-ID assets, but
for now it is fine to consider all assets to be IDs. In future the asset
system can make the necessary distinctions still.

Now only the preview is handled via asset handle still.
2023-06-08 20:55:10 +02:00
Germano Cavalcante
4d6da30d16 Cleanup: Remove unsupported mode from macro 'SCE_SNAP_MODE_GEOM'
`SCE_SNAP_MODE_FACE_NEAREST` is actually not supported as one of the
geometry snap modes.

It is not used for either the snap cursor or the `Set Snap Base` mode.
2023-06-08 15:55:43 -03:00
Hans Goudey
fcc9828141 Merge branch 'blender-v3.6-release' 2023-06-08 14:04:07 -04:00
Hans Goudey
2b45f2d662 Mesh: Fix remesh color attribute propagation, improve performance
Fixes #108730

The call to `CustomData_interp` also interpolated the face corner
topology attributes, which broke the mesh completely. To fix this,
avoid relying on the CustomData API and move the attribute
interpolation to use the attribute API instead. This change also
makes it trivial to support all attribute types in the future.

Also, only retrieve the closest vertex once, instead of doing it
again for every attribute. Combined with building the topology
maps in parallel this approximately doubled the performance
of color attribute propagation in a test with 2 million vertices
and 8 color attributes on both domains (63 to 34 ms).

Pull Request: https://projects.blender.org/blender/blender/pulls/108773
2023-06-08 19:58:13 +02:00
Julian Eisel
a7a3c00f76 Cleanup: Get asset ID via asset representation, not via file
It is preferred to get asset data via the asset representation now,
since this should replace the file based asset handle design.
2023-06-08 19:25:12 +02:00
Julian Eisel
4394de611f Asset system: Add public functions for asset identifier query
No user visible changes expected.

This is needed in #104831 but makes sense to expose publicly in the
asset system APIs either way. So committing this to the main branch
already.
2023-06-08 18:51:00 +02:00
Jason Fielder
cddb53558f Metal: Resolve issues with buffer reading and clearing
Ensure buffer read operations wait for pending GPU work to
complete. This is only required for unit tests, but required to
ensure correct results in all cases. Also adds support for staging
buffer if GPU memory type is private.

Buffer clearing routine added to support values above 1 byte.
The previous buffer clearing functionality using fillBuffer writes
values to each byte, rather than the full 32 bit uint used by the
GPU API.

Authored by Apple: Michael Parkin-White

Pull Request: https://projects.blender.org/blender/blender/pulls/108757
2023-06-08 18:30:51 +02:00
Harley Acheson
a4faea2df6 Merge branch 'blender-v3.6-release' 2023-06-08 09:29:45 -07:00
Leon Schittek
16c9eacf41 UI: Correct default width of toolbars
Correct default initial widths of toolbars

Pull Request: https://projects.blender.org/blender/blender/pulls/108292
2023-06-08 18:27:59 +02:00
Julian Eisel
56f4610a50 Cleanup: Make asset-list function static
The function has static behavior, i.e. doesn't depend on an `AssetList`
instance, so its APIs should reflect that.
2023-06-08 18:22:57 +02:00
Sergey Sharybin
a7644fd5bb Cleanup: Use references in the motion tracking code
Used for arguments which are not supposed to be nullptr.

Pull Request: https://projects.blender.org/blender/blender/pulls/108767
2023-06-08 17:55:16 +02:00
Julian Eisel
179a2421ca Refactor: Better context override for text button activate API function
No user visible change expected.

It wasn't clear that the caller of `UI_textbutton_activate_rna()` would
have to override the context region for it to work correctly. This is
only the case because UI internals happen to require it.

Instead of implicitly requiring the caller to do the context override so
UI internals work, do the override inside of the API function in
question.
2023-06-08 17:34:34 +02:00
Julian Eisel
133c395336 Fix string buffer size for asset library path query
`FILE_MAX` is enough here, since the returned string will only be the
path to the .blend file, not the full path into the .blend library.
2023-06-08 17:19:37 +02:00