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
The changes:
1. Add `group_name` to the `channelbag.fcurves.new()` and
`action.fcurve_ensure_for_datablock()` RNA functions.
2. Add `anim_utils.action_ensure_channelbag_for_slot(action, slot)`.
3. Add `channelbag.fcurves.ensure()` RNA function.
This makes it possible to replace this legacy code:
```py
fcurve = action.fcurves.new("location", index=2, action_group="Name")
```
with this code:
```py
channelbag = action_ensure_channelbag_for_slot(action, action_slot)
fcurve = channelbag.fcurves.new("location", index=2, group_name="Name")
```
or replace this legacy code:
```py
fcurve = action.fcurves.find("location", index=2, action_group="Name")
if not fcurve:
fcurve = action.fcurves.new("location", index=2, action_group="Name")
```
with this code:
```py
channelbag = action_ensure_channelbag_for_slot(action, action_slot)
fcurve = channelbag.fcurves.ensure("location", index=2, group_name="Name")
```
Note that the parameter name is different (`action_group` became
`group_name`). This clarifies that this is the name of the group, and
not a reference to the group itself.
This is part of #146586
Pull Request: https://projects.blender.org/blender/blender/pulls/146977
The issue was that the used operator just took the active node into account.
However, clicking in empty space does not make the active node inactive.
Therefore, sometimes clicking on empty space would sometimes remove enter the
last selected group node. Furthermore, double clicking on other nodes may also
trigger exiting the current group.
This is fixed by introducing a new operator that explicitly checks what node is
hovered.
Pull Request: https://projects.blender.org/blender/blender/pulls/147053
Currently, the compositor template ID creates a new node tree. This is
inconsistent with other node editors where the button copies the node
tree.
Also use "New" in geometry nodes operator description instead of "Copy"
Pull Request: https://projects.blender.org/blender/blender/pulls/146222
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
Fix: correctly update Actions when renaming/re-typing a custom property
When renaming a custom property on a data-block, only update the
animation in a slot for that data-block. Previously all F-Curves were
updated, even when they were meant for other data-blocks.
This also handles the cases where the type of a custom property is
changed, and not just its name.
This is part of #146586
Pull Request: https://projects.blender.org/blender/blender/pulls/146979
Toggles the new `show_presets` option on for the recently added brush
size, strength, and jitter curves across paint modes to allow users
to set these custom curves to any of the defined internal presets.
Pull Request: https://projects.blender.org/blender/blender/pulls/147000
To support setting the custom `CurveMapping` to a well defined preset,
there exist a number of operators that are hardcoded to apply a
particular preset to a particular curve.
This commit begins to replace this functionality and make it part of the
template itself, allowing the preset to be applied to any curve. For
now, it only supports either positive or negative slopes, primarily for
the brush usecases.
The `brush.curve_preset` and `brush.sculpt_curves_falloff_preset`
operators are unneeded after this change and have been removed.
Notably, these preset controls have not been added elsewhere, they can
be added on a case by case basis in future commits by interested
modules.
Pull Request: https://projects.blender.org/blender/blender/pulls/146847
This adds three corner types: `Round` `Sharp` and `Flat`.
These control how the corner of `Grease Pencil` line strokes are rendered.
- The `Round` type draws circular arcs, and is what `Grease Pencil`
currently supports and is default.
- The `Flat` type cuts off the tip of the corner.
- The `Sharp` type allows for sharp corners to be created.
If the angle is sharper than `Miter Limit` then the tip will be cut like `Flat`
These three types match the main types of `line joins` present in `SVG`
files.
This data is stored in one `Point` attribute called `miter_angle`.
This stores both the `Corner Type`, the `Miter Limit` and defaults to
the `Round` type.
This PR adds:
- Rendering of the corner types.
- An operator for setting the `Corner Type` and `Miter Angle` attribute.
- Corner types to the `Outline` operator and modifier.
Part of #145380.
Pull Request: https://projects.blender.org/blender/blender/pulls/143688
This implements the Menu Switch node in shader nodes. It's the same node that is
used in Geometry Nodes and the Compositor.
The Menu Switch node is purely handled during preprocessing and thus builds on
top of #141936. Hence, it's input has to be a single value, just like the
iteration count for repeat zones. This limitation can be lifted in the future,
but currently there is no way to produce a non-single menu value in shader
nodes. This will become possible if other Switch nodes are added though.
Pull Request: https://projects.blender.org/blender/blender/pulls/146896
Since 1122a05cb6 tool settings could return None, but we do not check this
consistently in scripts. Now always return some tool settings, since it's difficult
to verify and easy to forget proper null checks in e.g. operator poll functions.
The sequencer UI code was updated to continue showing tool settings only when
there is a sequencer scene.
Co-authored-by: Sergey Sharybin <sergey@blender.org>
Pull Request: https://projects.blender.org/blender/blender/pulls/146166
Hardocde the position of the essentials assets in the menu,
for consistent alphabetical order and a clearer indication of
the different between the nodes and builtin "Array" modifiers
(the old one is now called "Array (Legacy)").
Pull Request: https://projects.blender.org/blender/blender/pulls/146887
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
This adds a new operator which can join multiple nodes together. Currently, it
only supports joining Group Input nodes. However, in the future it could be
extended to join e.g. Bake and Capture Attribute nodes.
This uses the recently freed up ctrl+J shortcut for this functionality, which
feels natural to me.
The implementation is fairly straight forward. The main tricky aspect is
sometimes the nodes can't be joined when that would result in two sockets being
linked to each other twice. In this case, the a separate Group Input node is
kept.
The selected nodes are merged into the active node (in case the active node is
part of the selection, otherwise there is a fallback).
Pull Request: https://projects.blender.org/blender/blender/pulls/146894
In 3D Viewport theme settings there is "Active Spline" property, which behaves weirdly.
Color of that property is multiplied to color of curve handles. Even though it says active,
it's multiplied in selected and unselected states, for all curves all the time.
That doesn't make much sense, has no real value, and ends up only causing confusion.
Having this property on anything but pure black means that whatever colors you choose
for curve handles in Preferences isn't actually what you're getting them. If color is set to
high-saturation color it completely washes away all colors and makes it difficult to differentiate
between handle types.
I think there is no reason for this property to exist, so this PR just removes that property.
Pull Request: https://projects.blender.org/blender/blender/pulls/145360
This new translation context is for some special cases when
translation cannot be avoided, for example in an interface where some
props are built-in (translatable) and others are
user-defined (non-translatable), but we don't know which ones in
advance.
It allows specifying explicitly that translation should not occur
for user data when building the UI.
It is a followup to !145963, in which the context was introduced as a
string literal instead of a defined context.
Node sockets could already be declared using:
```cpp
add_input<decl::<SOCKET TYPE>>("NAME")
```
They can now additionally be declared with:
```cpp
add_input(socket_type, "NAME")
```
This commit adds the later form to the message extraction regex. Since
they are mutually exclusive, they are now in a non-capturing group
with an | operator.
Reported by Ye Gui in #43295.
This extracts the names and descriptions for displays, views, and
colorspaces. They are all used in the different parts of the UI.
The views' descriptions are used for the displays'.
The extraction uses the built-in PyOpenColorIO module. This ensures
only data that is actually used is extracted (not ignored in the
config).
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
Implements #146360
Update VFX template with minimum changes:
- Replace Timeline with DopeSheet footer.
- Save (with compression). 525kb → 92kb
All changes were done on a release build at 1920x1080, without a
preferences folder.
See PR for details and screenshtos.
Pull Request: https://projects.blender.org/blender/blender/pulls/146851
When trying to find and open an older file, it is annoying when it is not in the
recent files list anymore. This patch increases the length of the recent files
list, without making the menu huge by making better use of menu-search.
Specifically the following is changed: * Number of remembered recent files is
increased from 20 to 200 by default. * The recent files menu is limited to 20
entries. * When activating menu search (by pressing space when in the menu), all
available recent files can be searched. * There is a new "More..." menu entry at
the bottom, which also activates the menu search.
Pull Request: https://projects.blender.org/blender/blender/pulls/146884
Calling the swap operators can result in Blender crashing. From my
testing, the behavior is inconsistent, as sometimes a crash is triggered
and other times it isn't. Though notably, they seem involve nodes
already linked to other nodes, or zones.
The crashing stems from the operators trying to access deleted data.
There were two places where this happens that were identified, one
involving removed links and the other involving removed nodes.
Pull Request: https://projects.blender.org/blender/blender/pulls/146909
The Mix node has multiple subtypes for handling different data types. (Float, Color, Vector, etc.)
Since these are commonly used operations, the different subtypes are made easily accessible
under the names "Mix Color" & "Mix Vector". These are mostly present in the various node
editors. (Shader, Geometry, & Compositing)
Notably, for Shader Nodes, however, only the "Mix Color" entry is present in the Add Menu.
This patch adds the missing "Mix Vector" entry under the "Vector" category of the
Shader Editor Add Menu.
Pull Request: https://projects.blender.org/blender/blender/pulls/142886
This patch exposes the "Rotation" subtype of the Mix node in the Geometry Node Add Menu.
This is in a similar vein to "Mix Color" & "Mix Vector", as it makes this subtype more easily
accessible and searchable in the menu.
Pull Request: https://projects.blender.org/blender/blender/pulls/142887
This node outputs tangent values for face corners. There are two methods:
- **Exact** is the same MikkTSpace calculation used elsewhere in Blender.
- **Fast** (from #131308) is over 4x faster, and useful in many of
the same situations, though not necessarily tangential to the surface.
The reason to include both methods is that there are use cases where the
quality of the tangents don't matter (though the results are actually very
similar visually), we just need some continuous values across faces.
Pull Request: https://projects.blender.org/blender/blender/pulls/145813
Currently cameras composition guide colors are defined in theme, and not even by an individual
property. They follow 3D Viewport -> View Overlay color, which also defines many other things,
such as world origin cursor. By default it's black and it's difficult to change, because then other
things stand out. But using default black for composition guides is impossible.
This PR, instead, adds new Composition Guide Color property on camera, and uses it in camera view.
This not only fixes the issue mentioned above, but also allows different cameras in one scene to
have different overlay colors. This is very handy when you have, for example, two cameras, one of
which looks at the black corner, and another at the lit-up white one. Using a single black or white color
in this case makes the other one more difficult to see. Now, each camera can have its own color.
This PR only changes color for Composition Guides, and NOT for Safe Areas and sensor. Reasons are:
- It's important to differentiate between different concepts, having everything one color is distracting
- Safe areas are per-scene and shared with Sequencer preview. The camera shouldn't dictate color there.
I have separate plans about handling safe areas in the future.
Images in the PR.
Pull Request: https://projects.blender.org/blender/blender/pulls/143788
Currently, only the visibility of input sockets can be changed dynamically based
on other menu inputs. However, under some circumstances, it can also be useful
to hide certain outputs. For example, the built-in Curve Arc primitive node does
that.
This patch adds support for automatic detection of unused outputs. How to detect
unused outputs is less straight forward compared to inputs. This patch uses the
rule that an output is unused if it always outputs a "fallback value" (typically
0) irrespective of the currently used inputs. If the output is independent of
all inputs, it stays visible though.
There is a new small utility node called "Enable Output". It replaces a value
with it's fallback value unless it is disabled. This simplifies setting up
unused outputs. In theory, a normal switch node can also be used, but that is
less usable and the user will have to hardcode the fallback value for each type
which is not something that is explicitly exposed yet.
Supporting dynamic output visibility is also a prerequisite for exposing some
menu node options as sockets (e.g. in the Arc node).
Pull Request: https://projects.blender.org/blender/blender/pulls/140856
In Render properties > Color Management > Display.
* Off: Directly output image as produced by OpenColorIO. This is not correct
in general, but may be used when the system configuration and actual display
device is known to match the chosen display.
* Automatic: Display images consistent with most other applications, to preview
images and video for export. A best effort is made to emulate the chosen
display on the actual display device.
The option is grayed out when the current OpenColorIO config and display/view
does not support emulation.
Ref #145022, #144911
Pull Request: https://projects.blender.org/blender/blender/pulls/146808
A subset of brushes behave as "anchored" brushes, in that they do not
apply to the surface continually underneath the cursor, but have a
starting point and then are influenced by the mouse movement. These
brushes behave oddly with tablet pressure sensitivity, as they cannot
modulate over the course of the stroke without causing odd behavior.
Currently, the pressure is only sampled at the very beginning of the
stroke, which makes it difficult to control intuitively. Further work
can be done to improve this behavior (e.g. D6603).
The full list of brush types affected is below:
* Grab
* Snake Hook
* Elastic Deform
* Pose
* Boundary
* Thumb
* Rotate
* Cloth with Grab deformation
Resolves#83697
Pull Request: https://projects.blender.org/blender/blender/pulls/146825
Nodes have many indicators in their header: whether they have a
preview, warnings, whether they are a node group, plus potentially
more such as if the library is linked/overriden or packed data.
Of all indicators, whether the node is a node group or not is often not
so relevant (especially when many nodes will be just node group assets)
so having an icon takes away precious real estate for other indicators.
Draw the node shape slightly different. A subtle "stack" of nodes
behind Node Groups indicate this is more than just one node.
The stack is only drawn at a certain zoom.
It is now possible to double-click a node group to enter.
It also makes some more room for the node label, since the node group
icon in the header is no longer needed.
Plus a few visual tweaks and fixes for broken/non-valid nodes.
See PR for details and screenshots.
Pull Request: https://projects.blender.org/blender/blender/pulls/145674