Commit Graph

139617 Commits

Author SHA1 Message Date
Campbell Barton
d8c2301ee8 Cleanup: use const arguments 2024-07-30 12:23:09 +10:00
Campbell Barton
4dfd8e33e0 Cleanup: avoid variable shadowing 2024-07-30 12:23:07 +10:00
Campbell Barton
1d0d8cdab5 Unbreak building WITH_USD 2024-07-30 12:20:26 +10:00
Sean Kim
89a0bbe72f Cleanup: Remove usage of SculptSession for totvert access
Pull Request: https://projects.blender.org/blender/blender/pulls/125634
2024-07-30 03:09:01 +02:00
Hans Goudey
131d641816 Cleanup: Sculpt: Reuse code for enhance details filter initialization 2024-07-29 20:32:54 -04:00
Hans Goudey
eb10eefdcd Cleanup: Remove unused status bar string creation
Unused after 1076564070.
2024-07-29 20:32:54 -04:00
Jesse Yurkovich
67186ae8ac Fix: Error in builds without OCIO
The methods on the `OCIOColorSpaceConversionShader` expect
`shader_creator_` to be valid so, in case of a build without OCIO
support, ensure we have a valid GPUShaderCreator available.

In this case we use the "stub" implementation.

Pull Request: https://projects.blender.org/blender/blender/pulls/125631
2024-07-30 02:20:27 +02:00
Jesse Yurkovich
f638aca941 Cleanup: remove unused variable 2024-07-30 02:15:53 +02:00
Sean Kim
ed274e7a76 Fix #125621: Grow Face Set applies default value to entire empty mesh
This commit prevents the Grow Face Set and Shrink Face Set operations
from happening on a mesh without the face set attribute. In particular,
this prevents the entire mesh from getting a value of 0 for the face set
attribute if it is missing the '.sculpt_face_set' attribute entirely.

Pull Request: https://projects.blender.org/blender/blender/pulls/125632
2024-07-30 02:14:05 +02:00
Sean Kim
0c09d38774 Cleanup: Remove forward declarations in sculpt_boundary.cc
Pull Request: https://projects.blender.org/blender/blender/pulls/125630
2024-07-30 01:17:24 +02:00
Sean Kim
99c55bdbfb Sculpt: Partial refactor of boundary brush
Part of #118145

This commit tackles splitting up the cached, per element data that is
calculated prior to the first stroke of the boundary brush occuring. The
main entry point is the `data_init` function which handles the following
rough steps:

* Find the closest boundary vert to the current position.
* Check to see if the selected boundary is valid.
* Find all boundary vertices to affect with this task.
* For all vertices near each of the boundary vertices, populate various
  information to be used when actually performing the deformation into
  an array that is sized to the total number of elements in the backing
  data structure.

The result at the end of this is the `SculptBoundary` struct which has
remained unchanged and is populated for each of the symmetry passes.
Because the current algorithm is single threaded, this commit opts to
avoid making any major changes to this structure, as improving this
performance will likely require reevaluating the problem from the base
needs of this brush.

For each of the preceding four rough areas of computation, the methods
have been split into separate implementations per PBVH type to remove
most usage of `SculptSession` and `PBVHVertRef`.

Additionally, the method which is used to display the targeted boundary
and the pivot data has been updated as well to use this same code path.

Pull Request: https://projects.blender.org/blender/blender/pulls/125525
2024-07-30 00:05:14 +02:00
Leon Schittek
d30d8b4bfa UI: Add padding to items in ui lists and tree views
Add a utility function to add horizontal padding to the left and right
of items in UI lists and tree views to make them more consistent with
other buttons like menu entries.

Pull Request: https://projects.blender.org/blender/blender/pulls/125498
2024-07-29 23:52:38 +02:00
Hans Goudey
6d992ff071 Cleanup: Formatting 2024-07-29 17:48:11 -04:00
Hans Goudey
cbd1ac553d Sculpt: Refactor for enhance details mesh filter preprocess
Part of #118145.
The previously-single-threaded code is now parallelized.
2024-07-29 17:46:59 -04:00
Andrew Wason
42234e5a8e Fix #125194: Sequence.frame_duration returns incorrect value
`Sequence.frame_duration` returned number of frames in movie, but did
not consider "playback rate" factor (adapting to scene framerate), nor
user level retiming.

