Commit Graph

110393 Commits

Author SHA1 Message Date
Sybren A. Stüvel
9d3dc77e05 Anim: move Bone Selection Sets add-on into Blender
The functionality of the Bone Selection Sets add-on is now integrated
into Blender itself. Rigify has been updated to no longer check for the
add-on, but just assume that the functionality is available.

The keymap is still the same, and so are all the class names. This
ensures that there are no conflicts when people still have the old
add-on enabled somehow. And there is versioning code to remove the
'add-on enabled' state so that Blender won't complain it cannot find it
any more.

Compared to the add-on, the following changes are made:

- The 'bone' icon has been removed from the list of available selection
  sets. It was the same for each entry anyway, and thus didn't provide
  any information.
- The code has been split up into multiple files, with the UI elements
  in `scripts/startup/bl_ui/properties_data_armature.py` and the
  operators in `scripts/startup/bl_operators/bone_selection_sets.py`.
- Helper functions and classes are prefixed with `_` to indicate that
  they are not part of any public API.
- The `Operator` helper subclasses have been transformed to mix-in
  classes. This way the only subclasses of `Operator` are the actual
  operators.
- Comments & descriptions have been updated for clarity & consistency.

This commit contains code by the following authors, ordered by number of
commits in the original add-on repository, highest first:

Co-Authored By: Ines Almeida <britalmeida@gmail.com>
Co-Authored By: Sybren A. Stüvel <sybren@stuvel.eu>
Co-Authored By: Campbell Barton <ideasman42@gmail.com>
Co-Authored By: meta-androcto <meta.androcto1@gmail.com>
Co-Authored By: Demeter Dzadik <Mets>
Co-Authored By: lijenstina <lijenstina@gmail.com>
Co-Authored By: Brecht Van Lommel <brechtvanlommel@gmail.com>
Co-Authored By: Aaron Carlisle <carlisle.b3d@gmail.com>

For the full history see the original add-on at:
https://projects.blender.org/blender/blender-addons/commits/branch/main/bone_selection_sets.py

Reviewed On: https://projects.blender.org/blender/blender/pulls/124343
2024-07-08 16:28:42 +02:00
Philipp Oeser
93585602a1 Fix #100164: Alembic import: Ensure mesh normals are normalized
Similar to !124267 and !124261

This normal data is eventually passed into `BKE_mesh_set_custom_normals`
and through to `mesh_normals_corner_custom_set` which expects normals to
actually be normalized per its documentation.

Not doing so would yield meshes with incorrect "sharp" data for affected
edges.

Thx @OmarEmaraDev for the initial patch

Pull Request: https://projects.blender.org/blender/blender/pulls/124336
2024-07-08 16:03:52 +02:00
Miguel Pozo
a7e24222cf EEVEE: Show compilation subprocesses information
Inform the user when EEVEE is compiling materials and parallel
compilation is disabled.

Pull Request: https://projects.blender.org/blender/blender/pulls/124249
2024-07-08 15:23:58 +02:00
Hans Goudey
80a0c4237a Fix #121696: Use after free with static asset caches when opening new file
The cause of the crash was that asset libraries are freed, but the filtered
trees used for things like node tool menus weren't marked dirty, so we
continued to use the freed asset data. On a design level this is quite
concerning because it means the lifetimes of the asset tree caches and
the asset system's asset libraries are connected tenuously.

Eventually there should be a better solution, but I found the simplest
fix for now is just to add a notifier when opening a new file that causes
the asset tree caches to be tagged dirty.

Pull Request: https://projects.blender.org/blender/blender/pulls/124254
2024-07-08 15:10:42 +02:00
Lukas Tönne
d14478c747 Fix #124310: Add override flag to prevent infinite recursion
The `enum_definition` property was changed by #121234 and now returns
the node itself. This creates an infinite recursion in the override
system that must be avoided by adding this flag.

Pull Request: https://projects.blender.org/blender/blender/pulls/124347
2024-07-08 15:04:49 +02:00
Lukas Stockner
26b6c2b94d Fix #124211: FCurve generates NaNs with Vector handles
The issue here was that the left handle of the first point was calculated
incorrectly (set to the position of the point itself), which caused a
NaN when attempting to normalize a zero vector when computing extrapolation
vectors.

Pull Request: https://projects.blender.org/blender/blender/pulls/124239
2024-07-08 15:01:18 +02:00
Alaska
a0869d2ca6 Shader: Update Principled BSDF node description
Update the description to mention the node is now based on the OpenPBR
model rather than the Disney Principled Model. This has been the
case since Blender 4.0.

