Commit Graph

123260 Commits

Author SHA1 Message Date
Hans Goudey
4edcae75aa Cleanup: Remove unused using keyword 2023-04-18 13:38:11 -04:00
Xavier Hallade
954c6c0ae6 Revert "Cycles: move oneAPI kernels dynamic library to blender.shared"
This reverts commit df096eab77436c0191f39806b0907aeb9744bee8.
There is a corner case for when WITH_CYCLES_ONEAPI_BINARIES is set to on
and later turned off during config, in case there is no ocloc.
2023-04-18 18:48:37 +02:00
Nathan Vegdahl
3a72442f63 Fix comment style in previous commit.
Pull Request: https://projects.blender.org/blender/blender/pulls/107091
2023-04-18 17:28:53 +02:00
Nathan Vegdahl
5bb3a3f157 Fix: segfault when indexing into some collections with strings.
This happens when the collection's item type doesn't have a
'nameproperty' to index with.  For debug builds we error out with an
assert, since in general this shouldn't happen.  For release builds
Python will report item not found.

Pull Request: https://projects.blender.org/blender/blender/pulls/107086
2023-04-18 17:15:22 +02:00
Hans Goudey
d818d05415 Cleanup: Remove unnecessary attribute provider callbacks
We don't use the callbacks that create virtual arrays from the custom data
anymore, they just add extra indirection. The only non-obvious case was
the crease attribute which had a setter function. Replace that with an
attribute validator like the other similar attributes.

Pull Request: https://projects.blender.org/blender/blender/pulls/107088
2023-04-18 17:13:38 +02:00
Pratik Borhade
7c927155b5 Fix #90159: Inconsistent display of active filters for import/export file dialogs
Use `filter_glob` property to list only operator extension files.
PR includes filtering for collada, usd, alembic file formats.

Old Revision: https://archive.blender.org/developer/D16739

Pull Request: https://projects.blender.org/blender/blender/pulls/107034
2023-04-18 15:57:45 +02:00
Sergey Sharybin
63f309df11 Fix #107081: Slow selection with context variables
A solution for an older bug was causing it.

Added a special case to avoid an extra relation for context
variables as they do not change during the dependency graph
evaluation,

Pull Request: https://projects.blender.org/blender/blender/pulls/107082
2023-04-18 15:40:07 +02:00
Falk David
66158498de BLI: Return number of values removed from remove_if
Make the `remove_if` function for `Vector`, `VectorSet`, `Set`, and `Map` return the number of elements it removed.

