Commit Graph

150077 Commits

Author SHA1 Message Date
Jesse Yurkovich
1ceaaeeff7 USD: Write extents out for Curves and more consistently for other types
Cleanup and enhance our export of the USD `extent` attribute.

This does the following:
- The existing `author_extents` function now uses recently added common
  code to write out the extents attribute
- A new `author_extents` overload allows the use of Blender's native
  bounds for the types that support it. We now use this rather than
  asking USD to recompute it for us.
- Meshes will now have their extents correctly written during animations
- Curves will now have their extents written as they were not doing so
  prior to this PR
- Hair, Lights, Points, and Volumes make use of the `author_extents`
  functions now

Since Curves need their extents tested, this PR also moves the test from
C++ to Python. Python tests allow for faster iteration, are more
straightforward to write, and allow usage of the USD validator.

Pull Request: https://projects.blender.org/blender/blender/pulls/132531
2025-01-17 03:28:13 +01:00
Jesse Yurkovich
cdc7526aed Fix: Use correct set_attribute overload for USD writing
Own mistake in 49ae7ffc9c found through inspection shortly after commit.

Add a static_assert to prevent the hard to notice problem in the future.

Pull Request: https://projects.blender.org/blender/blender/pulls/133169
2025-01-17 03:27:49 +01:00
Campbell Barton
dd32c10b5d Refactor: minor changes to get_path_environment_multiple
- Support a null "subfolder_name" argument
  in keeping with the rest of BLI_appdir functions.
- Use "test_path" utility to de-duplicate path joinging & checks,
  this also means the paths will be logged.
- De-duplicate loop body for the last item.
2025-01-17 12:29:16 +11:00
Campbell Barton
a586b537af Cleanup: various non-functional changes in C++ 2025-01-17 11:54:43 +11:00
Campbell Barton
bb92a6fbef Fix BMesh quad tangent calculation failure to normalize
This impacted the Python method BMFace.calc_tangent_edge_pair()
2025-01-17 11:31:28 +11:00
Ray Molenkamp
f6f1d610d8 Fix: Failing geo node tests on MSVC 2022
The MSVC 2022 optimizer generates bad code for perlin_fractal_distorted
when perlin_fbm gets inlined leading to incorrect results and failing
tests that rely on perlin noise. For now just disable inlining for this
function for msvc2022 until we can get the compiler fixed.

This fixes the following failing tests on MSVC 2022:

- geo_node_curves_deform_curves_on_surface
- geo_node_geometry_delete_geometry_propogate_corner_attribute
- geo_node_utilities_field_on_domain_demo

Pull Request: https://projects.blender.org/blender/blender/pulls/133130
2025-01-17 01:00:40 +01:00
Harley Acheson
8ad3653112 UI: Improve Status Bar Display for Mesh Point Normals
Mesh Edit Mode / Mesh Menu / Normals / Point to Target... operator
shows keymap entries on the area header and in the status bar. This PR
removes the area header drawing and improves the Status bar using the
current pattern, including showing statuses with reversed items.

Pull Request: https://projects.blender.org/blender/blender/pulls/131586
2025-01-17 00:31:37 +01:00
Harley Acheson
6727676740 Fix #129579: Improvement to Changed Brush Display
Changed custom sculpt brushes currently shows "*Unsaved Changes" as a
label that can overlap with the "Brush Assets" header. This PR makes
the header text show as "Brush Asset (Unsaved)" in this circumstance.

Pull Request: https://projects.blender.org/blender/blender/pulls/131119
2025-01-16 23:19:24 +01:00
Hans Goudey
c6f5c44350 Cleanup: Remove unused includes in editors modules
Pull Request: https://projects.blender.org/blender/blender/pulls/133166
2025-01-16 23:17:51 +01:00
Harley Acheson
6696f11808 UI: Upgrade Inter font 4.0 -> 4.1
Released November 15 2024, version 4.1 has a lot of changes shown here:
https://github.com/rsms/inter/releases but nothing that anyone should
notice as it mostly looks identical. Same transforms applied: Tabular
numbers, Open Digits, and Disambiguation without slashed zero.

