Commit Graph

111867 Commits

Author SHA1 Message Date
Jacques Lucke
ae129da4f7 UI: new Geometry Set icon
This icon can be used when refering to a "geometry set" which can contain
potentially multiple geometries of different types (such as mesh, volume, etc.).

It was designed by Simon Thommes as part of #125293.
2024-07-29 20:37:21 +02:00
John Kiril Swenson
2314f59417 Refactor: Cleanup VSE retiming selection code
Retiming selection was way more complicated than it needed to be, with
lots of duplicate code between `sequencer_select_exec` and
`sequencer_retiming_key_select_exec` and logic scattered all over the
place.

This patch standardizes retiming selection so that all of its logic is
performed first. If it turns out that the cursor is not able to select
any keys, it continues with strip selection. This decreases linecount
and makes everything clearer.

There should be no regressions user-side, but this patch does fix a
couple bugs and makes retiming selection more robust:
- Prior to this patch, if no retiming keys were selected, attempting to
  toggle any key with the tweak tool would select and deselect the key
  immediately.
- Prior to this patch, retiming keys would still show if overlays were
  turned off, but "retiming display" was turned on.

This patch also renames/changes some functions to make them clearer:
- `retiming_keys_are_visible` -> `retiming_keys_can_be_displayed`, since
  having retiming keys on in the overlays does not guarantee that they
  are visible in any strips currently. Note that I've altered this
  function slightly too, this fixes the second bug mentioned above.
- `try_to_realize_virtual_keys` -> `try_to_realize_fake_keys`, to make
  naming more consistent with existing functions.
- Fix typo in `retiming_mousover_key_get`
- Remove `use_retiming_mode` helper function since new code doesn't need
  it -- was confusingly named anyways
- Add `key` and `key_owner` arguments to
  `sequencer_retiming_key_select_exec` and
  `sequencer_retiming_select_linked_time` to avoid having to recalculate
  the key at cursor position over and over again

Pull Request: https://projects.blender.org/blender/blender/pulls/125468
2024-07-29 20:25:26 +02:00
Hans Goudey
570ac3ebaa Fix: Build error in lite build without OCIO 2024-07-29 14:16:01 -04:00
Hans Goudey
c118d0fa2f Refactor: Sculpt: Use mask update abstraction in expand tool 2024-07-29 14:15:04 -04:00
Charles Wardlaw
8a97f31e76 USD: Use Asset Resolver to resolve texture paths
This patch uses the USD AssetResolver to deal with texture paths.
Functionally, adding this patch should make no functional differences in
the way textures are written.

If textures are specified as assets instead of file paths, at current
the file will error on load and the textures will not be assigned. These
should now be processed correctly.

See PR for example file and testing scenarios.

Co-authored-by: kiki <charles@skeletalstudios.com>
Co-authored-by: Jesse Yurkovich <jesse.y@gmail.com>
Co-authored-by: Charles Wardlaw <cwardlaw@nvidia.com>
Pull Request: https://projects.blender.org/blender/blender/pulls/122747
2024-07-29 20:00:48 +02:00
Hans Goudey
8ea4d7ed89 Refactor: Sculpt: Split read/write of color attribute to separate loops
This makes things easier to optimize in the future and makes the code
easier to reuse, for example with colors stored on other domains.
2024-07-29 13:18:38 -04:00
Hans Goudey
de60594cfc Refactor: Sculpt: Avoid double auto mask calculation for paint brush 2024-07-29 13:18:38 -04:00
Jesse Yurkovich
69154a5e3b Fix #125402: Guard against missing OCIO data for realtime compositor
The newly added viewport compositor was missing a try-catch guard around
the OCIO `getProcessor` call. All prior call sites were protected except
this one.  Unhandled exceptions can occur if the user tries to use a
colorspace config that is not present in their OCIO configuration.

The surrounding code paths need some work in order to not crash at a
later point, which would also impact builds with no OCIO support at all.
In the case of no OCIO support at all, a warning label is placed on the
node as well.