Pull Request: https://projects.blender.org/blender/blender/pulls/107069
2023-04-18 13:28:14 +02:00
Xavier Hallade
25747301db Cycles: fix SYCL debug library linking on Windows 2023-04-18 12:33:48 +02:00
Campbell Barton
b623be3377 Cleanup: remove clang-format: off for EnumPropertyItem definitions
These aren't special cases so format them as is done with all other
enum-property declarations.
2023-04-18 20:30:00 +10:00
Campbell Barton
77268dbe3b WM: add versioning for 3.5 sculpt brushes (part of fix for #106057)
Add a versioning function for tool ID's which can be used if these
need to be changed in future.
2023-04-18 20:30:00 +10:00
Campbell Barton
7b4d71683f Fix #107060: Curves sculpt mode does not select default tool
Regression in [0] when curve tool names changed to use brush names
with the utility function generate_from_enum_ex().

[0]: 786734e6c8ddab6cbea7d42389f8f8190e59853c
2023-04-18 20:16:31 +10:00
Campbell Barton
58b1c54671 Cleanup: remove "Curves" suffix from curve sculpting enum
This isn't necessary information & types aren't included in other
brush names.
2023-04-18 20:16:31 +10:00
732fa26413 Fix #107032: API Document: matrix_channel (PoseBone) description incorrect
Update the RNA and DNA documentation for two bone matrices:

- `PoseBone.matrix_channel` (`bPoseChannel::chan_mat` in DNA) contains
  the evaluated loc/rot/scale channels, including constraints and drivers.
- `PoseBone.matrix` (`bPoseChannel::pose_mat` in DNA) contains the same
  transform, but then expressed in the armature object space.

No functional changes, just clarifications in comments / tooltips.
2023-04-18 12:01:45 +02:00
Weizhen Huang
4d7a7ce67c Fix #107050: accessing nullptr after progress is canceled 2023-04-18 11:58:07 +02:00
Bastien Montagne
6e75581e65 BKE: Rework ID swap code to properly handle embedded ID pointers.
While embedded IDs are usually considered as private local data of their
owner ID, some areas of code, like the depsgraph, can consider them as
regular IDs in some aspects.

So when swapping IDs, also properly 'counter-swap' their potential
embedded IDs, such that the pointers to the embedded IDs remain as before
swapping, even though the data of the embedded IDs is swapped.

The main target of this change is memfile undo code. There, newly read
IDs are swapped with their oldder version, so that the old address
contains the new data. This allows to avoid rebuilding some of the
depsgraph. Doing the same thing for embedded IDs should reduce even
further the needs for depsgrah rebuilds on undo steps.

This commit also gives more control over the remapping of 'self' ID
pointers inside themselves.

Pull Request: https://projects.blender.org/blender/blender/pulls/107044
2023-04-18 11:09:36 +02:00
Dalai Felinto
664b31ea73 Cleanup: make format 2023-04-18 09:45:01 +02:00
Jason Fielder
4d75f10a8a EEVEE: Optimise texture usage flags
Authored by Apple: Michael Parkin-White

Pull Request: https://projects.blender.org/blender/blender/pulls/107037
2023-04-18 08:11:46 +02:00
Aaron Carlisle
982392ca13 Docs: Update RNA to user manual url map
Fixes #107005
2023-04-18 01:12:27 -04:00
Hans Goudey
ab8acbbfe5 Cleanup: Use curve positions accessor function
There's no particular reason to use the attribute API instead here.
2023-04-17 23:38:10 -04:00
Hans Goudey
c234a802ba Cleanup: Remove unused using keyword 2023-04-17 23:38:10 -04:00
Hans Goudey
7bb8c8a5cf Cleanup: Improve comments about curves and mesh offset spans 2023-04-17 23:38:10 -04:00
Campbell Barton
c615ccde68 Fix splash preference overriding Read Home File's use_splash property
- Split out WM_init_splash_on_startup(..) which performs startup checks.
- WM_init_splash(..) now shows the splash (ignoring preferences).
- Avoid calling BLI_exists on an empty string (in some cases).
2023-04-18 12:59:13 +10:00
Jesse Yurkovich
1bb77d9eae Cleanup: Better logging for imbuf tests
Recent failures requiring investigation have exposed some shortcomings
that this addresses:
- When creating the diff image for offline comparison, use a higher
  threshold to prevent idiff from printing more output which will often
  contradict the primary failure output just above it (very confusing)
- For metadata failures, make sure these get printed so it's obvious
  what kind of failure we're dealing with

Pull Request: https://projects.blender.org/blender/blender/pulls/107058
2023-04-18 03:32:20 +02:00
Campbell Barton
302eb1e0d7 Cleanup: compile warning, correct wording 2023-04-18 11:04:08 +10:00
Campbell Barton
c4c1cc7cd3 Cleanup: double quotes for non-enum strings
Also use back-ticks for code-references in comments.
2023-04-18 10:51:32 +10:00
illua1
2f743b0a92 Cleanup: Replace manual flag checking with methods in node.cc
Not all flags have methods, and not all node primitive types have this.
Replacement of rather simple cases.

Pull Request: https://projects.blender.org/blender/blender/pulls/107055
2023-04-18 00:29:10 +02:00
Joseph Eagar
29f137e138 Sculpt: fix brush.falloff_shape not being reset in "reset brush" op 2023-04-17 15:16:35 -07:00
Joseph Eagar
96fa5fc2b3 Sculpt: Fix #106996: Mising null check in BKE_sculpt_update_object_before_eval 2023-04-17 14:05:29 -07:00
Xavier Hallade
df096eab77 Cycles: move oneAPI kernels dynamic library to blender.shared
After 17800e0c03c30a2f0059391821adf84f32616287, the oneAPI kernels library was still able to find sycl6.dll but that wasn't reliable.
We fix this by moving the oneAPI kernels library also into blender.shared.

Pull Request: https://projects.blender.org/blender/blender/pulls/106894
2023-04-17 21:47:35 +02:00
Brecht Van Lommel
09b770388a Fix #107004: Cycles shadow caustics not working with area lights
Tested the wrong variable after a refactor for light spread.
2023-04-17 20:46:08 +02:00
Brecht Van Lommel
870930bc32 Fix build error using WITH_CYCLES_LOGGING=OFF
Mismatch between glog and stubs. CHECK_NULL does not exist also. Tests
also require logging to be available.
2023-04-17 20:36:18 +02:00
Brecht Van Lommel
74eda0b6fc Fix build error on macOS after previous commit 2023-04-17 17:47:29 +02:00
Brecht Van Lommel
92919864a0 Fix #106293: Cycles importance sampling with multiple suns works poorly
Keep sun in importance map in this case, as we do not use special sun
importance sampling in this case.
2023-04-17 17:30:47 +02:00
Alaska
cff94a808e Fix #106706: fireflies with Nishita sky sun sampling at certain angles
Due to floating point differences between importance sampling and
texture evaluation, disagreeing on whether or not a ray lies within
the sun disc.

* Use the same input values for geographical_to_direction() in
  sky_radiance_nishita() and kernel_data.background.sun.
* The mathematical operations in pdf_uniform_cone() were adjusted to
  match sky_radiance_nishita().

Pull Request: https://projects.blender.org/blender/blender/pulls/106764
2023-04-17 17:29:27 +02:00
Clément Foucault
a8feb20e1c DNA: Move irradiance grid light cache data to Object level
This is the first step for refactoring the lightcache system.
Each probe instance (as in `Object`) will now store its own baked data.
The data is currently stored in uncompressed readable format.

This introduces two new operators for baking to avoid confusion with
the previous light baking pipeline. These do nothing other than
creating empty caches that will be populated by EEVEE later on.

The DNA storage is made to be able to include multiple caches
in case of baked simulation over time but it isn't yet supported.

I prefer to keep the implementation simple for now as the long term
goals for this feature are uncertain.
There is still a type flag (`LightProbeObjectCache.cache_type`) that
will be used for versioning.

The naming convention of structs is a bit weird but that's all I
found in order to avoid interfering with the old scene light cache
that is still used by (old) EEVEE.

Related task #106449.

Pull Request: https://projects.blender.org/blender/blender/pulls/106808
2023-04-17 17:12:19 +02:00
Germano Cavalcante
b1703bd902 Fix #107020: crash when canceling Sky Resize with mesh symmetry
Like `t->data` use calloc to `tc->data_mirror`.

This way you make sure that all values are properly initialized.
2023-04-17 11:32:36 -03:00
c041a36286 Fix #91966: Alembic/USD export ignores bone parent animation
For non-object parents (so bones & vertices), the parent is now also
explicitly checked for animation. In other words: having an animated
parent will cause the transform of the child to be written to Alembic/USD
on every frame (as if it is animated itself).
2023-04-17 16:21:39 +02:00
Bastien Montagne
b75b734969 Core: Memfile Undo: Optimize handling of 'no undo' IDs.
Do not read IDs from types flagged as 'no undo', whether they are local
or linked.

This should have no effect currently, since all 'no undo' ID types
currently are supposedly only local data anyways (Screen, WindowManager
and WorkSpace).
2023-04-17 16:08:41 +02:00
Bastien Montagne
915b8b6093 Core: Memfile undo: Add ID tag for IDs that are 'reused in place'.
These IDs kept their address, but their content has been replaced
(re-read from the memfile undo step). Add an ID tag to identify them.

As a further cleanup, systematically tag these IDs for despgraph COW,
since their data is effectively modified (though in practice all of
these IDs are expected to already have other update tags anyway).

No change in behavior is expected from this commit.
2023-04-17 15:46:21 +02:00
Bastien Montagne
a16bcb6576 Core: ID remapping: Do remap 'not owning embedded' ID pointers.
This should not have much effective consequences with current code, but
fixes potential missed remappings for e.g. some nodetree pointers in the
node editor, or the `parent` pointer of collections to a scene's master
collection.
2023-04-17 15:46:21 +02:00
Brecht Van Lommel
0bc957063c Fix #106405: Cycles multi GPU crash with vertex color baking
Avoid division by zero when one of the devices gets no work.
2023-04-17 15:31:35 +02:00
Damien Picard
38bf3e1911 I18n: translate default preset name
The "New Preset" message was already translated and used in some
preset panels, but not all.

Pull Request: https://projects.blender.org/blender/blender/pulls/106973
2023-04-17 15:00:07 +02:00
Bastien Montagne
48979c6cdc Py module i18n utils: return subprocess.run result to catch output of external commands.
Avoids having prints in random order in multi-processes concurrent
context.
2023-04-17 14:38:51 +02:00
Clément Foucault
e45746591b Metal: Add new files for Storage Buffers support 2023-04-17 14:12:32 +02:00
Hans Goudey
2a4323c2f5 Mesh: Move edges to a generic attribute
Implements #95966, as the final step of #95965.

This commit changes the storage of mesh edge vertex indices from the
`MEdge` type to the generic `int2` attribute type. This follows the
general design for geometry and the attribute system, where the data
storage type and the usage semantics are separated.

The main benefit of the change is reduced memory usage-- the
requirements of storing mesh edges is reduced by 1/3. For example,
this saves 8MB on a 1 million vertex grid. This also gives performance
benefits to any memory-bound mesh processing algorithm that uses edges.

Another benefit is that all of the edge's vertex indices are
contiguous. In a few cases, it's helpful to process all of them as
`Span<int>` rather than `Span<int2>`. Similarly, the type is more
likely to match a generic format used by a library, or code that
shouldn't know about specific Blender `Mesh` types.

Various Notes:
- The `.edge_verts` name is used to reflect a mapping between domains,
  similar to `.corner_verts`, etc. The period means that it the data
  shouldn't change arbitrarily by the user or procedural operations.
- `edge[0]` is now used instead of `edge.v1`
- Signed integers are used instead of unsigned to reduce the mixing
  of signed-ness, which can be error prone.
- All of the previously used core mesh data types (`MVert`, `MEdge`,
  `MLoop`, `MPoly` are now deprecated. Only generic types are used).
- The `vec2i` DNA type is used in the few C files where necessary.

Pull Request: https://projects.blender.org/blender/blender/pulls/106638
2023-04-17 13:47:41 +02:00
f588a0596b Fix #106943: driver on inactive view layer doesn't work
Animation data (including drivers) on inactive view layers now work. The
removal of such view layers was too optimistic; they are now kept
around. The bases are still removed, mostly for safety sake and to keep
the changes to a minimum.

`scene_remove_unused_view_layers()` has been renamed to
`scene_minimize_unused_view_layers()` to reflect its new functionality.

For compatibility with assumptions in other areas of the code, the
function still ensures the input view layer is at index 0.

This also introduces a new function
`BKE_view_layer_free_object_content(view_layer)`, which is a subset of
the functionality of `BKE_view_layer_free()`.
2023-04-17 12:59:03 +02:00
Julian Eisel
fe7540d39a Cleanup: Define type for object type enum
Having a type defined allows the compiler to help with type safety. For
example we can use it in switches to trigger a warning when a new object
type is added but not covered by the switch yet (but probably should).
2023-04-17 12:39:42 +02:00
62d9e55eec Graph editor: fix box select when scene has annotations
The graph editor box select operator now works properly again, when there
is an annotation layer in the scene.
2023-04-17 12:15:24 +02:00
0ed0165eea Refactor: anim, simplify range check
Simple application of De Morgan's law. No functional changes.
2023-04-17 12:15:24 +02:00