Commit Graph

99439 Commits

Author SHA1 Message Date
Jacques Lucke
493c4dd65b Geometry Nodes: add theme option for simulated frames in timeline
The new theme setting for the dope sheet (timeline) allows changing the
color of the bar that shows which frames are cached/baked. The
invalid/cached/baked status is differentiated by hardcoded transparency
values. In theory, those could be separate theme settings though.

Pull Request: https://projects.blender.org/blender/blender/pulls/107738
2023-05-10 14:19:27 +02:00
Philipp Oeser
d6092a6c36 Fix #107670: Lattice undo misses vertex group weights data
Operations such as assigning or removing weights were simply not
undoable (no previous weights were applied back to the EditLatt). Now
add MDeformVert data to UndoLattice and handle with
appropriate functions during Undo.

Pull Request: https://projects.blender.org/blender/blender/pulls/107776
2023-05-10 09:23:40 +02:00
Omar Emara
fc7b5f993b Cleanup: Follow naming conventions for Plane Track node 2023-05-10 09:51:47 +03:00
Campbell Barton
ed5dee857e Fix blender failing to link WITH_USD when building for the first time
Blender would fail to link to USD before MaterialX files were
copied to the install targets lib/ directory.
Resolve by including ${LIBDIR}/materialx/lib in link_directories.
2023-05-10 16:25:17 +10:00
Campbell Barton
0d171bc5be Cleanup: quiet enumerated type warning 2023-05-10 14:44:12 +10:00
Campbell Barton
ee09d75e80 Cleanup: naming of looptri indexing variables
looptris were referred to as both tris & faces, sometimes polygons
were referred to as faces too. Was especially error prone with
callbacks that took both a tri and a tri_i arguments.
Sometimes tri_i represented a looptri index, other times the corner of
the triangle from 0-2. Causing expressions such as:
`args->mlooptri[tri].tri[tri_i]`

- Rename tri & tri_index -> looptri_i.
- Rename faces -> looptris.
- Rename face_index/poly_index/poly -> poly_i.
- Declare looptri_i at the start of the loop and reuse it,
  in some cases it was declared with args->prim_indices[i] being
  used as well.
2023-05-10 14:21:39 +10:00
Campbell Barton
0168c4b893 Cleanup: remove unused "dds" directory
Missing from [0] which duplicates some code into format_dds.cc.

[0]: aa3bdfd76a
2023-05-10 12:35:41 +10:00
Campbell Barton
46479f41e1 Cleanup: quiet dangling-reference warnings with GCC13 2023-05-10 12:06:27 +10:00
Richard Antalik
bb51cdedb7 Cleanup: Clang-format 2023-05-09 22:47:57 +02:00
Hans Goudey
ac02f94caf Fix #107123: Refactor sculpt normal calculation to require vert poly map
Change PBVH normal calculation to also update vertices connected to
vertices with an update tag. This is necessary because vertex normals
are the mixed face normals, so changing any face's normal will change
the normals of all connected faces.

This change requires that the PBVH always have a vertex to face
topology map available. In the future this will likely be cached on
meshes though, which will reduce the delay it adds when entering sculpt
mode.

Now, first all face normals are updated, then the normals for
connected vertices are mixed from the face normals. This is a
significant simplification to the whole process, which previously
worked with atomics and normals at the triangle level. Similar changes
changes for regular non-sculpt normal calculation are being worked on
in #105920.

Pull Request: https://projects.blender.org/blender/blender/pulls/107458
2023-05-09 22:36:30 +02:00
Richard Antalik
c9be925f7d Fix #107289: Sound strips are invisible and overlap
In some cases strips may end up with speed factor of 0 which causes
offsets and position to be invalid. The exact cause is unknown, but
most likely caused by `do_versions_sequencer_init_retiming_tool_data()`.

This could possibly happen if 3.6 file is saved with 3.5 version and
then opened again with 3.6 version.

To fix strips, retiming data is removed, start offset reset and speed
factor is set to 1. Previous versioning code is fixed, so speed factor
is never set to 0.

