This makes it so that all the draw mode tools can use
the `Unified Paint Settings`.
Similar to other modes, the toggle for using unified settings is exposed
in the side panel and in the context menu.
Pull Request: https://projects.blender.org/blender/blender/pulls/160195
Three small changes that improve the Replace Action UI:
- Add "..." to the label in the menus, to indicate there will be a
popup.
- If the old or new Action cannot be found, show the Action names
without the `AC` ID type prefix.
- If the old and new Action are the same, show "Cannot replace Action
with itself" instead of the more cryptic "Invalid old/new Action
pair".
Pull Request: https://projects.blender.org/blender/blender/pulls/163959
This adds support for some of the basic edit mode operators
in Draw Mode:
- Circle, Box, and Pick selection tools.
- Copy and Paste operators.
- Delete operator.
- Transform operators.
- Draw mode `Stroke` menu.
Pull Request: https://projects.blender.org/blender/blender/pulls/162890
Note: The `x` and `b` keybind for delete and box select has not be added
because `x` is already used for swapping the brush colors and `b` is
used for box delete.
Co-authored-by: Falk David <falk@blender.org>
Support flipping the camera view.
A new operator `Flip View` is added in `View` > `Navigation`.
Currently, it's mainly designed for Grease Pencil where camera
view is the "canvas".
When the view is flipped it will be displayed in the `General
Info` text.
Also updates Passepartout and Render borders to properly
account for the flip.
Ref !161274
This adds the `UILayout::property_split_factor` property which contains
the split factor used in the layout system, and avoids to use the this
as raw value all over the place.
Pull Request: https://projects.blender.org/blender/blender/pulls/163393
This commit moves the experimental 3D Texture Paint brush implementation
out of Sculpt Mode and into Texture Paint mode.
Instead of overriding the "Paint" brush in Sculpt Mode, it now
corresponds to the "Draw" brush in Texture Paint.
This is achieved by extending the existing `PAINT_OT_image_paint`
operator to use a different `PaintStroke` implementation if a supported
brush is being used with the experimental flag toggled.
Part of #162290
Pull Request: https://projects.blender.org/blender/blender/pulls/163220
Implements basic selection support in Draw Mode. For now, there's not
much users can do with the selection. Following PR's will add operator
support.
* Add selection overlay support. Only show selected edit lines.
* Only support stroke selection.
* Expose lasso selection tool and some operators. E.g. select all/none.
Ref: #161558.
Pull Request: https://projects.blender.org/blender/blender/pulls/161685
The Quad-Sphere is commonly used in sculpting and subdivision modeling.
There are two formulas exposed:
- Even Area: For the best area distribution.
- Even Angle: Useful as the profile forms an exact circle,
useful for joining with other circular shapes (cylinders).
Ref !161684
Co-authored-by: Campbell Barton <campbell@blender.org>
When called, the `Calculate Mass` operator invokes a very long menu
that doesn't fit on screen and is cumbersome to navigate.
This patch replaces that with a search popup, as it's more compact and
allows the user to find the option they want more quickly.
Pull Request: https://projects.blender.org/blender/blender/pulls/163316
The `UnifiedPaintPanel` helper can behave poorly when dealing with
non-brush tools, like the Filter tools reported in the original issue.
To fix the python error, pass in the `UnifiedPaintSettings` explicitly.
Pull Request: https://projects.blender.org/blender/blender/pulls/163117
This PR moves the controls of "Use Unified xxx" (such as Use Unified
Size) from the scene / mode level to the brush level, meaning each brush
can have this option toggled on and off separately. It used to be that
every brush shares the same toggle state.
I moved the `UNIFIED_xxx` flags from `UnifiedPaintSettings` to `Brush`.
Ialso added relevant RNA properties and hooked them up to Python
scripts.
Resolves#138469
Pull Request: https://projects.blender.org/blender/blender/pulls/159382
Resets the camera roll, outside of camera view the global Z-up is used.
Exposed in the view navigation menu.
Ref !162225
Co-authored-by: Campbell Barton <campbell@blender.org>
Instead of Cycles implementing it. This fixes various corner cases that
were not handled correctly by the new auto pause during render feature.
When a RenderEngine implements view_pause and view_resume methods, the
pause button will be drawn in the 3D viewport header, and notify the
engine on changes (in addition to auto pause).
The old Cycles pause property is preserved to avoid breaking scripts,
but it no longer does anything. The only add-on that I could find using
this was auto pausing during baking. That is now implemented as well.
Ref #156536
Pull Request: https://projects.blender.org/blender/blender/pulls/162437
This menu should not have been added. It does not initialize operators
(which is what should be happening in menu layouts), it switches the
active tool.
This is (a) not needed at all, since this is the slowest method of
switching to a tool, and there are other ways, and (b) not supported
by layout. Text isn't aligned, and tooltips don't render correctly for
example. Tool operators are meant to be rendered in Toolbar and they do
not account for this case.
Ideally we would replace them with just operators that start drawing
shapes immediatelly, but this is not possible now, because operators
themselves are made specifically to be used with gizmos and are not
supported otherwise without some changes.
Pull Request: https://projects.blender.org/blender/blender/pulls/161903
This adds code to convert animation from one rotation mode to another.
There are multiple ways to do the conversion:
* Using Ctrl+R in pose mode
* In the 3D viewport, open the "Object" or "Pose" menu, under
"Animation" there is a new entry "Convert Rotation Mode"
* Using the python API `convert_rotation_mode()` either on bones or
objects
**Important Behavior**
* The result of the operation is always a fully keyed rotation, even
if previously only a single channel was keyed. This is the only way
to ensure that the rotations line up.
* Interpolation may not match. In fact it is expected not to.
This is desired for animators for when they are running into gimbal
lock and they just want to try if a different rotation mode works better.
* In case interpolation *has to* match, there is an option to insert
keys on every frame before the conversion.
* key types are somewhat preserved. We assume that for any given
frame, all rotation keys are the same type.
* keys on all related actions are converted, that includes the NLA
Even though the animation data conversion could be triggered
automatically by changes to the rotation_mode RNA property, I chose not
to do that for a reason.
This may be set directly via python in an addon and we shouldn't
include the costly (and maybe unexpected) side effect of converting
animation.
This adds a new operator `anim.rotation_mode_convert` instead of
modifying the existing `pose.rotation_mode_set`.
Since the operator now works with objects as well, it's probably better
to move it out of the `pose` category.
`pose.rotation_mode_set` and `pose.convert_rotation` from rigify are
deprecated with a warning that pops up every time you execute them.
**Implementation**
The core of the changes are in `anim_convert.cc`.
* `convert_to_rotation_mode` is a high level function that converts
the rotation for a single transformable.
* `build_rotation_fcurve_map` and `convert_rotation_keys` are two
functions that work in concert. The first builds the data structure
to quickly find FCurves by their RNA path and the second consumes
that data to do the conversion.
* `bake_rotation_fcurves` utility function to bake FCurves before
converting their rotation.
This uses the `AnimTransformable` class to make this functionality
available to objects and bones at the same time.
When dealing with multiple transformables, we would need to iterate
the action for each to find the FCurves for it.
To avoid that I added `ChannelbagFCurveMap` which is created by
`build_rotation_fcurve_map`.
With that we can easily iterate iterate the FCurves of each Channelbag
sorted by RNA path.
`KeyframeIterator`
Is a new helper class to iterate all frames with keys of N FCurves.
**Deprecates** the existing `POSE_OT_convert_rotation` operator and
removes it from the pose menu.
Resolves#149607Resolves#159131
Design: #137281
UI improvements will be handled in a separate PR: !159981
Pull Request: https://projects.blender.org/blender/blender/pulls/154309
New Cut brush for Curves sculpt mode.
- Supports spherical and projected falloff shape
- Respects selection of points
- Moves the "last" point to the exact location that the brush has cut
the curve, using a sphere-line-segment or circle-line-segment
intersection
- Strength of brush is used as a "chance to omit a curve" (similar to
how particle edit mode does it)
Resolves#96450
Pull Request: https://projects.blender.org/blender/blender/pulls/131755
Add a new operator `Replace with duplicate Action`.
Similar to `Replace with new Action` this looks at the action
of the active object and replaces all users of that action with
a duplicate.
Pull Request: https://projects.blender.org/blender/blender/pulls/158258
This commit adds support for brush and scene level automasking into
Vertex and Weight Paint mode. The following options are supported:
* Topology
* Mesh Boundary
* Cavity & Inverted Cavity
* View Normal
* Area Normal
Face set automasking is not supported, as face sets do not currently
display in either mode. Additionally, none of the operators that create
dedicated masks are available, as masks are not displayed in either mode
as well.
The pie menu is also exposed for easy access to these properties via
`Alt-A`
Part of #156409
Pull Request: https://projects.blender.org/blender/blender/pulls/158071
This is due to an operator context mismatch between the keymap and the
UI item. Dissolve Bones is added under `EXEC_AREA` in
`VIEW3D_MT_edit_armature_delete.draw()`
Part of #159616
See PR description for images
Pull Request: https://projects.blender.org/blender/blender/pulls/160763
Instead of reusing `ERROR` for both warnings and errors, and the Info
Editor icon for "info" label comments, use the new icons from !161002.
* Use `STATUS_WARNING` when the code refers to simple warnings, the
feature might still work.
* Use `STATUS_ERROR` when the code refers to incompatibility, broken
functionality, general errors.
* Use `STATUS_INFO` for every info label. Keep `INFO` for the editor.
* Sometimes `WARNING_LARGE` was used, that should only be used for
dialogs. Use the regular warning instead, it looks almost the same.
* When extra contrast is needed, the filled version is used.
Mostly no big visual changes, other than warnings that were meant as
actual errors using the proper icon now.
See !161038 for details and screenshots.
Pull Request: https://projects.blender.org/blender/blender/pulls/161038
Exposes the "Align to Transform Orientation" operator for armature
pose mode. Edit mode has some additional quirks, which is why it is
currently not exposed there.
This commit also renames existing `Align Bones` operator to better
clarify what it aligns to (to avoid confusion between two "Align"
operators.
Pull Request: https://projects.blender.org/blender/blender/pulls/159749
The pose slide operators only make sense when running with
"invoke". However when assigning a hotkey to the menu, they
would be run in an "exec" context.
The fix is to override the operator context for the menu operators.
Pull Request: https://projects.blender.org/blender/blender/pulls/160477
The existing `UnifiedPaintPanel.paint_settings` helper function is
commonly used, but has some nuance to the usage that is non-obvious from
the naming. Because it does filtering both on the space type and the
tool system information, there may be cases where it returns `None`
where we otherwise know the correct `Paint` struct to be used.
This commit renames the primary usage to
`paint_settings_from_active_tool` and adds a new overload,
`paint_settings_from_mode`, which can be primarily used in the context
of methods drawing information about specific modes, rather than general
functionality.
Pull Request: https://projects.blender.org/blender/blender/pulls/159826
78b81795c2 moved some operators from base menu class to
`VIEW3D_MT_transform`. Armature object type had it's own panel and
didn't follow the general one, this results in "Warp" and "Randomize"
operators being missing from transform menu in armature edit mode.
To fix this, add those entries in Armature menu.
Also fixed an incorrect separator placement.
Bug and fix detected by LLM weekly report
Pull Request: https://projects.blender.org/blender/blender/pulls/159807
This PR makes a number of changes to the bundled essential brush assets
for Weight Paint, along with a number of other mode / default changes
to improve the experience for beginners.
### Brush Changes
* The default brush is now the "Add Weight" brush, which uses the "Add"
blend mode, accumulation, and a low strength.
* The existing "Paint" brush is renamed to "Set Weight" and now has a
Constant falloff curve. This brush also has a new icon to distinguish
it from the "Add Weight" brush.
* The "Blur" brush has been changed to use accumulation with a low
strength.
* For all brushes, the stroke spacing has been changed to 5% to feel
more responsive.
* For all brushes which formerly used a Custom falloff curve that
approximated a smoothstep function, the built-in "Smooth" curve is
now used.
### Mode Changes
* Multi-Paint defaults to enabled
* Auto-Normalize defaults to enabled
* Mirror Vertex Groups defaults to enabled
Along with the above, the asset shelf is now shown by default in Weight
Paint mode, as there are now more brushes than tools in the toolbar.
Only the default startup files will use these new options, for existing
files, if the old "Paint" brush was active, the new "Add Weight" brush
will be active upon loading.
See #149470 for further context.
Asset PR: blender/blender-assets!67
Pull Request: https://projects.blender.org/blender/blender/pulls/158671
"Transform" menu appears in Object Mode and edit modes, and there are
operators that work in both, and operators that work only in Object
mode, or only in edit modes.
Previously, those operators were mixed, and because of that, navigation
was more difficult. From users POV this was perceived as items jumping
around based on mode.
To avoid this create a clear separation. Have shared operators always
grouped at the top, followed by a separation and mode-specific
operators. This way item order stays the same always.
Images in the PR.
Pull Request: https://projects.blender.org/blender/blender/pulls/159331
Linking an Object to another Scene was only possible
from "3D Viewport → Object → Link/Transfer Data" menu.
This PR adds the operator in objects context menu in Outliner as well.
Additionally, an incorrect error message of the operator is also
updated.
Pull Request: https://projects.blender.org/blender/blender/pulls/159007
This fixes a few warnings on startup due linked to template_palette
being called with too many argument. This trailing named argument was
removed in commit 79a60b4816 due to it not being used in logic (also
added to 5.2 release notes PyAPI changes).
Adds a new builtin operator called "space edge loops evenly" ported from
the looptools addon that spaces selected vertices evenly across a
connected chain of edges.
Pull Request: https://projects.blender.org/blender/blender/pulls/154933
This implements an operator that duplicates edit bones
and does a search replace at the same time.
Crucially, the search replace is done before name collisions
are checked so this avoids a potential rename to append `.001` by
blender.
When the "replace" is left empty, the "search" is just removed.
The search and replace has no fancy regex logic built in.
When called, the operator pops up a GUI
On a technical level this is very much identical to the existing
`ARMATURE_OT_duplicate` but I had to create a separate
operator that has an invoke function for the menu. Otherwise the menu
pops up every time you press `shift+D`.
I refactored out a separate function to avoid code duplication
Pull Request: https://projects.blender.org/blender/blender/pulls/154553