Commit Graph

116438 Commits

Author SHA1 Message Date
Harley Acheson
1f33b401b3 Fix #49117: Larger Alternative for Frame Cursor
Internally our "Time" mouse cursor, it comprises up to four digits in
a 2x2 grid.  With each digit being just 7x7 pixels this is very small
on high DPI displays. This PR adds an alternative that shows 12x14
pixel digits, shown when the UI Scale > 1.45. It also changes both
small and large versions to not show a solid black background for
empty digit positions.

Pull Request: https://projects.blender.org/blender/blender/pulls/132767
2025-01-16 02:59:49 +01:00
Sean Kim
eebdd83898 Cleanup: Add documentation for PaintStroke related functions
Pull Request: https://projects.blender.org/blender/blender/pulls/133125
2025-01-16 01:52:14 +01:00
John Kiril Swenson
1fc1878cd6 VSE: Add effect/transition UI/code cleanup
Part of the Jan 2025 Code Quality project described in #130975.

This patch aims to improve user-facing messaging when adding effects or
transitions, properly polling them out based on context, and avoiding
unnecessary error messages when possible.

- Rearrange "add Effect Strip" UI in order of required number of
  selected strips to create the effect strip, from 0 -> 1 -> 2
- Properly poll out these operators if not enough non-sound strips (i.e.
  any strips with video content) are selected.
	- Note that this does not require any extra iterations over the
	  entire seqbase.
- Gracefully avoid errors with trying to add effect/transition strips
  when sound strips are part of the selection: for example, when the
  user has selected connected strips.
	- In these cases, it is clear that the user wishes to operate on
	  the strips with video content.
- Refactor `seq_effect_find_selected` to fix bugs and account for all
  cases, removing TODOs in place. Rename it `seq_effect_get_new_inputs`
  to more accurately express its purpose.
- Rename various `last_seq` to `active_strip` to adhere to new conventions
  laid out in #132736
- Update UI tooltips for effect, transition, and fades to make their use
  clearer.

Pull Request: https://projects.blender.org/blender/blender/pulls/132672
2025-01-16 01:40:36 +01:00
Jesse Yurkovich
49ae7ffc9c USD: Support additional animated Basis Curves data during import/export
Export
Like we do for Mesh and PointCloud, export any "velocity" attribute on
the Point domain as native USD "velocities". While testing, a few
additional blender-internal attributes were discovered being exported
which are now excluded during export.

Import
Add the cache modifier as appropriate when we detect that UsdBasisCurve
data is animated. This includes time-varying positions, widths,
velocities, and general attribute values. Before this PR, only the
positions were considered. And like Export, the native USD "velocities"
attribute is now processed.

Adds test coverage as well.

Pull Request: https://projects.blender.org/blender/blender/pulls/133027
2025-01-15 23:29:42 +01:00
Hans Goudey
7456709b69 Fix: Incorrect length limit for node socket idname 2025-01-15 14:59:38 -05:00
Hans Goudey
40b3c6baf7 Fix: Possible compile error from missing define 2025-01-15 14:55:39 -05:00
Julian Eisel
2f493dc816 Fix: Assets: Remove assert in brush asset poll, it's a valid failure
The asset lookup may fail if asset library loading hasn't finished. In that
case, don't throw an assert, display a report.
2025-01-15 19:13:34 +01:00
Julian Eisel
c07b253265 Fix: Assets: Asset library not loaded after creating brush asset (asserts)
The steps in #132900 would lead to a failed assert and some warning prints:
"Warning: Asset loading is unfinished". This is because asset libraries get
cleared more strictly and correctly since a859ed1130, but only once the menu
was shown it would get reloaded.

Instead make sure the asset library loading gets triggered whenever a button to
popup a brush asset shelf is present. This makes sense because in this context
you typically want an asset library available.
2025-01-15 19:08:08 +01:00
Miguel Pozo
51770cd698 Fix #133106: Overlay-Next: Solid selection doesn't work in XRay mode
Regression from 2abc3ad801
2025-01-15 18:10:26 +01:00
Miguel Pozo
dd20922167 Cleanup: Overlay-Next: Remove unrequired casting 2025-01-15 17:39:59 +01:00
Miguel Pozo
4be177a12d Fix #133084: Overlay-Next: Viewport Z-Axis
ba074d1670 created subpasses based on flags that were not yet set up.
2025-01-15 17:38:43 +01:00
Laurynas Duburas
8e0c050fa1 Cleanup: Curves: Correct incorrect function name 2025-01-15 11:37:07 -05:00
Richard Antalik
4a7209f7ed Fix #133108: Slip strip not accepting numpad enter
Add `EVT_PADENTER` as valid event type.