Pull Request: https://projects.blender.org/blender/blender/pulls/125243
2024-07-29 22:45:52 +02:00
Jesse Yurkovich
4b6ed00b3e Cleanup: Don't depend on ordering when setting USDExportParams
Access each parameter by name instead of depending on ordering.

Also reorder the parameters to better indicate their groupings, making
things a bit easier to see at a glance what is possible to be set.

Pull Request: https://projects.blender.org/blender/blender/pulls/125620
2024-07-29 22:38:40 +02:00
Bastien Montagne
11bdd3da5a Blendfile: Do not write 'DrawData'.
This list is already cleared on read, better to also write nullptr for
it then (reduces the risks of fake-changes detection in undo code
mainly).
2024-07-29 21:26:43 +02:00
Harley Acheson
ae71f33c75 UI: Cleanup UI Icons
Some icons have some extra paths, some have groups in an order that
overlaps badly, some using shapes instead of paths, some curves with
shapes that fill incorrectly.  Just some basic cleanup.

Pull Request: https://projects.blender.org/blender/blender/pulls/125622
2024-07-29 21:03:35 +02:00
Jacques Lucke
071b18a3cc Spreadsheet: support navigating instance trees
Previously, it was not possible to see detailed information about instances in
the spreadsheet. Only the attributes on the top level instances were shown. Now,
all nested instances can be inspected too.

Combined with #114910 this will make inspecting more complex geometry with the
spreadsheet much more feasible. It's also an important part of integrating
grease pencil into geometry nodes because it makes it more obvious how layers
are converted to curve instances.

The data-selection is split into two separate tree views now. One that selects
the geometry from the instance tree, and one that's used to select the geometry
component and domain within that geometry. We found that this works better than
combining both tree views into one (we tried that in #124186).

Pull Request: https://projects.blender.org/blender/blender/pulls/125293
2024-07-29 20:42:08 +02:00
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
Harley Acheson
bfc7e2aea2 UI: Update Internet Offline Icon to Remove Unused Masks
The Internet Offline Icon SVG file includes masks that are not needed
because the curves are boolean clipped to the same locations. This just
removes the masks because this keeps it from being shown correctly in
some web browsers on https://ui.blender.org/icons.

Pull Request: https://projects.blender.org/blender/blender/pulls/125612
2024-07-29 17:52:15 +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
Ray Molenkamp
4e6237e009 windows_x64: Opencollada dfc341ab0b3b23
See #125304 for details
2024-07-29 09:15:05 -06: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
nutti
e0cdfb8566 Fix: Docstring of the bpy.utils.user_resource argument
Correct argument name is `resource_type`

Pull Request: https://projects.blender.org/blender/blender/pulls/125316
2024-07-29 14:04:41 +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
Bastien Montagne
63016ad965 MEM management: Add data storage only destructed after memleak detection.
Add a new API to store data that is guaranteed to not be freed
before the memleak detector has run.

This will be used in next commit by the readfile code to improve
reporting on leaks from blendfile readingi process.

This is done by a two-layer approach:

A new templated `MEM_construct_leak_detection_data` allows to
create any type of data. Its ownership and lifetime are handled
internally, and guaranteed to not be destroyed before the memleak
detector has run.

Add a new template-based 'allocation string storage' system to
`intern/memutil`. This uses the new `Guardedalloc Persistent Storage`
system to store all 'complex' allocation messages, that cannot be
defined as literals.

Internally, the storage is done through an owning reference (a
`shared_ptr`) of the created data into a mutex-protected static
vector.

`MEM_init_memleak_detection` code ensures that this static storage
is created before the memleak detection data, so that it is destructed
after the memleak detector has ran.

The main container (`AllocStringStorageContainer`) is wrapping a
map of `{string -> AllocStringStorage<key_type, hash_type>}`.
The key is a storage identifier.

Each storage is also a map wrapped into a simple templated API
class (`AllocStringStorage`), where the values are the alloc strings,
and the keys type is defined by the user code.

Pull Request: https://projects.blender.org/blender/blender/pulls/125320
2024-07-29 11:47:04 +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