Pull Request: https://projects.blender.org/blender/blender/pulls/124209
2024-07-08 14:38:07 +02:00
Campbell Barton
5eef5454fa Fix #124250: enabling add-ons from command line broken
Excluding add-ons caused an `_bpy_internal.addons` not to install.
2024-07-08 22:27:47 +10:00
Damien Picard
9a0b5ac0c6 I18n: Translate sequencer channel and metastrip names
Both the metastrips and sequencer channels are user-editable data, so
translation of their names uses DATA_().

Issues reported by Gabriel Gazzàn.

Pull Request: https://projects.blender.org/blender/blender/pulls/124314
2024-07-08 13:00:09 +02:00
Jesse Yurkovich
f49780b888 Fix #120590: USD: Ensure mesh normals are actually normalized
This normal data is eventually passed into `BKE_mesh_set_custom_normals`
and through to `mesh_normals_corner_custom_set` which expects normals to
actually be normalized per its documentation.

Not doing so would yield meshes with incorrect "sharp" data for affected
edges.

Pull Request: https://projects.blender.org/blender/blender/pulls/124267
2024-07-07 21:27:01 +02:00
Jacques Lucke
bdb444bc2b Fix #124290: frames disappear when an invalid link exists 2024-07-07 11:16:50 +02:00
Campbell Barton
850e715682 UI: add UILayout.template_popup_confirm(..) function
This makes it possible for popups to have their confirm & cancel buttons
defined in the operator's draw callback.

When used with popups created by: `WindowManager::invoke_props_dialog()`
to override the default confirm/cancel buttons.

In the case of `WindowManager::popover(..)` & `bpy.ops.wm.call_panel()`
this can be used to add confirm/cancel buttons.

Details:

- When the confirm or cancel text argument is a blank string the button
  isn't shown, making it possible to only show a single button.
- The template is similar to UILayout::operator in that it returns the
  operator properties for the confirm action.
- MS-Windows alternate ordering of Confirm/Cancel is followed.

Needed to resolve #124098.

Ref !124139
2024-07-06 14:49:39 +10:00
Campbell Barton
bdf06e6d82 Cleanup: spelling in comments 2024-07-06 14:21:24 +10:00
Campbell Barton
c4ab17ab79 Cleanup: quiet compiler warnings 2024-07-06 13:37:16 +10:00
Charles Wardlaw
5224b1cab2 Fix #124206: USD: Always export animation transforms, even when identity
Now the export only skips identity transforms on static exports, to save
space.

Co-authored-by: Charles Wardlaw <cwardlaw@nvidia.com>
Pull Request: https://projects.blender.org/blender/blender/pulls/124251
2024-07-05 20:19:47 +02:00
Harley Acheson
938f50e1f7 Fix #124168: Allow File Browser Layout Initialization While Minimized
If you change an area to a File Browser while it is vertically
minimized we get an assert on layout initialization since there
are no visible rows. But this state is valid and it works great
without this assert. This PR removes the assert and adds a comment.

Pull Request: https://projects.blender.org/blender/blender/pulls/124253
2024-07-05 19:36:49 +02:00
Hans Goudey
b9edd2e02e Fix #124216: "Remove Hook" operator causes crash with geometry nodes
It looks like the "user edited flag propagation" node built for the geometry
nodes modifier is unchanged after modifiers are removed. My guess is this
is now a more general problem when modifiers are removed-- I guess the
depsgraph nodes for an object have to be rebuilt when that happens now.

Maybe there is a more general fix, but to fix the crash mentioned in the
report, I tagged the depsgraph for a relations update, which rebuilds the
problematic modifier node.

Pull Request: https://projects.blender.org/blender/blender/pulls/124252
2024-07-05 19:35:03 +02:00
Harley Acheson
fd06a407e1 Fix #124163: Update SO_DATA_API Outliner When Windows are Removed
On Window close send NC_WINDOW | NA_REMOVED notification. If Outliner
is in SO_DATA_API mode with this message then refresh.

Pull Request: https://projects.blender.org/blender/blender/pulls/124205
2024-07-05 19:33:27 +02:00
Philipp Oeser
4b168dd645 Fix #124166: Assetbrowser crash on quick Editor change (from py)
FileList can still be uninitialized while loading, so simple nullptr
check.

Pull Request: https://projects.blender.org/blender/blender/pulls/124243
2024-07-05 18:56:11 +02:00
Jacques Lucke
57e925b38f Fix: don't show grease pencil domain in Domain Size node
This fixes part of #123935. The change has to be reverted
in the `main` branch.
2024-07-05 18:09:38 +02:00
Jacques Lucke
da2a262658 Fix: don't show layer domain in viewer node
This fixes part of #123935.
2024-07-05 18:09:38 +02:00
Miguel Pozo
b20bacf657 Fix #123758: Viewport Render Animation doesn't track World updates
Viewport instances created by the Viewport Render Animation operator
don't get `view_updated` notifications.
Fix update detection by implementing a `last_update` timestamp for
`World`, similar to the ones added in #115196.