Pull Request: https://projects.blender.org/blender/blender/pulls/107798
2023-05-09 22:14:17 +02:00
Hans Goudey
3a0d17ceea Cleanup: Correct commet about curves bounds
Missing from 97a8bb450c
2023-05-09 13:03:08 -04:00
Hans Goudey
3f44b24cf2 BLI: Use inline instead of static for bounds functions
Avoid instantiating the templates separately in every translation unit.
This saves 20 KB in my Blender binary. Also remove a timer mistakenly
committed.
2023-05-09 12:54:55 -04:00
Ray Molenkamp
d65d9f4b97 CMake/Windows: Install materialX render dll's when available
This is in preparation for the 3.6 library update landing on windows.
2023-05-09 10:21:32 -06:00
Hans Goudey
6323d56eb5 Mesh: Tag no loose verts and edges when converting from BMesh
This saves about 6 ms every update when in edit mode on a 1 million
face grid. For reference, the BMesh to Mesh conversion took 80 ms,
before and after the change.
2023-05-09 12:13:09 -04:00
Sybren A. Stüvel
8ce040cf1a Anim: avoid increasing NULL pointer
Avoid calling `next++` when `next` is `NULL`.

In practice this should be a non-functional change, but it avoids ASAN
messages.
2023-05-09 16:05:40 +02:00
Lukas Tönne
263bf63509 Cleanup: Remove versioning for simulation zone socket identifiers
This was added temporarily during development.
Loading files created in the geometry-nodes-simulation branch (3.5.4
and older) will remove links from simulation zones, which need to be
added back manually.

Pull Request: https://projects.blender.org/blender/blender/pulls/107781
2023-05-09 15:15:40 +02:00
Clément Foucault
4436909c1d Workbench-Next: Fix shader compilation
Was a missing case from recent fix:
aa31d9be80
2023-05-09 14:37:13 +02:00
Jeroen Bakker
a68c78a3ee Vulkan: Don't Use Tiled Drawing
Similare to the Metal backend, Vulkan keeps data of the full texture
around as they will be executed by the same submission. So there are
no benefits to splice a texture into smaller parts, but adds overhead
as more commands are required to be processed.

Pull Request: https://projects.blender.org/blender/blender/pulls/107728
2023-05-09 14:12:44 +02:00
Omar Emara
f9b5b0efd2 Fix #107583: HSV node gives differ from CPU compositor
The HSV node in the realtime compositor produces different values from
the CPU compositor in its identity settings.

This happens because the realtime compositor clamped the saturation
value after HSV correction, while the CPU compositor did not, so this
patch unifies that behavior. Additionally, negative values are now
clamped in both the HSV node and Hue correction node to also match the
CPU compositor.
2023-05-09 14:22:35 +03:00
Brad Smith
322dab936f Build: fixes for OpenBSD
Pull Request: https://projects.blender.org/blender/blender/pulls/107666
2023-05-09 13:19:16 +02:00
Jacques Lucke
8ba9d7b67a Functions: improve handling of thread-local data in lazy functions
The main goal here is to reduce the number of times thread-local data has
to be looked up using e.g. `EnumerableThreadSpecific.local()`. While this
isn't a bottleneck in many cases, it is when the action performed on the local
data is very short and that happens very often (e.g. logging used sockets
during geometry nodes evaluation).

The solution is to simply pass the thread-local data as parameter to many
functions that use it, instead of looking it up in those functions which
generally is more costly.

The lazy-function graph executor now only looks up the local data if
it knows that it might be on a new thread, otherwise it uses the local data
retrieved earlier.

Alongside with `UserData` there is `LocalUserData` now. This allows users
of the lazy-function evaluation (such as geometry nodes) to have custom
thread-local data that is passed to all the lazy-functions automatically.
This is used for logging now.
2023-05-09 13:13:52 +02:00
Campbell Barton
21e6677682 Fix renaming bookmarks stripping non-UTF8 characters 2023-05-09 20:33:47 +10:00
Campbell Barton
768948f51b Cleanup: correct strcpy use for RNA string access 2023-05-09 20:33:11 +10:00
Campbell Barton
c183962c5d Cleanup: quiet unused variable warnings in release builds 2023-05-09 20:32:13 +10:00
Campbell Barton
7f7804e62d Cleanup: use doxygen groups for BLI_string_tests 2023-05-09 20:32:13 +10:00
Sybren A. Stüvel
5532d05622 Anim: remove assumption of array_index order when blending quaternions
The pose library blending code assumed that quaternions would be keyed
in order of `array_index`. This is normally the case when creating a
pose asset, but when manually editing a pose asset Action this
assumption may not hold.