Pull Request: https://projects.blender.org/blender/blender/pulls/133109
2025-01-15 17:24:38 +01:00
Brecht Van Lommel
599fa13ac0 Cleanup: Correct logic and comments about Imath includes in imbuf
There is nothing happening upstream in OpenImageIO to remove this
requirement, as the comments imply.
2025-01-15 16:52:29 +01:00
Iliya Katueshenock
57e72618cb Cleanup: Geometry Nodes: Unused namespace
Pull Request: https://projects.blender.org/blender/blender/pulls/118093
2025-01-15 16:28:37 +01:00
Philipp Oeser
08539618cd Fix #133097: GP Vertex Weight Proximity wrong with influence VG
The modifier would write to all weights, not respecting if a vertex was
not part of the influence vertex group.
If the vertex is not part of the influence vertex group (its weight is
0.0), dont touch the existing weights (just continue happily).

Pull Request: https://projects.blender.org/blender/blender/pulls/133098
2025-01-15 15:55:49 +01:00
Philipp Oeser
e700e1f71c Fix #115843: Expose curves sculpt collision distance
The hardcoded value doesn't work well with real scale human heads for
example (was already adjusted once in a76b5d3a07).
The result for too high values is a complete "freeze" of the whole curve
(since  the solution from e7606139ba has the problem that it keeps
running into max iterations of the collision solver).

As long as no better solver is implemented, it is better to have an
adjustable value (to work on differently sizes objects) to not run into
the above issue (same as the old particle hair system had) and show it
in sculptmode next to the button which enables collision.

This is done per `Curves` (same as the flag
`CV_SCULPT_COLLISION_ENABLED`), similar to symmetry settings
[alternatively, it could be part of `BrushCurvesSculptSettings` but I
think it makes more sense in Curves] and then passed on to the
`CurvesConstraintSolver`.

Includes versioning code (to set the default for old files).

Pull Request: https://projects.blender.org/blender/blender/pulls/132997
2025-01-15 15:54:43 +01:00
Hans Goudey
d9d7d3b354 Cleanup: Use existing utility functions in mesh split edges file
Pull Request: https://projects.blender.org/blender/blender/pulls/133081
2025-01-15 15:30:14 +01:00
Omar Emara
e545b6e764 Cleanup: Pass interpolation directly to transform algorithm
The transform algorithm currently takes realization options, but it only
uses the interpolation from it. So pass interpolation directly for
clarity.
2025-01-15 15:45:51 +02:00
Omar Emara
7e5af160bd Cleanup: Rename wrap to repeat in realization options
The wrap member in realization options is no longer used to indicate
wrapping since 8f8ae302ba. So rename it to repeat since the only user is
now repeating in the realization algorithm.
2025-01-15 15:22:36 +02:00
Bastien Montagne
484fa519fb Fix some issues with bpy.data.user_map implementation.
* In case a subset of IDs is given, it was not checked that all items
  are ID data.
* In case of error while processing the subset, there could be some
  python data 'leak' (the `user_map` would not be unreferenced).
* Improve performances in case there are many duplicates in given subset
  iterable of IDs, by not processing the duplicates.

Discovered in !127252 review.
2025-01-15 11:35:11 +01:00
Alaska
f09fd9bdef Fix #132935: Add sample subset feature to Cycles
Cycles has a sample offset feature allowing users to render X samples
in a single frame on one device, then the remaining Y samples later or
on a different device and combine them back together at the end.

However in most situations the result from using this method was
different, and usually lower quality than rendering all the samples in
one go.

This was because Cycles tunes it's random number sequence for the
number of samples being rendered. And the random number sequence was
being tuned for the wrong number of samples in the case that a user
was using the sample offset.

This commit fixes this issue by adding a "sample subset" feature.
The user specifies the total sample count being rendered across all
devices in the existing `Max Samples` parameter, then specifies per
device which subset of samples will be rendered (E.g. Render samples
0-1024 out of a 0-2048 range).

This commit also contains some additional clean up work
inside Cycles related to the area being changed.