Pull Request: https://projects.blender.org/blender/blender/pulls/124114
2024-07-05 18:05:27 +02:00
Christoph Lendenfeld
c446813dd3 Fix #123943: manual channel ordering no longer works
The issue was that the function `animfilter_action` got a new
code segment at the start which checked `if (action.is_empty())`.
That function didn't check if the `groups` list of the action is empty
though. Regular keyframe animation is usually sorted into
keyframe groups, which means it is not stored under `curves` of the action.
However in the anim filtering code, the function `split_groups_action_temp`
moves the fcurves to their groups under the `groups` listbase.

Pull Request: https://projects.blender.org/blender/blender/pulls/124172
2024-07-05 17:56:45 +02:00
Jacques Lucke
e4c9b73051 Fix #124160: crash when trying to load unavailable grid
The openvdb API was used incorrectly before. I didn't notice that this is
a static function and requires the type to be passed in.

Note that this does not solve the cache invalidation issue yet. Instead
it handles the case more gracefully when the stored .vdb file changes
when Blender doesn't expect it to change.
2024-07-05 17:55:04 +02:00
Dalai Felinto
e969769a0c UI: Extensions: Update the tooltip for Allow Online Access
Some users were concerned that the tooltip wasn't clear enough on
indicating that Blender doesn't really inforce an offline mode.

The final text was a collaborative effort together with the UI team and
participants from the user-interface-module chat.

The tooltip talks about internet instead of specifically extensions or
repositories to leave room to be used in the future for other things
(e.g., for Blender to check for new release updates).
2024-07-05 17:49:10 +02:00
Sebastian Parborg
f853d097a5 Fix: GLSL error in the sequencer when running mesa
It would error out with "illegal use of reserved word 'active'"
Rename the boolan value to not use the reserved word.
2024-07-05 17:22:52 +02:00
Iliya Katueshenock
a2a5532818 Fix #121110: Allow changing type of reroute node sockets
Simple fix to avoid regression of reroute sockets in a custom nodes system.
Proper solution will be in 4.3: #121146.

Pull Request: https://projects.blender.org/blender/blender/pulls/124244
2024-07-05 17:14:54 +02:00
Sergey Sharybin
e9d46b52df Fix #124109: Blender Crash on certain verticles in Dyntopo
Caused by 396ad5db83

It is possible that some edge collapsing of non-manifold mesh will
eventually result in extra wire edges, and loose vertices. This was
not properly handled in the boundary checks, assuming that all
modifications preserve mesh manifold.

This fix avoids the crash by adding nullptr check in the boundary
check.

While this is not fully ideal from the result perspective, it is
a safe change for 4.2. Ideally the wire edges and loose vertices
will be removed, but this is a bigger and more risky change. Also,
in Blender 4.0 it was possible to generate loose geometry in
dyntopo as well, so it just a general improvement to happen (and not
a regression).

Pull Request: https://projects.blender.org/blender/blender/pulls/124236
2024-07-05 16:54:29 +02:00
Sybren A. Stüvel
b33ad47ee0 Anim: fix unsafe use of BLI_snprintf_rlen() in the NLA drawing code
Replace `BLI_snprintf_rlen()` with `STRNCPY_RLEN()`, as the string to
copy is not actually a printf-style format string, but just a plain string.

Pull Request: https://projects.blender.org/blender/blender/pulls/124228
2024-07-05 13:39:05 +02:00
Jeroen Bakker
0597cd4f76 Fix #124060: EEVEE raytracing on Intel Arc
EEVEE Raytracing on Intel Arc wasn't working as there were no rays
generated. The reason was that the raytract tile compact shader
didn't set count the correct tiles it needed due to atomic operations
that were initialized without atomic.

This PR solves the issue by using atomic operations to initialize
the counts. We also tried memory barriers but that didn't fix the
problem.

Other shaders were also tested if they have this issue, but they were
setup in a specific shader or where done using a race condition (SSS) which
is working.

Pull Request: https://projects.blender.org/blender/blender/pulls/124213
2024-07-05 12:37:44 +02:00
Aras Pranckevicius
c4534909b2 Fix #123578: VSE active but unselected strip outline visual tweak
Instead of making the dark outline be bright for active but unselected
strips, make it have dark outline just like all other strips,
and a 1px inner bright line inside of that.