Pull Request: https://projects.blender.org/blender/blender/pulls/132508
2025-01-16 22:56:53 +01:00
Julien Duroure
312289ca60 glTF export: fix recursivity check on gpu instances 2025-01-16 21:34:45 +01:00
Julien Duroure
4dccaf5fae glTF export: ignore variant extras 2025-01-16 21:29:37 +01:00
Julien Duroure
b71d8484e2 glTF exporter: make sure color is white if only alpha is used 2025-01-16 21:26:54 +01:00
Julien Duroure
96369594f4 glTF import: tweak option UI 2025-01-16 21:25:12 +01:00
Julien Duroure
3f68656c7a glTF export: add keep named node flag for gltfpack 2025-01-16 21:24:00 +01:00
Julian Eisel
69c27dce3c Cleanup: Correct incorrectly placed comment for area space-type
This seems to have been placed incorrectl in 5a43406e1b.
2025-01-16 20:53:34 +01:00
dupoxy
40b0185a8e UI: Add asset browser option to remove the preview of asset
Allow user to remove the preview of an asset from the asset browser details region.
Additionally, user can now reuse the default icons after adding a preview.

Pull Request: https://projects.blender.org/blender/blender/pulls/132575
2025-01-16 20:32:40 +01:00
Julian Eisel
da62529ca9 Cleanup: Add comment for asset shelf function 2025-01-16 20:19:33 +01:00
Julian Eisel
71091e9615 Fix: UI: Brush asset operator may activate catalog in wrong shelf storage
Asset shelves provide the `STORE_ENABLED_CATALOGS_IN_PREFERENCES` option in BPY
to decide if the enabled catalogs should be stored in the preferences or in the
asset shelf itself. Depending on the use case of the asset shelf one might make
sense over the other.

The brush asset operator to save changes would always activate a new catalog in
all asset shelves using storage in the preferences, ignoring the option. This
becomes more of an option if the code is reused, as proposed in
blender/blender!132857.
2025-01-16 20:12:35 +01:00
Harley Acheson
53fdb68bd0 Fix #79977: Light Theme NumSlider InnerSel
Slight brightening of the Light Theme Value Slider Inner Selected color
so that it can indicate which of multiple items are selected.

Pull Request: https://projects.blender.org/blender/blender/pulls/131338
2025-01-16 17:18:37 +01:00
Miguel Pozo
1406b9e656 Fix #133073: Overlay-Next: Meshes without UVs crashes the UV Editor
Add missing check for has_active_edit_uvmap.
2025-01-16 17:14:22 +01:00
Christoph Lendenfeld
3fca91ad74 Refactor: remove unused function
this patch just removes an unused function left behind by #132601

Pull Request: https://projects.blender.org/blender/blender/pulls/133162
2025-01-16 17:02:12 +01:00
Jacques Lucke
dbb81ca483 Cleanup: BLO: simplify name to bhead map
This replaces a `GHash` with `Map<blender::StringRefNull, BHead *>` which
simplifies using the type. Additionally, this patch also removes
`USE_GHASH_BHEAD` which not seem like it's worth having it nowadays (it was
always enabled anyway and I have never seen anyone disable it).

Pull Request: https://projects.blender.org/blender/blender/pulls/133057
2025-01-16 16:57:44 +01:00
Miguel Pozo
a08de337db Fix #131981, #132995: Overlay-Next: Fix In-Front selection and cycling
The code relied on `disable_depth_test` to render without depth testing
on selection, but it was set at pre-draw, so it was always false when
calling `res.select_bind` inside the sync code.

There was also no code to tell in-front and regular objects apart, so
in-front objects were not prioritized.
The previous engine seemingly divided the depth of In Front objects by
100, so I'm reproducing the same behavior here.

Fix #131981
Fix #132995

Pull Request: https://projects.blender.org/blender/blender/pulls/133020
2025-01-16 16:45:25 +01:00
Falk David
8a4509492f Fix: VSE: Revert some changes made to RNA animation paths
This was done by mistake in d3ba70190b.
They shouldn't have been renamed.
2025-01-16 16:44:34 +01:00
Miguel Pozo
80bd81a4f6 Fix #132890: Grease Pencil: Selection crash in wireframe mode
`dtxl->depth` may not be valid until draw time, so acquire the viewport
textures/framebuffers inside the draw callback instead.

