Rename modules in `./scripts/modules/` to use an underscore prefix to
make it clear they aren't intended to be part of public API's. This
also means there is no implication that these modules should be stable,
allowing us to change them based on Blender's internal usage.
The following modules have been marked as private:
- `animsys_refactor`
- `bl_console_utils`
- `bl_i18n_utils`
- `bl_previews_utils`
- `bl_rna_utils`
- `bl_text_utils`
- `bl_ui_utils`
- `bpy_restrict_state`
- `console_python`
- `console_shell`
- `graphviz_export`
- `keyingsets_utils`
- `rna_info`
- `rna_manual_reference`
- `rna_xml`
Note that we could further re-arrange these modules
(under `_bpy_internal` in some cases), this change is mainly to mark
them as private, further changes can be handed on a case-by-case basis.
Ref !147773
The Grease Pencil operator for changing the Opacity of selected strokes
was missing from the transform menu, which is the where the `Radius`
operator lives.
This prevented the operator from being searched.
4.5 backport candidate.
Pull Request: https://projects.blender.org/blender/blender/pulls/147672
Increase width in some popovers where labels would get trimmed.
This was even worst for other languages, but at least now labels don't
get ellipsis by default (English at 1.0 UI scale).
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
The keymap `km_image_paint` righfully includes both
`VIEW3D_AST_brush_texture_paint` and `IMAGE_AST_brush_paint` since
painting can be done in both Editors.
So we want to improve upon polling.
Three parent classes involved: `ImageAssetShelf`, `View3DAssetShelf`,
both inherit from `BrushAssetShelf`
`IMAGE_AST_brush_paint` (inherits from `ImageAssetShelf`) was already
checking for being in paint mode (so that Asset Shelf already wasnt
showing), but `VIEW3D_AST_brush_texture_paint` (inherits from
`View3DAssetShelf`) was permissive (doesnt have specialized poll, relies
on the "mother" classes `BrushAssetShelf` which only checks for an
active object and if that active objects `mode` equals the Assets Shelfs
"mode"). This can be true if you have an object in Texture Paint mode in
the 3DView.
So to make shelves like `VIEW3D_AST_brush_texture_paint` **not** pass
their poll in the Image Editor, add a specific poll case.
NOTE: the report also mentiones a crash when actually selecting a "bad"
brush from the "bad" asset shelf. Since that scenario is now impossible
to reach, the crash has not been investigated further.
Pull Request: https://projects.blender.org/blender/blender/pulls/146071
Support adding lattices to selected objects,
deforming them with with the lattice modifier.
By default the lattice fits to the object bounds and is oriented
to the active object (if it's set).
Resolves#144076
Ref !144888
Move 3D Viewport and Sequencer OpenGL render operators into a
"Render Preview" sub-menu.
The goal is to make the operation more clear, and being able to add
new entries to render the active scene or Sequencer scene (handy when
using the new "Sync Scene").
This also reduces the length of the `View` menu which in some cases
can get quite long.
See PR for details and screenshots.
Resolves#146302
Pull Request: https://projects.blender.org/blender/blender/pulls/146316
Introduced in f4e670af2c
The `use_negative_slope` parameter was effectively ignored when `brush`
was also passed in as a parameter, always defaulting to a positive
slope (ascending from left to right).
Additionally, the `use_negative_slope` property was incorrectly
specified for many properties: In general, most brush properties have
positive slope as they correspond to a pressure value being modulated.
This commit fixes the behavior and updates the corresponding
properties so they continue to work.
Pull Request: https://projects.blender.org/blender/blender/pulls/145823
A number of panels referred to the `.greasepencil_paint` and
`.greasepencil_sculpt` context members, each of which only correspond to
the legacy tooling. This commit removes such panels and their helper
classes.
Pull Request: https://projects.blender.org/blender/blender/pulls/145708
This commit changes the internal storage and user-facing representation
of the brush size values (`size` and `unprojected_size`) from radius
to diameter.
This has a number of benefits:
* While the radius is more helpful for many internal operations, it is
more natural to estimate the size of a brush by the diameter
* Because the pixel size is stored as an integer, users are currently
unable to make brushes that have an odd numbered diameter, notably
preventing the ability to make single pixel brushes.
Internally, the `Brush` and `UnifiedPaintSettings` size values are
versioned to double their on-disk values. The relevant `BKE` functions
that access the data return the radius at runtime, and any internal
`struct`s that stored radius continue to do so.
The 'Radius' text for brushes is changed to 'Size' and all references
to it in descriptions are changed to 'size' as well.
Resolves#134204
Pull Request: https://projects.blender.org/blender/blender/pulls/142495
Edge and Vertex marks such as Crease, Bevel Weight, Seam, Sharp, have
specific use cases and colors assigned to them that users get familiar
with over time.
It can be hard to remember which color belong to what, this PR tries to
address this by introducing colored icons that follow the theme setting
for that edge mark/flag.
See PR for details and screenshots.
Pull Request: https://projects.blender.org/blender/blender/pulls/144075
This makes it so that Grease Pencil Bezier handles use the same colors and shaders as `Curves` Objects.
This also makes the handles follow `handle_display` and add the option the the edit mode overlay.
Pull Request: https://projects.blender.org/blender/blender/pulls/141524
This adds "use_occlude_geometry=True" and "only_selected=False" to the
keymap entry for K, mesh.knife_tool, even though these are the default
values for this operator. This fixes the complaint. And these same
props are set for "Knife Topology Tool" on the VIEW3D_MT_edit_mesh
menu so that it displays the shortcut correctly (#139393 remains
corrected).
Pull Request: https://projects.blender.org/blender/blender/pulls/143673
This replaces the Move/Link to Collection operator popup with a menu,
allowing this to be able to search collection to move and to expand
this menu from other menus.
This removes the expected memory leak of using the popup.
Move to Collection operator now uses `session_uid` to identify
target collection, this now allows to target a collection from another
scene, however, is not exposed throw UI)
Resolves#133772
Pull Request: https://projects.blender.org/blender/blender/pulls/140883
"Mirror" can mean:
- To symmetrize something (i.e. generate a new mirrored copy of it or
edit it in a symmetric fashion).
- To flip something (i.e. invert its values along X, Y or Z axes).
- To repeat a texture in a mirrored fashion outside its bounds.
Reported by Gabriel Gazzán in #43295.
Historically, the `UnifiedPaintSettings` struct has been used to
provide users the ability to set brush values at a scene level. Examples
of such attributes are the brush size, strength, and color, to name a
few.
Instead of these values being shared across all of the grease pencil,
mesh painting, and curves sculpting modes. This commit migrates the
data to the `Paint` struct, meaning that each individual mode (e.g.
Sculpt, Vertex Paint, Grease Pencil Draw) now has the ability to change
these values without affecting other modes.
While this change is large, the majority of the work is simply
refactoring access to the `UnifiedPaintSetting` struct. to ensure the
correct property is being retrieved.
Resolves#134077
Pull Request: https://projects.blender.org/blender/blender/pulls/139766
This changes the engine identifier back to `BLENDER_EEVEE`.
We keep the `BLENDER_EEVEE_NEXT` identifier around for
versioning reasons (have to detect when it is the active
engine of a older file).
This also rename a bunch of pannels that were using `next`
in their name.
This is a breaking change for Addons compatibility.
Pull Request: https://projects.blender.org/blender/blender/pulls/140282
This PR moves back the wireframe slider option back to the
bones overlay popover. It is only showed in paint weight mode
and only active if in wireframe mode.
It was concluded that this feature should be revisited to maybe
cover all shading modes in the future. But for now it is safer
for 4.5 to limit it to the weightpaint mode.
Pull Request: https://projects.blender.org/blender/blender/pulls/140276
This commit renames the python Brush properties that end with `_tool` to
`_brush_type` (e.g. `sculpt_tool` -> `sculpt_brush_type`) to better
distinguish the property from the concept of tools in a workspace
context.
Resolves#124201
Pull Request: https://projects.blender.org/blender/blender/pulls/139909
Adds a new operator in Grease Pencil edit mode to convert between curve
types. This acts as a replacment for the `Set Curve Type` operator as
the new operator better aligns with previous workflows and artist
expectations. Specifically using a threshold to adjust how well the
resulting curves fit to the original.
It can be found in the `Stroke` > `Convert Type` menu.
This operator aims at keeping visual fidelity between the curves. When
converting to a non-poly curve type, there's a `threshold` parameter
that dictates how closley the shapes will match (a value of zero meaning
an almost perfect match, and higher values will result in less accuracy
but lower control point count).
The conversion to `Catmull-Rom` does not do an actual curve fitting.
For now, this will resample the curves and then do an adaptive
simplification of the line (using the threshold parameter)
to simulate a curve fitting.
The `Set Curve Type` operator is no longer exposed in the
`Stroke` menu.
This also adds a new `geometry::fit_curves` function.
The function will fit a selection of curves to bézier curves. The
selected curves are treated as if they were poly curves.
The `thresholds` virtual array is the error threshold distance
for each curve that the fit should be within. The size of the virtual
array is assumed to have the same size as the total number of
input curves.
The `corners` virtual array allows specific input points to be treated
as sharp corners. The resulting bezier curve will have this point and
the handles will be set to "free".
There are two fitting methods:
* **Split**: Uses a least squares solver to find the control
points (faster, but less accurate).
* **Refit**: Iteratively removes knots with the least error starting
with a dense curve (slower, more accurate fit).
Co-authored-by: Casey Bianco-Davis <caseycasey739@gmail.com>
Co-authored-by: Hans Goudey <hans@blender.org>
Pull Request: https://projects.blender.org/blender/blender/pulls/137808
This implements the "boundary strokes" features (from 4.2 LTS).
To make it a bit more clear, the feature is now called "fill guides".
It uses the same `Alt`+`LMB` shortcut.
Fill guides are denoted by a `".is_fill_guide"` attribute set to `true`.
Otherwise they behave as normal strokes.
There is the `Clean Up` > `Remove Fill Guides` operator to remove
the strokes.
This also adds an option to the Fill tool to automatically remove fill
guides once a fill has been created.
Pull Request: https://projects.blender.org/blender/blender/pulls/139293
All contained operators are using poll functions that check we are in
weight paint mode, so all operators would be disabled in editmode
anyways, better to remove the menu to avoid confusion.
Pull Request: https://projects.blender.org/blender/blender/pulls/139535
Improve labels and UI consistency.
- Update color labels: Object, Wireframe, Background
- Rename 'Single' shading color to 'Custom'. Move to the end.
- Rename 'Viewport' color to 'Custom' for consistency.
- Fix alignment of Object Color item labels
Pull Request: https://projects.blender.org/blender/blender/pulls/137408
With `MESH_OT` prefix, the shortcut was added to wrong
keymap ("object mode", see: `WM_keymap_guess_opname`).
idname of following operations has been changed, they are
only exposed in sculpt mode UI (also see their poll function:
`geometry_extract_poll`):
- `face_set_extract`
- `paint_mask_extract`
- `paint_mask_slice`
Pull Request: https://projects.blender.org/blender/blender/pulls/133852
Added a new operator `OBJECT_OT_material_slot_remove_all`
that removes all materials from the material slots of selected objects
This was inspired by a request proposal on RCS.
Pull Request: https://projects.blender.org/blender/blender/pulls/138402
This adds inital Grease Pencil support for node tools.
Node tools work in `Object Mode`, `Edit Mode`,`Sculpt Mode`,
and `Draw Mode`.
While Grease Pencil has many editing tools, including editing
multiple frames at the same time, for now, node tools only
allow editing the current frame.
Currently, the idea is that node tools can do arbitrary changes
to the drawings, but cannot do changes to the existing layer tree, e.g.
changing the order of layers, removing a layer or groups, etc.
All the node tool specific nodes like `Selection` and `Set Selection`
are adapted to work with Grease Pencil. In `Draw Mode`, we currently
interpret everything as selected.
The `Active Element` node has a `Layer` mode that provides the
index of the active layer (if there is one).
When `Auto-Key` is used, a new keyframe is created on the
current frame.
Locked/invisible layers cannot be edited with node tools.
Pull Request: https://projects.blender.org/blender/blender/pulls/136624
This PR adds an option to only show the onion skins of the active
object. The option is added to the Grease Pencil overlay menu in the
3D viewport.
When enabled, only the onion skins of the active object are shown.
This keeps the viewport a lot cleaner when working with multiple
Grease Pencil objects.
This resolves#136820.
Pull Request: https://projects.blender.org/blender/blender/pulls/137405
In the past couple months, the basic operations needed for a new object
type were implemented, as well as basic edit mode tools. With that, the
object type is in a good enough state that it doesn't need to be hidden
behind an experimental option. That also resolves some inconsistency,
because the object type is already created by geometry nodes and used by
importers; it's weird that you can't add it manually as original data.
This also removes the "bounds" drawing flag for the object created from
the add menu. It's unnecessary now and there was even a TODO comment.
Pull Request: https://projects.blender.org/blender/blender/pulls/137546