Pull Request: https://projects.blender.org/blender/blender/pulls/124210
2024-07-05 11:35:18 +02:00
Aras Pranckevicius
bc6e90d40d Fix #123540: VSE thumbnails sometimes have 1px gap on the right side
Because a thumbnail image can get cropped, we can not calculate
horizontal zoom factor once for all thumbnails. Cropping happens
at integer coordinates, so recalculate zoom_x for each thumbnail
based on final image size.

Pull Request: https://projects.blender.org/blender/blender/pulls/124178
2024-07-05 11:27:48 +02:00
Aras Pranckevicius
b238df312d Fix #123918: STL exporter does not reverse faces for mirrored objects
Old python STL exporter, as well as other exporters like OBJ,
reverse the face order when object being exported has odd number
of negative scales in the matrix. The C++ STL exporter was lacking
that, resulting in the exported object looking "inside out".

The extra branch inside triangle export inner loop has no measurable
performance impact, probably because it is entirely predictable.

Pull Request: https://projects.blender.org/blender/blender/pulls/124219
2024-07-05 11:08:22 +02:00
Christoph Lendenfeld
23021fab74 Fix #123688: Bone selection broken when linking object data
When linking object data between two armatures the selection would not work
on the armature which got the new armature data assigned.
That is until a bone is added or something else is done to the armature that triggers a rebuild.
The fix is to trigger the rebuild in the link operator.

This only fixes this particular issue, the issue of bone selection sync between armature instances
is not fixed, but tracked in this report #117892

Pull Request: https://projects.blender.org/blender/blender/pulls/123743
2024-07-05 10:49:25 +02:00
Richard Antalik
c94bed9afa Fix #114859: VSE Retiming versioning was broken
Retiming versioning used incorrect source for strip length, so produced
inverted strips. Also it tried to scale sound strips by `speed_factor`,
but sound strips did not change length when retimed.

Finally, the original versioning code was in versioning_300.cc file,
even though it was released with 4.0 version.

Pull Request: https://projects.blender.org/blender/blender/pulls/123144
2024-07-04 23:57:34 +02:00
Clément Foucault
f8c80fe1fd Fix: EEVEE: Missing world if only an empty volume object is present
Part 2 of the fix. The previous fix was not enough.

Fixes #124159
2024-07-04 20:46:27 +02:00
Clément Foucault
3777e53acb Fix: EEVEE: Missing world if only an empty volume object is present
With the latest fixes of #124061, the `pipelines.volume.is_enabled`
predicate is now obsolete.
Replace it by `!current_objects_.is_empty()`.

Fixes #124159
2024-07-04 20:32:33 +02:00
Harley Acheson
26ea1f42c3 Fix #122808: Use Default Font when Vfont Missing
For text objects, current code will use another font if you ask for
a character that is not found in the selected font. But what if the
selected font is invalid? This can happen with a saved Blend that uses
a non-packed font that is since deleted. Current behavior will show
nothing. This PR restores earlier behavior where we use the built-in
font in this case. This does not make any changes to error reporting.

Pull Request: https://projects.blender.org/blender/blender/pulls/124184
2024-07-04 20:18:06 +02:00
Clément Foucault
2149a0b2cc EEVEE: Change local light ray clipping method
The previous one was too conservative and didn't
work with area light.
2024-07-04 20:07:27 +02:00
Clément Foucault
a023499d28 Fix: EEVEE: Make shadow tracing more robust
This commit does multiple things:
- It checks `is_behind_occluder` in all non-extrapolated
  cases. This avoid false positive hit caused by tracing
  basis X axis being almost parallel to the light.
- It checks time only on the last sample. This avoid
  light leaking when the ray poke through some solid
  objects because of raymarching steps.
- Add bias to `is_behind_occluder` to avoid
  precision issues when ray is parallel to the light
  direction.

This reduces noisy area lights but there are still issue
very close to them.

Fixes #123588
2024-07-04 20:07:27 +02:00
Bastien Montagne
47f7ce4580 Cleanup: Core: LibOverride: deduplicate code.
Call `BKE_lib_override_library_is_user_edited` instead of duplicating
its logic.

No functional changes expected here.
2024-07-04 15:41:49 +02:00
Bastien Montagne
34d157634a Fix #122623: Partial Resync fails to remap all ID pointers to existing unchanged overrides.
Regression from fb8bf8b0c8: Now that the 'automatic override'
relationships between IDs are much more strict, re-creating
sub-hierarchies of overrides as part of the partial resync may not be
able to 'find' all previously used overrides anymore. An additional
remapping from linked (reference) data to existing, unchanged 'old'
overrides is needed.