The code still assumes that all FCurves of a single quaternion are
sequential, i.e. are not inter-mixed with other keyed properties. They
just no longer have to be ordered by array index.

Ref: blender-addons/issues#104591
2023-05-09 11:26:27 +02:00
Omar Emara
e8c660b855 Realtime Compositor: Implement Denoise node
This patch implements the Denoise node for the realtime compositor. The
denoiser executes on the CPU and we pay for the CPU<->GPU round trip to
memory, so this is not realtime, as one might expected. And is just a
temporary implementation until OIDN supports GPU execution.

This is different from the CPU implementation in that it doesn't use the
auxiliary passes if they were not provided, because using an inflated
buffer of an undefined value doesn't make much sense.

Pull Request: https://projects.blender.org/blender/blender/pulls/107375
2023-05-09 11:09:06 +02:00
Jeroen Bakker
43bee6ea69 Vulkan: Ensure Minimum Size of VKBuffer
In Vulkan it is not allowed to allocate a buffer of zero bytes. This
would generate an error. In Blender it is possible that a buffer is zero
bytes. For example when the draw manager is drawing instances and there
are no instanced in the scene.

This PR ensures that at least a single byte is allocated in order to not
fail later on.

Co-authored-by: Jeroen Bakker <j.bakker@atmind.nl>
Pull Request: https://projects.blender.org/blender/blender/pulls/107731
2023-05-09 10:20:54 +02:00
Jeroen Bakker
63cc5a1e61 Vulkan: Frame Buffer Flipping
Vulkan coordinate system is flipped compared to OpenGL. This PR
flips the drawing when drawn to the on-screen frame buffer.
Offscreen frame buffers are still drawn upside down.

The flipping is done by making the viewport of the framebuffer negative.

Pull Request: https://projects.blender.org/blender/blender/pulls/107743
2023-05-09 09:22:26 +02:00
Joseph Eagar
4768348583 Sculpt: fix topology automasking not working when factor cache exists 2023-05-08 22:18:38 -07:00
Campbell Barton
47149d2532 Cleanup: order string size argument after the string
This is the convention almost everywhere.
2023-05-09 15:06:41 +10:00
Campbell Barton
788a57c6ef Cleanup: reserve the suffix 'len' for string length 2023-05-09 15:02:12 +10:00
Campbell Barton
c49a0fa474 Cleanup: remove redundant use of BLI_snprintf (no formatting args given)
The SNPRINTF macro isn't usable as it expectes at least one argument.
2023-05-09 14:08:19 +10:00
Campbell Barton
3958ae7241 Cleanup: use STRNCPY, SNPRINTF macros 2023-05-09 14:08:19 +10:00
Campbell Barton
2d99b935f3 BLI_string: add macros to wrap BLI_vsnprintf 2023-05-09 13:16:09 +10:00
Hans Goudey
e151425c5c Fix #107694: Assert adding custom normals to empty mesh 2023-05-08 18:41:06 -04:00
Hans Goudey
150943e084 Cleanup: Move remaining sculpt_paint files to C++
See #103343

Pull Request: https://projects.blender.org/blender/blender/pulls/107757
2023-05-08 23:48:38 +02:00
Hans Goudey
ce96abd33a Fix: Build error after simulation header cleanup
Making the geometry state's geometry public to remove
the accessors didn't work without the constructor.
2023-05-08 17:21:15 -04:00
Hans Goudey
2f349ce884 Cleanup: Add comments to simulation state header
Pull Request: https://projects.blender.org/blender/blender/pulls/107744
2023-05-08 21:42:38 +02:00
Harley Acheson
8e4e616a4b Fix #106023: File Browser Lists with Incomplete Previews
Ensure all File Browser list items get previews.