Pull Request: https://projects.blender.org/blender/blender/pulls/132922
2025-01-16 15:14:54 +01:00
YimingWu
43492a8278 Fix #133035: Grease Pencil: Convert mesh materials to fill materials
When converting mesh to grease pencil, different face materials should
also be converted to grease pencil ones. This now works by converting
viewport display color diffuse_color from the mesh material to grease
pencil material fill color. Notes:

- If there are empty material slots in the mesh, faces assgined to these
  material slots will be assgined to a new fallback white material in
  the converted grease pencil fills.
- If original mesh does not have any material slots, a white material
  will be created in the grease pencil object for the fills.
- If original mesh has multiple material slots of the same material,
  they would be reduced to one material slot in the converted fills.

Pull Request: https://projects.blender.org/blender/blender/pulls/133087
2025-01-16 15:12:50 +01:00
Christoph Lendenfeld
f105366d73 Anim: Support multi object editing when applying poses
This patch adds support to apply a pose asset to multiple armatures in pose mode at once.
In case there is a suitable slot for the armature, it will be used to read from, otherwise
the system falls back to slot 0.

Part of #131840

Pull Request: https://projects.blender.org/blender/blender/pulls/132601
2025-01-16 13:17:20 +01:00
Philipp Oeser
fe5ce93a40 Cleanup: quiet compiler warning
Missed in c452d5d9e8
2025-01-16 12:58:58 +01:00
Falk David
d3ba70190b VSE: Python API: Rename RNA types from Sequence to Strip
This PR renames `bpy.types` that contain `Sequence` (and refer to a strip) to `Strip`.

The `bpy.types.Sequence` has already been renamed to `bpy.types.Strip` in
a previous PR. See !132179.

Additionally, this PR does some cleanup renamings in the sequencer
RNA files (e.g. `sequence` -> `strip`).

Part of #132963.

Pull Request: https://projects.blender.org/blender/blender/pulls/133054
2025-01-16 12:32:59 +01:00
Philipp Oeser
36269ab3a3 Fix #133091: Grease Pencil Vertex Weight Proximity wrong with "flipped" distances
One should be able to set the modifier `Highest` value lower then the
`Lowest`, in fact this is probably the more common usecase (getting high
values in the vertexgroup when something is close by and getting lower
values the further away from the target we get).

Now change code so we do exactly like we do for meshes.

NOTE: for grease pencil (as opposed to meshes), the Vertex Weight
Proximity modifier has a button to flip the output values, this can
probably stay for convenience.

Stumbled over this checking on #133055

Pull Request: https://projects.blender.org/blender/blender/pulls/133092
2025-01-16 12:06:27 +01:00
Philipp Oeser
c452d5d9e8 Fix #133099: Remove GP TextureMapping modifier vertexgroup influence
If I read code correctly, at least offset/translation and scale happen
in the Curve domain only in GPv3, so having vertexgroups influence per
point does not really make sense for this modifier.

Therefor, remove the influence vertexgroup from this modifier.

Pull Request: https://projects.blender.org/blender/blender/pulls/133102
2025-01-16 11:54:04 +01:00
Christoph Lendenfeld
a03b1e063d Fix #131905: Affect transform not working for Pose Space
This feature was just not implemented yet.
The solution is similar to 042a1327ca which implemented this
for the scale constraint.

Pull Request: https://projects.blender.org/blender/blender/pulls/132176
2025-01-16 11:44:38 +01:00
Campbell Barton
481a8b67d4 PyAPI: add bpy.app.portable, derived from WITH_INSTALL_PORTABLE
Support differentiating between portable & system installations,
useful to properly locate relative paths which would not work
on system installations.

Ref !133143
2025-01-16 21:07:29 +11:00
Sybren A. Stüvel
59585cf978 Cleanup: document difference between bpy.app.version and .version_file
Clarify the meaning `bpy.app.version_file`, by being more explicit in the
description of `bpy.app.version` and their differences.

### Old:

`bpy.app.version`
: The Blender version as a tuple of 3 numbers. eg. (2, 83, 1)