Pull Request: https://projects.blender.org/blender/blender/pulls/125526
2024-07-29 18:37:23 +02:00
Bastien Montagne
97982360de Refactor: DNA: Add util to access size of a truct.
Avoids reafile code having to access 'internals' specifics of DNA data.
2024-07-29 17:31:42 +02:00
Bastien Montagne
bae9a93d62 Cleanup: Readfile: Remove old disabled debug code for memory leaks tracking.
This was not working at all with ASAN builds, and has been superseded by the
new system introduced in recent commits 63016ad965 and add9553ad1.
2024-07-29 17:31:42 +02:00
Weizhen Huang
29fdddb0e9 Fix: Cycles camera keeps updating due to NaN in central cylindrical camera
`NaN != NaN` causes the camera to be tagged as needs update. To fix,
initialize radius to 1 and add hard limit.
2024-07-29 17:05:25 +02:00
Hans Goudey
a26819ad88 Fix #125400: Copy modifier to selected ignores modifier pinning
If we encounter this problem again it's probably worth extracting this
modifier addition to a helper function.
2024-07-29 10:19:18 -04:00
Iliya Katueshenock
7903aa6faa Fix #125588: Revert: Fix #120592: File output node not showing up in search
In 095d37c186 being added
drag-and-drop support for the node which still have no dynamic declaration itself.
This revert previous change. Real support will be added with #108728

Pull Request: https://projects.blender.org/blender/blender/pulls/125596
2024-07-29 15:23:37 +02:00
Falk David
017c8742cb Fix: GPv3: Crash in realize instances node
This was reported by the studio. When opening one of the lighting
files in 4.3, Blender would crash.

The realize instance task for grease pencil needs to copy all the
layer attributes to the target geometry. When creating the
`dst_attribute_writers` using `lookup_or_add_for_write_only_span`
the `bke::AttrDomain::Point` was used when it should have been
`bke::AttrDomain::Layer`.

Pull Request: https://projects.blender.org/blender/blender/pulls/125603
2024-07-29 15:17:38 +02:00
softyoda
5e9096829c Cycles: Add Central Cylindrical Panoramic camera model
This type of projection is often used e.g. in exhibitions that leverage big
curved screens.

Effectively, the frame is mapped onto a cylinder, with the x axis becoming the
longitude and y axis becoming the height.

Users can configure the min/max longitude, the min/max height and the radius of
the cylinder.

Co-authored-by: Lukas Stockner <lukas.stockner@freenet.de>
Pull Request: https://projects.blender.org/blender/blender/pulls/123046
2024-07-29 15:03:57 +02:00
Aras Pranckevicius
b17734598d Fix #125446: Video decoding artifacts on AVX512 CPU with some video widths
When a video width is a multiple of 8 but not 16 (i.e. line size
stride of RGBA frame is multiple of 32 bytes but not 64 bytes), then
on an AVX512 capable CPU the decoded video has a block of "wrapped"
artifacts on the left side.

This started happening in 4.1 with 4ef5d9f60f, where the vertical flip
is done together with YUV->RGB conversion. The logic in there checks
whether ffmpeg frame line size (which might include necessary SIMD
alignment/padding) matches packed imbuf line stride. However, ffmpeg
arguably has a bug, where `av_frame_get_buffer` always uses 32 byte
alignment, instead of 64 byte when on AVX512 code path. Report
has been made to ffmpeg upstream: https://trac.ffmpeg.org/ticket/11116
and in the meantime, explicitly pass `av_cpu_max_align` to
`av_frame_get_buffer`.

Pull Request: https://projects.blender.org/blender/blender/pulls/125578
2024-07-29 14:58:09 +02:00
Bastien Montagne
101d54fb7f Cleanup: Readfile: Remove unused function. 2024-07-29 13:02:45 +02:00
Miguel Pozo
9a3e102853 Fix: Workbench: Disable overlays_enabled optimizations
Since the `overlays_enabled` optimizations were introduced in
fe39456ba5, it has been a constant
source of bugs: #113741, #116403, #120628, #125414
There are many cases where the code expects to have the Workbench
depth available even when overlays are disabled.
So this simply disables the optimization and ensures the depth buffer is
always valid.

Pull Request: https://projects.blender.org/blender/blender/pulls/125447
2024-07-29 12:56:06 +02:00
Miguel Pozo
0bd1b92133 Fix: APIENTRY redefinition warning 2024-07-29 12:49:42 +02:00
Bastien Montagne
add9553ad1 Readfile: Improve memleaks info in debug builds.
Use the new 'Dynamic Alloc String Storage API' for the allocation
strings of the `read-struct` function in the readfile code.
Compared to the previous code, this change:
- Fixes ASAN aborting before readfile-related memleaks prints.
- In addition to the 'main owner' data type, adds the actual read struct
  type (and array size if relevant) to the alloc name.

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

Note that this keeps all combinations of owner/types/array_num generated
strings for the whole duration of the program. However, this only
impacts Debug (and Release `WITH_ASSERT_ABORT`) builds.

The 'real' release builds also use a mapping now, but very small (one
entry per ID type), and with a basic `int` key. Further more, it is
optimized to only do one lookup for a whole ID and all of its 'owned'
structs, so there is no measurable impact on performances in blendfile
reading for release builds.