Co-authored-by: Brecht Van Lommel <brecht@blender.org>
Pull Request: https://projects.blender.org/blender/blender/pulls/132961
2025-01-15 07:41:16 +01:00
Campbell Barton
a29fe64e53 Cleanup: quiet compiler warning 2025-01-15 17:29:31 +11:00
Aras Pranckevicius
1ad083dabf Tests: Add FBX import tests, switch OBJ/PLY/STL import tests to the same machinery
"Expected textual data output" comparison based tests for FBX,
OBJ, PLY, STL import.

- There's a tests/python/modules/io_report.py that can produce
  a "fairly short text description of the scene" (meshes, objects,
  curves, cameras, lights, materials, armatures, actions, images).
  About each object, it lists some basic information (e.g. number
  of vertices in the mesh), plus a small slice of "data" (e.g.
  first few values of each mesh attribute).
    - Custom import parameters, if needed, can be provided by
      having a sidecar .json file next to imported file (same
      basename, json extension), that would have a single json
      object with custom arguments.
- Add FBX test coverage, with 46 fairly small files (total size 3.8MB)
  covering various possible cases (meshes, animations, materials,
  hierarchies, cameras, etc. etc.).
- Switch OBJ/PLY/STL import tests to the above machinery, remove C++
  testing code.

Pull Request: https://projects.blender.org/blender/blender/pulls/132624
2025-01-15 05:52:15 +01:00
Hans Goudey
98060efcf1 Fix #132537: Assert when baking with string attribute
Propagating string attributes isn't supported in many places currently,
the split edges node is not an exception, so skip those attributes as
necessary.
2025-01-14 22:29:03 -05:00
T0MIS0N
ac64ada636 Texture: Add an option for scaling all UDIM tiles when resizing images
This addresses the 'Resize UDIM sequences' feature from issue #109820

If the user needs to resize all UDIMs in an image, they currently need
to go through a tedious process of switching through all the UDIMs and
resizing them individually.

Now, when the user resizes an image, they can choose to apply the
operation to all UDIM tiles in the image.

Co-authored-by: T0MIS0N <50230774+T0MIS0N@users.noreply.github.com>
Pull Request: https://projects.blender.org/blender/blender/pulls/132524
2025-01-15 03:30:29 +01:00
Hans Goudey
5e3951541e Cleanup: A few clang tidy fixes for geometry module
Mostly removing unused includes.

Pull Request: https://projects.blender.org/blender/blender/pulls/133078
2025-01-15 02:56:59 +01:00
Hans Goudey
a904b4f0fd Cleanup: Resolve printf signed/unsigned warning 2025-01-14 20:02:04 -05:00
Harley Acheson
67e7cb6b8a UI: Remove RNA Defaults from Negative Boolean Properties
Until the refactor of 255f031e3e, Negative Boolean Properties would
restore the opposite value for "Reset to Defaults".  Now that this
works, this PR removes the RNA property defaults that are no longer
needed.

Pull Request: https://projects.blender.org/blender/blender/pulls/133076
2025-01-15 01:21:57 +01:00
Sean Kim
5659be7a7d Fix: Update DEG_debug_graph_relations_validate commented line
Changed in d325e6f0e8

Pull Request: https://projects.blender.org/blender/blender/pulls/133071
2025-01-15 00:53:22 +01:00
Harley Acheson
26c15292a7 Fix #99187: Increased Contrast of Transform Cursors
When transforming Objects, like scaling and rotating we see a custom
drawn cursor at the mouse position. In the default theme this is
entirely black, doesn't change with background color, and can be very
hard to see in some circumstances. This PR uses the same colors as the
text overlays and adds a contrasting shadow to help add some contrast.

Pull Request: https://projects.blender.org/blender/blender/pulls/132671
2025-01-14 23:01:11 +01:00
Hans Goudey
78090a0ce5 Fix #132946: Incorrect handle types after subdividing curves
Followup to 80f5b3ad21 which was just
plain wrong. Somehow I missed the whole point and set auto handle types
instead of aligned. In a more thorough dive into this area, there was
some weird structural decisions making things harder than they should be.
This commit slightly simplifies the way the first and last handle of a
segment are set, moving it all to happen in one place and making the
processing of the last cyclic segment a bit simpler. The resulting
handles are aligned if possible.

Pull Request: https://projects.blender.org/blender/blender/pulls/133070
2025-01-14 21:52:32 +01:00
Brecht Van Lommel
46f4810d38 Cleanup: Compiler warnings 2025-01-14 21:26:48 +01:00
jlalleve
2feadc623b Core: Environment variables for deployment
* BLENDER_SYSTEM_SCRIPTS support for multiple script paths, separated by
  ; on Windows and : on other platforms.