`bpy.app.version_file`
: The Blender version, as a tuple, last used to save a .blend file, compatible with ``bpy.data.version``. This value should be used for handling compatibility changes between Blender versions

### New:

`bpy.app.version`
: The Blender version as a tuple of 3 numbers (major, minor, micro). eg. (4, 3, 1)

`bpy.app.version_file`
: The Blender File version, as a tuple of 3 numbers (major, minor, file sub-version), that will be used to save a .blend file. The last item in this tuple indicates the file sub-version, which is different from the release micro version (the last item of the `bpy.app.version` tuple). The file sub-version can be incremented multiple times while a Blender version is under development. This value is, and should be, used for handling compatibility changes between Blender versions

Pull Request: https://projects.blender.org/blender/blender/pulls/133142
2025-01-16 11:06:59 +01:00
Casey Bianco-Davis
3f8b95f8c2 Grease Pencil: Option to subdivide last segment when closing stroke
Adds a option to add new points on the last segment to match point density.
This matches the legacy grease pencil operator.

Resolves: #125262

Pull Request: https://projects.blender.org/blender/blender/pulls/133026
2025-01-16 11:06:41 +01:00
Pratik Borhade
d891df4496 Fix #133116: Grease Pencil: Toggle selection selects all on next click
Caused by 1bacb0de62
`.selection` attribute is not converted to desired domain after changing
the type. `ensure_selection_domain` should be excuted to perform the
attribute domain conversion

Pull Request: https://projects.blender.org/blender/blender/pulls/133132
2025-01-16 11:01:38 +01:00
Jeff Moguillansky
ea4d01923b Fix: Vulkan: local_read incorrect attachment load/store ops
This fixes a rendering issue when local read enabled.
Before fix, the output image is too bright.  This is due to incorrect load/store.

With this fix, the logic for attachment load/store ops with local_read on matches the logic with local_read off inside subpass_transition_impl...

Pull Request: https://projects.blender.org/blender/blender/pulls/133111
2025-01-16 08:21:14 +01:00
Campbell Barton
81c26130dc Fix #43998: toggling edit-mode can destroy mesh shape-key
Regression in [0] that clamped the shape-key index when exiting
edit-mode but not when entering, causing the "Basis" shape not to
be treated as active when entering edit-mode, then treated as active
when exiting - overwriting it's values from the mesh.

Resolve by clamping on edit-mode enter & exit.

[0]: 225e3460d0
2025-01-16 16:36:50 +11:00
Alaska
7a4d0ab9fa Tests: Add a Cycles render test for the sample subset feature
This test consists of 4 lights in a scene with the light tree disabled.
This means a sample count that's a multiple of 4 must be used to get a
relatively clean result.

The maximum sample count is set to 4, with the sample subset option
turned on. The subset offset is set to 2 to test the offset,
and a length of 4, which will be internally clamped to 2.
The length of 4 was chosen to test the sample subset length clamping.

Ref: blender/blender-test-data!43
Ref: blender/blender@f09fd9bdef
2025-01-16 06:22:48 +01:00
Harley Acheson
8c9446a0d7 UI: Color Picker Status Bar Mac Information
On Mac we can now pick colors from outside Blender windows, but this
requires pressing the "Enter" key. This PR just changes the status bar
so that on Mac OS it shows this information to the user.

Pull Request: https://projects.blender.org/blender/blender/pulls/133120
2025-01-16 04:57:24 +01:00
Jonas Holzman
96babd5e9f UI: Support canceling Eyedropper color picking operations
Have `eyedropper_color_sample_fl` return success, in case platform
sampling starts but is canceled (Async return on MacOS). Removes any
chance of returning black color on failures.

Pull Request: https://projects.blender.org/blender/blender/pulls/133124
2025-01-16 04:13:48 +01:00
Campbell Barton
4e683c4bd6 Cleanup: doxygen formatting for param 2025-01-16 13:04:17 +11:00
Campbell Barton
e3e8c154fa Docs: correct collection.objects_add_active name & description
The name was incorrect as it doesn't add to the "Active Collection"
the description, was also incorrect referencing "the object" instead
of the selection.

Use a longer description to clarify the purpose of the operator.

Resolves #64313.
2025-01-16 13:04:17 +11:00
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