Pull Request: https://projects.blender.org/blender/blender/pulls/107698
2023-05-08 20:53:08 +02:00
Iliya Katueshenock
819cd58864 Cleanup: Make Accumulate Attribute node more generic
Geometry Nodes strives to reduce template usage in code,
to use it only for extremely important loops or for template math
processing on attributes. Due to this, this pull request cleans up
to delete template classes and uses `convert_to_static_type` in
accumulate function directly.

Pull Request: https://projects.blender.org/blender/blender/pulls/104440
2023-05-08 20:36:12 +02:00
Julian Eisel
50d49e24c4 Asset Views: Decrease default preview cache size
This was set to a higher value than intended, because the actual caching
doubles the size internally. So it would keep up to 512 previews in
memory which is a bit excessive. See discussion in #107711.
2023-05-08 19:57:56 +02:00
illua1
07ac8cb15a Fix #107506: Depsgraph: non-geometry component is treated as geometry component
Pull Request: https://projects.blender.org/blender/blender/pulls/107509
2023-05-08 18:51:15 +02:00
Bastien Montagne
527b21f0ae LibOverride: Restore local references to virtual linked liboverrides on resync.
When resyncing linked liboverride data, new IDs may be created that do
not exist in actual library file (since the lib file has not been resynced).

If such 'virtual linked liboverrides' data-blocks are used locally (e.g.
by adding such object to a local collection), on next file read they will be
detected as missing.

Now resync code will list such missing linked IDs that were
liboverrides, and try to re-use them when matching (by root name and
library) with newly generated virtual liboverrides.

The process may not be 100% perfect, especially a perfect one-to-one
remapping cannot be ensured if source data keep being changed over and
over (because of the order in which virtual linked liboverrides
generated by resync may change over time). However, in practice this
should fix the vast majority of issues, especially if sane naming
practices are used on IDs.

---------------

For the record, an attempt was made to write liboverride data together
with the placeholders for linked IDs in .blendfile. In theory, this
should ensure a perfect and fully valid re-usage of such IDs.

However, for this to work, not only the liboverride data of linked IDs need
to be written on disk, but also all ID references in this data has to be
considered as directly linked, to ensure that such liboverride data can
be re-read properly.

Otherwise, these placeholders would get a liboverride data with NULL ID
pointers, which is useless.

Such change feels way to intrusive for the very limited benefit, so for
now would consider current solution as the best option.

Pull Request: https://projects.blender.org/blender/blender/pulls/107144
2023-05-08 18:22:33 +02:00
Sybren A. Stüvel
0327d2c963 Add missing notifier when setting cursor.matrix
Add a notifier when setting `scene.cursor.matrix`. This was already in
place for `cursor.location` and `cursor.rotation`, but was still missing
for `cursor.matrix`, which caused the cursor to remain displayed in its
old transform.
2023-05-08 16:58:26 +02:00
Jeroen Bakker
8759ae1760 GPU: Initialize SRGB In TestCases
Vulkan test cases uses SRGB conversion. These test cases where failing
as the conversion table wasn't initialized.

This PR initializes the conversion table and fix the Vulkan data
conversion tests.
2023-05-08 15:32:15 +02:00
Julian Eisel
7e79e0eec0 File Browser: Avoid filling file cache needlessly on auto-complete
This would iterate over all files and call the sneaky `filelist_file()`,
meaning each file would be added to the cache for a minor query. That's
plenty of unnecessary work and kinda defeats the purpose of the partial
cache design.
2023-05-08 15:01:00 +02:00
Julian Eisel
be19edf356 Cleanup: Add API comment on side-effect of file browser query function
`filelist_file()` is an easy way to do a bunch of unnecessary work and
fill the file browser caching for little reason. Unfortunately the
caching affects too many things to be a mere API implementation detail,
so rather be clear about this and point out alternatives.
2023-05-08 15:01:00 +02:00
Julian Eisel
c0ce427760 Cleanup: Move file cache lookup into function
The details on the file cache lookup just look confusing and make the
function look daunting. Encapsulate it into a function so it's trivial
to see what's going on
2023-05-08 15:01:00 +02:00