* New BLENDER_CUSTOM_SPLASH to replace the splash screen image.
* New BLENDER_CUSTOM_SPLASH_BANNER to overlay an image on the splash.

Contributed by Sony Interactive Entertainment: https://github.com/PlayStation-OpenSource
2025-01-14 20:57:31 +01:00
Harley Acheson
6922418a95 Fix #79388: Increase User Scale Hard Min to 0.5
Increase the hard minimum for Resolution Scale from 0.25 to 0.5. 0.5 is
also the current soft limit (the least you can get by just dragging on
the widget). But, as illustrated by the bug report, accidentally typing
in a value below 0.5 is difficult to recover from since the text is too
small to see. It is a useful minimum though in that this value is good
for tests and captures on High DPI system to simulate low dpi.

Pull Request: https://projects.blender.org/blender/blender/pulls/131688
2025-01-14 20:54:16 +01:00
Hans Goudey
9dd3c64c36 Cleanup: Remove unused includes in some blenkernel files
Pull Request: https://projects.blender.org/blender/blender/pulls/133067
2025-01-14 19:55:11 +01:00
Harley Acheson
de95daaadf Fix #130171: Stop Panel Animation When Removing Regions
When removing areas ensure that none of its panels are currently
running open/close animations. If so turn them off.

Pull Request: https://projects.blender.org/blender/blender/pulls/131998
2025-01-14 19:43:42 +01:00
Bastien Montagne
255f031e3e Refactor: RNA definition of Boolean bitset/bitflags properties.
Existing code had several issues:
* The 'DNA bitset as RNA array' behavior was totally undocumented,
  virtually impossible to discover, very confusing, and without any
  checks that given parameters (like the array length) were valid.
* The DNA defaults handling was fully broken for 'negative' boolean
  properties.

This commit:
* Factorizes all rna define code for boolean properties storing a `booleanbit`
  value into a new static util (this revealed and fixed the 'negative defaults'
  issue).
* Forbids calling `RNA_def_property_array` on a Boolean property with a
  non-null `booleanbit` value.
* Introduces a new `RNA_def_property_boolean_bitset_array_sdna`,
  strictly to define 'DNA bitsets as RNA array' properties.
