The button used a custom text that could be the same as the default,
properly extracted text ("Show Hotkey Text"), or a different
one ("Hide Hotkey Text"), and was thus not always shown.
Reported by Ye Gui in #43295.
This commit tries to make the bare minimum changes to add a meaningful
level of support for Action Slots in Rigify:
- You can now select an Action Slot in each Action Set-up, and that
will be assigned to the generated Action Constraints.
- For this to be meaningful, we have to support selecting the same
Action in multiple Action Set-ups, which would previously throw an
error.
- For that to be possible however, it was necessary to make the
trigger selectors of Corrective Action Set-ups select one of the
other set-ups directly, rather than selecting an Action (datablock),
and then making an association to one of the action set-ups based on
that action pointer. (The necessity to allow users to point at
another action set-up was the reason behind not allowing user to use
the same action datablock multiple times.)
Pull Request: https://projects.blender.org/blender/blender/pulls/146182
Ensure that Rigify correctly handles RNA properties as RNA properties.
Before, it mixed dictionary-style and attribute-style access, but
since 7276b2009a that is no longer
possible.
This means that the (un)registration of the RNA properties needs to
happen in two places: the add-on itself, and the code it generates in
the rig. To be able to inject the code into a blend file, Rigify needs
to access it as string. This commit introduces a new way of dealing
with this: it just has normal code, and uses Python's
[`inspect.getsource()`][getsource] to get that code as string for
injection into the rig file.
[getsource]: https://docs.python.org/3/library/inspect.html#inspect.getsource
The biggest chunk of code in this commit deals with the 'Copy
Parameters', 'Copy Type & Parameters', and 'Mirror Type & Parameters'
operators. Since it's no longer possible to access RNA properties as
dict-like custom properties, new code was written to recursively copy
`bpy.types.PropertyGroup` instances. Eventually this may end up in
Blender itself, but that would mean writing more thorough checks and
making sure it works in many cases. And it might be easier to
implement this on the C++ side, where it should just be a matter of
exposing one `IDP_CopyPropertyContent()` call to the Python API.
That's all for another Blender release, though -- for now this'll have
to do to fix up Rigify for 5.0.
Fixes: #146675
Pull Request: https://projects.blender.org/blender/blender/pulls/147199
The "Add Reroutes" operator does not ignore virtual sockets when creating reroutes.
This has the unintended side effect of creating new sockets when attempting to link with said sockets.
This patch adds a check that explicitly skips over them.
Pull Request: https://projects.blender.org/blender/blender/pulls/147306
Move the Copy Global Transform core add-on into Blender's code.
- The entire extension was one Python file. This PR basically splits
it into two, one for operators (in `bl_operators`) and the other for
UI panels. Those panels are registered in the 3D viewport's sidebar,
which were registered in `space_view3d`, but I made the decision
here to create a new file `space_view3d_sidebar`, because the main
file is getting too large and difficult to navigate. This PR puts
the global transform panel in this file. After this is merged, I
will do refactors to move the rest of the sidebar panels here as
well.
- `AutoKeying` class was moved into `bpy_extras/anim_utils.py` so that
it's reusable and also accessible from API, since it's generally
very useful. There were discussions about putting this somewhere,
but for now, I chose against it because creating a new file would
also mean PR would have to affect documentation generation, and
would complicate things. If we want to, we can probably create a new
module in the future.
- Little tweaks to labels and descriptions. Now that they exist
outside of the add-on context, and exist without the user explicitly
enabling them, they need to be more descriptive and tell users what
they actually do. They also need to conform to Blender's GUI
guidelines. Also tried organizing files a little by grouping
objects.
- Add-on properties (which included word `addon` in the name) have
been registered in C++, on `scene.tool_settings` with `anim_`
prefix.
Pull Request: https://projects.blender.org/blender/blender/pulls/145414
## Fix: Error in Node Wrangler UI when in Sequencer mode
Node Wrangler tried to find the current scene compositing node tree,
even when there was none. This could happen if working on a sequencer
compositing modifier.
This commit hides the Save This Image button when not in Scene
compositing mode.
## Fix: Error in Node Wrangler's Save Image op when file path is empty
If the file path is empty in Save Image operator, it returns `None`
and errors out.
This commit makes it return `{'CANCELLED'}` early in that case.
## Add webp to list of file formats for Save Viewer
## Fix: Error when Viewer Node image renamed and saved
The "Viewer Node" image that contains the current compositing node
tree's viewer data has a hardcoded name by default. However it can be
renamed by the user, which will make the Save Viewer operator fail.
This commit extracts a utility function to get the current viewer
image based on its properties, and simply saves that.
In addition, this avoids having to change the area type to an image
editor to get the current viewer node, and restoring the node editor
afterwards. This action did not restore the current node tree if the
editor was inside a node group.
## Rename "Save This Image" to "Save Viewer Image"
When calling the operator through Menu Search, it is not clear what
"Save This Image" refers to. This commit renames the operator to "Save
Viewer Image", but keeps the old name for the button label.
Pull Request: https://projects.blender.org/blender/blender/pulls/147085
Minimal changes to make Rigify use the current Action API (introduced in
Blender 4.4) instead of the legacy API (removed in 5.0).
Most of the refactoring consists of:
- Find the right `Channelbag`
- Replace operations on `Action` with operations on that `Channelbag`.
I didn't manage to test all code, because some code paths are very hard
to follow, and others seem to only be available for legacy rigs.
This is part of #146586
Pull Request: https://projects.blender.org/blender/blender/pulls/147060
Use the current Action API (i.e. move away from the to-be-deleted-in-5.0
one) to import and export F-Curves from/to FBX files.
There is a slight difference in functionality for the exporter, in the
selection of which Actions to export for the "All Actions" option. This
is just a minimal change to ensure the legacy API is no longer used.
Old: `action.fcurves` was iterated, and if all FCurves could resolve to
existing properties, the Action was exported. This would only work
reliably for single-slotted Actions, due to the use of the deprecated
`action.fcurves` property.
New: the above check is done for each Channelbag in the Action. The
first Channelbag that match the above check is exported. This does _not_
export all suitable channelbags; it merely improves on the old behaviour
slightly.
This is part of #146586
Pull Request: https://projects.blender.org/blender/blender/pulls/146980
Includes the following changes to the existing Locomotion system for VR Scene Inspection:
* new VR Navigation Preferences and VR Session Settings
* changes to XR raycast logic and its visualization
* new XR vignette that appears when moving
* snap turning
Pull Request: https://projects.blender.org/blender/blender/pulls/144241
The motivation is to keep backward compatibility after deprecating
`material.use_nodes()` and `world.use_nodes`. For example the
following script would behave the same way in 4.5 and 5.0:
```python
mat = bpy.data.materials.new("My new mat")
mat.use_nodes = True
```
Pull Request: https://projects.blender.org/blender/blender/pulls/147052
Remove the operators to convert a legacy pose library (from Blender 2.93
and older) to the current system (introduced in Blender 3.0).
The removal is mostly because the pose markers do not play well with
slotted Actions. The conversion code was never updated for those, and by
now it's easier to remove them than to update the code to the current
data model.
Technically it was still possible to create a legacy pose library (an
Action with pose markers) in current versions of Blender, and then use
this operator to convert that to a modern pose library. I don't know of
anybody doing that, though.
This is part of #146586
Pull Request: https://projects.blender.org/blender/blender/pulls/147061
Use the current Action API (i.e. move away from the to-be-deleted-in-5.0
one) to import and export F-Curves from/to FBX files.
There is a slight difference in functionality for the exporter, in the
selection of which Actions to export for the "All Actions" option. This
is just a minimal change to ensure the legacy API is no longer used.
Old: `action.fcurves` was iterated, and if all FCurves could resolve to
existing properties, the Action was exported. This would only work
reliably for single-slotted Actions, due to the use of the deprecated
`action.fcurves` property.
New: the above check is done for each Channelbag in the Action. The
first Channelbag that match the above check is exported. This does _not_
export all suitable channelbags; it merely improves on the old behaviour
slightly. The new, C++-based FBX exporter is more feature-complete in
this regard.
This is part of #146586
Node wrangler has a "delete unused nodes" operator that will delete
nodes that do not contribute to the output of the node network.
Warning nodes, don't contribute to the output of the geometry nodes,
but it does output information to the Geometry nodes UI. So warning
nodes should still be considered nodes that contribute to the output.
This commit adds warning nodes to the list of nodes that contribute
to the output to avoid them being deleted by the "delete unused nodes"
operator.
Pull Request: https://projects.blender.org/blender/blender/pulls/146558
The Node Wrangler addon has a _Reset Nodes_ operator that can remove the input
node of a node zone. This crashes in reference set updates because the code
expects valid input/output node pairs in each zone.
The fix is two-fold:
1. Finding zones for the runtime now returns an empty result to ensure no
invalid node pointers are being accessed. This should not happen in practice,
all operators should make sure zone relationships are not broken.
2. The node wrangler addon is updated to ignore all zone types, including the
newer repeat, closure, and for-each-element zones. The type filtering was
outdated and now uses the `bl_idname` consistently.
Pull Request: https://projects.blender.org/blender/blender/pulls/147028
This commit fixes a issue where the node wrangler addon would connect
bump mapping textures to the filter width input of the bump node,
instead of the height input.
Pull Request: https://projects.blender.org/blender/blender/pulls/146684
use_nodes is now deprecated in Blender 5.0
- Remove check checks
- Remove all nodes before creating the node tree is no more needed : these nodes are no more created at material creation
In very old OpenEXR version there was a limit on the channel names, which meant
the pass names needed to be short like "DiffDir". Change them to be longer like
"Diffuse Direct".
* This breaks forward compatibility. Old Blender version will lose links when
reading compositing node setups with such passes, but #146571 will fix it
for 4.5 LTS.
* Add-ons, scripts and compositing setups in other applications that rely on these
names will also break.
* The find_by_type function for render passes has also been removed, as this was
already deprecated and replaced by find_by_name.
* We assume spaces in the name are ok, since we have passes with them already
and have not seen reports about compatibility issues.
Pull Request: https://projects.blender.org/blender/blender/pulls/142731
Implement a native method to swap between different node and zone types.
This implementation repurposes the existing menu definitions as base
classes, from which both an "Add" and a "Swap" version would be generated
from. This allows both menus to have the same layout, but use their own
operators for handling the different node/zone types.
In this PR, support for all node editors has been implemented.
Invoking the menu is currently bound to `Shift + S`, same as the old
implementation in Node Wrangler. Since "Swap" is implemented as a
regular menu, features that menus already have such as type-to-search
and adding to Quick Favorites don't require any extra caveats to
consider.
Resolves#133452
Pull Request: https://projects.blender.org/blender/blender/pulls/143997
Running Node Wrangler's Merge Nodes operator on only one node
resulted in an error. It was introduced in commit db39daf9e7.
That commit assumed that `l[len(l)-2]` and `l[-2]` were the same, but
they are not when `len(l) == 1`. In that case, the former is valid but
the latter is not.
This commit fixes the error by checking how many nodes are selected.
Pull Request: https://projects.blender.org/blender/blender/pulls/146361
Always name the imported action slot "Slot" when importing BVH and FBX
files, for ease of switching between imported Actions.
Note: this is only adjusting the old Python-based FBX importer.
Previously the slot would be named after the file itself (BVH) or had a
combination of the animated object, the animation "stack", and the
animation "layer" (FBX). This meant that every imported animation would
get another slot name, making Action switching tedious.
Pull Request: https://projects.blender.org/blender/blender/pulls/146601
"Use Nodes" was removed in the compositor to simplify the compositing
workflow. This introduced a slight inconsistency with the Shader Node
Editor.
This PR removes "Use Nodes" for object materials.
For Line Style, no changes are planned (not sure how to preserve
compatibility yet).
This simplifies the state of objects; either they have a material or
they don't.
Backward compatibility:
- If Use Nodes is turned Off, new nodes are added to the node tree to
simulate the same material:
- DNA: Only `use_nodes` is marked deprecated
- Python API:
- `material.use_nodes` is marked deprecated and will be removed in
6.0. Reading it always returns `True` and setting it has no effect.
- `material.diffuse_color`, `material.specular` etc.. Are not used by
EEVEE anymore but are kept because they are used by Workbench.
Forward compatibility:
Always enable 'Use Nodes' when writing blend files.
Known Issues:
Some UI tests are failing on macOS
Pull Request: https://projects.blender.org/blender/blender/pulls/141278
Added support for string sockets in `nw_merge_nodes`, results in
creating "Join Strings" node. Note that the code is slightly different
from most socket types since String Join has a multi-input socket,
but the behaviour is pretty much identical to Geometry sockets with
Join Geometry.
Pull Request: https://projects.blender.org/blender/blender/pulls/145507
Replace the icons for the "From Socket" and "To Socket" pop-up menus from
`RADIOBUT_OFF` and `FORWARD`, to each socket type's corresponding icon.
This makes it easier to pick out sockets in longer lists, as they could now be
distinguished by their color.
Video and images in PR
Pull Request: https://projects.blender.org/blender/blender/pulls/145648
Add the `SKIP_SAVE` option to the 'Paste Global Transform' operator
properties.
This fixes a bug with following repro steps:
- Specify a relative object
- Use relative copy/paste
- Try to use non-relative copy/paste
- It will fail because after you used the relative paste operator, the
`use_relative` property is saved for ever as True.
Pull Request: https://projects.blender.org/blender/blender/pulls/145262
The pose library registered a double-click keymap item for the file
browser keymap, because that was the only way to add keymap items to the
asset browser (which is just the file browser under the hood). Since
450f428434, the pose library apply & blend operators are available in
more contexts, since their check for an active asset was moved from the
operator poll to the operator execution. So the pose apply operator
would end up triggering.
The poll function could be adjusted somehow to return false in this
case, e.g. by checking if it's executed from a file browser (not an
asset browser).
However, the operator should be independent of where it's called from.
So instead this registers a separate keymap for the asset browser, so
the pose library operators can be registered exclusively for the asset
browser.
When using `Lazy Connect`, the operator currently also considers sockets that are hidden.
This causes unintentional socket connections and requires to use the operator with the
menus for manually picking sockets which is slower and defeats the purpose.
Videos in PR.
This PR fixes that by not considering the hidden sockets.
Pull Request: https://projects.blender.org/blender/blender/pulls/145316
This was quite involved to get to work. Basic idea is to make
`bl_activate_operator` work for the pose library asset shelf, and
introducing a `bl_drag_operator` for blending poses.
- Make pose asset operators take an asset reference, which is how
`bl_activate_operator` usually gets the asset to operate on. This way
poses references can be assigned to a shortcut, identified by asset
library and relative asset path within the library. Falls back to
getting the asset from context.
- Trigger `bl_activate_operator` on every click, instead of only when
an un-active item becomes active. Needed so poses can be re-applied
as before.
- Fix button context not passed to the `bl_activate_operator` when
force-activating, e.g. on right-click events.
- Allow registering a `bl_drag_operator` in the asset shelf definition.
Executed when dragging an asset in the shelf.
- When dragging an asset, highlight it as active, without calling the
`bl_activate_operator`. This is important feedback to the user.
- Activate/select view items on click instead of drag, so dragging is
possible.
- Let pose applying operators handle the Ctrl key to apply poses
flipped. There's no simple way to attach such alternative behaviors
to `bl_activate_operator`/`bl_drag_operator`
- Remove keymap items that were there for the previous "hacky" solution
to apply & blend poses.
Pull Request: https://projects.blender.org/blender/blender/pulls/144023
Since the tangent attributes are now recomputed inside the loop over uv
layers, looping directly over this mesh data is dangerous, as computing
the tangents attributes might trigger some re-allocations, leading to
invalid memory accesses when accessing the next uv layer.
Solved by caching uv layers' names in a list beforehand, the uvlayers
themselves are not even needed for tangent data handling.
Regression from e0a9e98cbd.