Pull Request: https://projects.blender.org/blender/blender/pulls/125320
2024-07-29 12:16:47 +02:00
Falk David
a1630792cf Python: Attributes: Add domain_size function
This function returns the number of elements of a given domain.

Example:
```py
>>> attributes.domain_size('POINT')
500
```

Pull Request: https://projects.blender.org/blender/blender/pulls/125519
2024-07-29 11:14:50 +02:00
Falk David
cd577f02b9 Python: Trigger property update in foreach_get/set
Calling `foreach_get/set` on a collection property did not trigger
a property update. In the attribute API, this lead to missing
updates after e.g. setting the values of an attribute.

This adds a call to `RNA_property_update` for the getter/setter
bpy rna function and adds a property update callback to all the
different attribute collection properties.

Pull Request: https://projects.blender.org/blender/blender/pulls/125518
2024-07-29 11:14:20 +02:00
Falk David
0f42f277b7 Grease Pencil: Remove legacy modifiers
This removes the legacy Grease Pencil modifiers from the code.
These should have already been inaccessible from the UI and hidden from
the user. The modifiers have been reimplemented for the new GPv3
data structure.

On top of the modifier code, some other related things have been
removed as well:
 * Operators related to the legacy modifiers.
 * Keymaps for the legacy modifier operators.
 * Some bits of code that used modifier functions.

Some code has to be kept, because it is still used:
 * The core line art code, which is used by the new line art modifier. It's
    moved to `modifiers/lineart`.
 * The DNA structs for the legacy modifiers. They are still needed for
    conversion.
 * A few kernel functions for the modifiers are kept (also for conversion).

Co-authored-by: Lukas Tönne <lukas@blender.org>
Pull Request: https://projects.blender.org/blender/blender/pulls/125102
2024-07-29 10:37:29 +02:00
Campbell Barton
4afb3aff35 Cleanup: pass const arguments, use r_ prefixed return arg 2024-07-29 13:01:12 +10:00
Campbell Barton
004c247670 Cleanup: different declaration names, use r_ prefix for return args 2024-07-29 13:01:10 +10:00
Jacques Lucke
9e88ff1b4b Cleanup: use correct index when building group node lazy function
This shouldn't make any difference right now, because the main inputs
and outputs of a group always come first. But it's better to not rely on that
here if it can be avoided.
2024-07-28 14:21:56 +02:00
Jacques Lucke
1f026f7ac2 Cleanup: improve method names
These methods don't build separate nodes anymore, just the sockets.
2024-07-28 14:20:18 +02:00
Philipp Oeser
8b3beeee82 Fix #124836: Triangulate modifier changed behavior with custom normals
This reverts commit f3c32a36bc and the two followups.

The commit caused issues with both the operator and the modifier.