In the report case, the root of the partial resync is the Curve obdata
itself, which will imply resync of its material. But the Armature object
used as dependency of the material (through the driver target) has
already been checked as not needing resync, so it is not included as
part of this partial resync sub-hierarchy anymore.

However, it means that the newly resync material override will have a
pointer to the linked armature object, which then needs to be remapped
to the matching existing (unchanged) override.

NOTE: this likely means that too many override IDs are still being
resynced currently. In the report-s case e.g., the Material ID likely
does not need to be resynced either.
2024-07-04 15:41:49 +02:00
Bastien Montagne
265a25ee42 Cleanup: Core: LibOverride: Clearer variable name. 2024-07-04 15:41:49 +02:00
Bastien Montagne
44b6b59dca Debug: Add more log info in RNA override code.
Non-functional change.
2024-07-04 15:41:49 +02:00
Nathan Vegdahl
95b3daed5d Fix: don't auto-key location on connected bones
This is a follow up to #124054, which made all selected bones get their
location keyed after a targetless IK transform. That solved an issue
where auto-keying was failing to insert location keys on bones that
needed them, but in the process that fix also inserts location keys on
many bones that *don't* need it.

This commit addresses one of the simpler cases of unneccesary location
keys: bones that are connected to their parents. If a bone is connected,
its location will no longer get keyed.

Pull Request: https://projects.blender.org/blender/blender/pulls/124145
2024-07-04 14:50:31 +02:00
Damien Picard
cc40d9f565 I18n: Fix translations for NLA
- Do not translate a label containing the name of the active NLA
  action.
- Translate default action name when created by inserting a keyframe.
- Translate "<NoAction>" and other default NLA strip names.
- Translate "<NoAction>" displayed in the UI when no action exists in
  the NLA.
- Translate the temporary meta-strip created when moving an NLA strip
  around. This uses DATA_() for consistency, even though it is not
  really user data.

Issues reported by Gabriel Gazzán.

Pull Request: https://projects.blender.org/blender/blender/pulls/124113
2024-07-04 14:35:19 +02:00
Pratik Borhade
8ddd49409c Fix #124090: Delete strip operator missing redo panel property
Caused by 1a887c06d9
`poll_property` callback is not required, both delete strip and retiming
key operator are separated now.

Pull Request: https://projects.blender.org/blender/blender/pulls/124095
2024-07-04 13:22:37 +02:00
Damien Picard
6a52c76a65 I18n: Translate messages in extensions, operator descriptions, Node Wrangler
- Operator descriptions use tip_() since they will be displayed in
  tooltips.

- Extension messages:
  - Split "(Add-on|Theme) \"{:s}\" already installed!" into two
    messages.
  - Use rpt_() to translate error messages.

- Restore core add-on name and description translation.

- Use DATA_ to translate paint material slot name, so that translation
  happens only if the user enabled it for user-created data.

- Node Wrangler contains functions used to build operators' poll
  methods. This change allows them to be properly translated by using
  str.format() instead of f-strings, and explicit extraction with
  tip_().

Pull Request: https://projects.blender.org/blender/blender/pulls/123795
2024-07-04 10:49:52 +02:00
Aras Pranckevicius
2aee84a611 Fix #123579: VSE, no magenta preview for missing scene strips
Code that implemented "show missing media in magenta" in VSE preview
only implemented that for images and movies, and forgot that scene
strips can also be missing.

Pull Request: https://projects.blender.org/blender/blender/pulls/124124
2024-07-04 10:27:52 +02:00
Nathan Vegdahl
b31d34033a Fix: make auto-keying reliably key all needed bone channels
This is a follow-up to #123998 which fixed autokeying on objects when
the "Only Insert Needed" user preference was enabled. This fixes an
essentially identical bug for auto-keying bones, but *also* fixes a
different-but-related bug unique to bone keying.

In the first bug the location channel would erroneously not get keyed
sometimes when the "Only Insert Needed" user preference was enabled.
This fixes that by passing in whether more than one bone is being keyed
or not, and using that to accurately determine if location actually
needs to be keyed.

In the second bug, the location channel would erroneously not get keyed
when "Auto IK" was used to transform bones. This fixes that by just
being over-conservative. This unforunately leads to more bones getting
their location channel keyed than needed when Auto IK is used, but this
is better than *failing* to key needed channels, which was the previous
behavior. I left a comment explaining the situation, along with a TODO
to address this in a more satisfying way in the future.

Pull Request: https://projects.blender.org/blender/blender/pulls/124054
2024-07-04 10:18:32 +02:00