* Adds several validation checks, in particular regarding the bitset
  case: it takes into account the fact that bitshift operations on
  negative numbers are typically
  [arithmetic ones](https://en.cppreference.com/w/cpp/language/operator_arithmetic),
  which means that they preserve the sign of the value, and that the
  left-most bit should never be used with signed integers for bitsets.

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

The fix to DNA defaults handling on 'negative' properties revealed
several RNA errors, listed below. Fixing them is not necessarily trivial
(as some seem to contradict the DNA default values, e.g. the
`View3DShading.use_studiolight_view_rotation` one), so it is kept
outside of this refactor. Conflicting cases should likely be handled by
the relevant modules (to decide whether the DNA, or the RNA default
should be kept).

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

Also realized that many DNA types are ignored when trying to find DNA
default values. This will also be tackled separately, as fixing it is
fairly straightforward.

Pull Request: https://projects.blender.org/blender/blender/pulls/132917
2025-01-14 18:19:27 +01:00
Jeroen Bakker
264681344f Vulkan: Provide more control on memory allocation
This change give access to preferred and required allocation flags
allowing better control over where memory is allocated.

Pull Request: https://projects.blender.org/blender/blender/pulls/133059
2025-01-14 17:41:35 +01:00
Sybren A. Stüvel
e57172a2ee Refactor: Anim, simplify the function to flip bone names when pasting keys
Replace pointer magic with `std::string` and `blender::StringRef`.

The old code modified the RNA path of F-Curves to extract & flip the
bone name. The new code is not modifying any data, at the expense of a
few more copies. Since these strings are not long, and the call to
`BLI_string_flip_side_name()` also makes quite a few copies, the
performance impact should be negligible.

No functional changes.

Pull Request: https://projects.blender.org/blender/blender/pulls/133005
2025-01-14 17:12:09 +01:00
Sybren A. Stüvel
9a7f057dde Refactor: Anim, in keyframe pasting code, change to_simple to to_single
The variable/parameter indicates that the user is pasting to a single
F-Curve. It now mirrors `from_single`.

No functional changes.

Pull Request: https://projects.blender.org/blender/blender/pulls/133005
2025-01-14 17:12:09 +01:00
Sybren A. Stüvel
894e242cfa Refactor: Anim, make pastebuf_match_path_property() easier to read
Simplify `pastebuf_match_path_property()` by reducing cognitive complexity
and using `StringRef::endswith()` instead of pointer arithmetic.

I've also added a few unit test cases that cover some unwanted behavior:
the property name check only checks suffixes, and so copying "….location"
will also paste it to a "….not_actually_location" F-Curve.

No functional changes.

Pull Request: https://projects.blender.org/blender/blender/pulls/133005
2025-01-14 17:12:09 +01:00
Sybren A. Stüvel
44b37ee8ed Refactor: Anim, simplify pastebuf_match_path_full()
Simplify `pastebuf_match_path_full()` by reducing cognitive complexity.

Pull Request: https://projects.blender.org/blender/blender/pulls/133005
2025-01-14 17:12:09 +01:00
Sybren A. Stüvel
ae84e23110 Refactor: Anim, keyframe paste: add unittest for bone name flipping func
Add a unit test for the bone name flipping function of the keyframe
paste functionality.

The function itself has been changed a little bit, so that it returns a
`std::string` instead of using a `char **` return parameter that needs
explicit freeing at the call site. This made the tests considerably
simpler to write. This change does cause an extra copy of the RNA path,
but that should be refactored away soon.

No functional changes.

Pull Request: https://projects.blender.org/blender/blender/pulls/133005
2025-01-14 17:12:09 +01:00
Sybren A. Stüvel
bdc420037d Refactor: Anim, add unit tests for some keyframe paste code
The code under test needed a little refactor to make it testable.

No functional changes.

Pull Request: https://projects.blender.org/blender/blender/pulls/133005
2025-01-14 17:12:09 +01:00
Sybren A. Stüvel
b4e0ff6b8f Refactor: Anim, use strategy pattern in keyframe pasting code
This makes it considerably easier to write  tests for some functions
before I refactor them too.

No functional changes.

Pull Request: https://projects.blender.org/blender/blender/pulls/133005
2025-01-14 17:12:09 +01:00
Jeroen Bakker
04e64b27ea Vulkan: Ignore swapchain image layout/content
Blender always updates all pixels of the swap chain. As an optimization
we can skip the initial layout transition from present to transfer
destination as all pixels will be rewritten.

Pull Request: https://projects.blender.org/blender/blender/pulls/133061
2025-01-14 17:08:04 +01:00
YimingWu
1bacb0de62 Fix #132987: Grease Pencil: Ensure selection domain when switching modes
Grease Pencil tool settings could have different selection modes for
different object modes (like edit mode and sculpt mode). This fix
ensures when switching object modes, the selection domain is updated to
match the selection mode.

Pull Request: https://projects.blender.org/blender/blender/pulls/133030
2025-01-14 16:46:23 +01:00
Jacques Lucke
684fd4643a Nodes: use BKE_main_ensure_invariants directly instead of ED_node_tree_propagate_change
`BKE_main_ensure_invariants` was added in 1fae5fd8f6. The older
`ED_node_tree_propagate_change` was already implemented as a thin wrapper around
`BKE_main_ensure_invariants`. This patch removes the wrapper and calls the more
general function directly.

A new overload of `BKE_main_ensure_invariants` is added for the common case when
only a single data-block has been modified.

Pull Request: https://projects.blender.org/blender/blender/pulls/133048
2025-01-14 16:26:54 +01:00
Jacques Lucke
476b7ded9e Nodes: make explicit legacy type optional
This makes specifying a legacy type for new node types optional (e.g.
`GEO_NODE_MESH_TO_CURVE`). Instead, only the `idname` is used as a stable
identifier for node types. So there is less redundancy for now.

This change helps with the decentralized definition of nodes and reduces the
number minimum number of files that need to be changed for a new node from 5 to
4. It especially helps when multiple nodes are worked on at the same time,
because the legacy type definition was very prone to have merge conflicts.

For compatibility reasons and because it's still used by existing code, the
`legacy_type` is not removed. All existing nodes keep their current
`legacy_type`. New nodes will receive an auto-incremented legacy type. It's
still necessary to give nodes unique legacy types, because some code checks if
two nodes have the same type by comparing their `legacy_type`. These types only
have to be unique at run-time though. Some randomness is used to avoid depending
on stable generated legacy types accidentally.

Pull Request: https://projects.blender.org/blender/blender/pulls/133044
2025-01-14 14:39:36 +01:00