The operator could be fixed, for the modifier this needs deeper
investigation (see #124836 for a bit more info on this).

Until a better solution is found it is just better to go back to
previous behavior.

Reintroduces  #103562 for now

Pull Request: https://projects.blender.org/blender/blender/pulls/125499
2024-07-28 10:27:29 +02:00
Jacques Lucke
26b7ae888b Fix: deduplicate shared data when writing to file
If a data-block referenced the same shared data more than once, it used to be
written multiple times. This worked out so far, because the written data is
always the same. So when reading the file, it doesn't matter which written
buffer Blender decides to read on. However, this makes the .blend file look
corrupt and leads to memory leaks on load (#125001).

Pull Request: https://projects.blender.org/blender/blender/pulls/125489
2024-07-27 23:07:21 +02:00
YimingWu
79862c8cfa LineArt: bake should return CANCELLED when not applicable
Previously the operator always returned OPERATOR_FINISHED, which is
incorrect when it did not actually run.
2024-07-27 20:52:27 +08:00
Falk David
95139263de Cleanup: Python: Remove unnecessary array length definition in curves API 2024-07-27 11:30:04 +02:00
Sean Kim
2f15347f7c Fix: Empty span check for vert_all_faces_visible_get
Pull Request: https://projects.blender.org/blender/blender/pulls/125524
2024-07-27 06:16:15 +02:00
Sean Kim
e8c7fe8ab9 Fix: Out of bounds errors with FillDataMesh
* Missed empty span check
* Wrong iterator direction

Pull Request: https://projects.blender.org/blender/blender/pulls/125523
2024-07-27 06:15:34 +02:00
Campbell Barton
e974ee05dc Cleanup: clarify ED_markers_make_cfra_list only selected argument
The argument read as if it might be a flag (callers passed in SELECT),
but it was in fact used as a boolean.
2024-07-27 13:32:52 +10:00
Campbell Barton
80f135e7d2 Cleanup: avoid shadowing 2024-07-27 13:32:52 +10:00
Campbell Barton
111a40239a Cleanup: match argument names for function & declarations
Match function and declaration names, picking names based on
consistency with related code & clarity.

Also changes for old conventions, missed in previous cleanups:

- name -> filepath
- tname -> newname
- maxlen -> maxncpy
2024-07-27 13:32:51 +10:00
Sean Kim
edb73325c1 Cleanup: Fix Span drop_back docstring
Pull Request: https://projects.blender.org/blender/blender/pulls/125512
2024-07-27 05:27:54 +02:00
Harley Acheson
9bdd511a27 UI: Always Use Mono Font for Python in Tooltips
When including Python on the tooltips they are meant to be shown using
a monospaced font. This is the case in two of the four places that
python is shown, but not in the other two which include Tool tooltips.
This PR makes them all consistent.

Pull Request: https://projects.blender.org/blender/blender/pulls/125521
2024-07-27 01:51:41 +02:00
Sean Kim
f217dad8de Cleanup: Rename SubdivCCGNeighbors duplicate() to duplicates()
Avoid implying that the method duplicates the underlying data.

Pull Request: https://projects.blender.org/blender/blender/pulls/125520
2024-07-27 00:51:22 +02:00
Alaska
d610ae2764 Fix broken EEVEE material shadow mode versioning
Fixes an issue where the original material of the node tree wasn't
connected to the right sockets in most situations after applying
EEVEE-Next shadow mode versioning.

Pull Request: https://projects.blender.org/blender/blender/pulls/125438
2024-07-27 00:42:24 +02:00
Falk David
52a1be9396 Cleanup: Formatting 2024-07-27 00:04:56 +02:00
Falk David
f256b9daf7 GPv3: Python: Add curve_offsets API
This adds the `curve_offsets` collection property.
The curve offsets can be used to get the points that belong
to a curve. They are the offset indices of the first point of
each curve. The first offset is always zero and the last offset
is the total number of points in the drawing.
2024-07-27 00:02:55 +02:00
Falk David
edcc438f5f GPv3: Python: Add drawing API functions
This adds `add_curves`, `remove_curves`, and `resize_curves`
functions to the drawing API.

This should replace the old GPv2 API functions:

* `strokes.new`
* `strokes.remove`
* `points.add`
* `points.pop`
* `points.update`

Pull Request: https://projects.blender.org/blender/blender/pulls/125502

Pull Request: https://projects.blender.org/blender/blender/pulls/125502
2024-07-26 22:51:28 +02:00
Falk David
6fac4707d5 Curves: Add Python API to remove and resize curves
This adds two new python functions:
* `curves.remove_curves(indices=None)`
* `curves.resize_curves(sizes, indices=None)`

By default, `remove_curves` will remove all curves. If `indices`
are provided, only the curves with the given indices are removed.
The indices have to be in ascending order and mustn't repeat.

The `resize_curves`function  will change the number of points
for each curve. If no indices are provided, there must be as
many elements in `sizes` as the number of curves there is.
Otherwise, there must be one element in `sizes` per element
in `indices`. The `sizes` are the new size for a given curve.
If the new size for a curve is smaller, then the curve is
trimmed from the end. If the new size for a curve is greater,
then the end values will be default initialized.

Pull Request: https://projects.blender.org/blender/blender/pulls/125502
2024-07-26 22:51:27 +02:00
Sean Kim
ac344aae1f Subdiv: Add neighbor slicing helper methods
Pull Request: https://projects.blender.org/blender/blender/pulls/125513
2024-07-26 21:42:09 +02:00
Sean Kim
eda872b6eb Cleanup: SubdivCCG: Add SubdivCCGCoord constructor from key and index
* Adds test for this usecase.
* Reduces existing duplicated code.

Pull Request: https://projects.blender.org/blender/blender/pulls/125511
2024-07-26 21:16:37 +02:00
Hans Goudey
a5374d8e30 Cleanup: Sculpt: Use C++ vector type in pose brush code 2024-07-26 12:57:51 -04:00
Hans Goudey
0e5858e226 Sculpt: Data oriented refactor for pose brush deformation
Part of #118145.
There are some things to address with the "fake neighbor" system before
the rest of the brush can be refactored.
2024-07-26 12:57:51 -04:00
Hans Goudey
c2ac890f6b Cleanup: Fix name of function argument 2024-07-26 12:57:51 -04:00
Hans Goudey
78c73eacd2 Cleanup: Use Array for pose brush mask data 2024-07-26 12:57:51 -04:00