Removes unused GPv2 functions in blenkernel.
Notes:
- Functions for layer masks are still in use, but annotations never
have layer masks in the first place. Would be good to remove the data
structures so we can remove the functions too.
- Some multi-frame edit functions are also still nominally used, but
multi-frame editing is not an active feature for annotations. This
should also be removed.
Pull Request: https://projects.blender.org/blender/blender/pulls/128709
The API would return `None` if the number of strokes in the drawing was `0`.
Instead this should return a slice that has a length of 0 to be consistent.
The API would return `None` if the number of strokes in the drawing was `0`.
Instead this should return a slice that has a length of 0 to be consistent.
The old text seemed to suggest that an Action Slot can only be created at
the moment of assigning the Action to something. That is not the case.
The operator just works on the assigned Action, and if none is assigned,
there is nothing it can do.
The issue was that the API assumed that the `.selection` attribute
was always on either the point domain for points or the stroke domain
for strokes.
Internally the attribute domain depends on the current selection mode.
To fix the issue, the API now checks for the domain of the attribute
and handles it accordingly.
If the selection attribute is on the `'POINT'` domain:
* Reading the `stroke.select` property will check if *any* of the points of
the stroke are selected and return `True` or `False`.
* Writing to the `stroke.select` property will write `True` or `False` to *all* the
points in the stroke.
Also resolves#128645.
Pull Request: https://projects.blender.org/blender/blender/pulls/128687
Previously, when creating pose assets with the experimental baklava flag
enabled, although the asset would be created correctly as a slotted action,
and the resulting action would be assigned to the ID, the slot itself was
not assigned.
This commit updates the code to select the slot as well when the asset
is created as a slotted action.
Note that *applying* pose assets that were created this way is still
not functioning correctly, which will be addressed in a forthcoming PR.
Pull Request: https://projects.blender.org/blender/blender/pulls/128594
Regression in [0] which didn't account for entering paths in the
file selector which would create paths without confirming,
warning that the "confirm" property was missing.
Entering `*.*` would create `_._` for e.g in the users CWD for example.
Ref !128568
[0]: 6dd0f6627e.
This renames the mode identifiers to be consistent with e.g. the context mode identifiers and other names used for the new Grease Pencil.
For `object.mode`:
* `PAINT_GPENCIL` -> `PAINT_GREASE_PENCIL`
* `SCULPT_GPENCIL` -> `SCULPT_GREASE_PENCIL`
* `VERTEX_GPENCIL` -> `VERTEX_GREASE_PENCIL`
* `WEIGHT_GPENCIL` -> `WEIGHT_GREASE_PENCIL`
For the internal `ob->mode` flag:
* `OB_MODE_PAINT_GPENCIL_LEGACY` -> `OB_MODE_PAINT_GREASE_PENCIL`
* `OB_MODE_SCULPT_GPENCIL_LEGACY` -> `OB_MODE_SCULPT_GREASE_PENCIL`
* `OB_MODE_VERTEX_GPENCIL_LEGACY` -> `OB_MODE_VERTEX_GREASE_PENCIL`
* `OB_MODE_WEIGHT_GPENCIL_LEGACY` -> `OB_MODE_WEIGHT_GREASE_PENCIL`
Resolves#127374.
Pull Request: https://projects.blender.org/blender/blender/pulls/128604
The `paint.brush_colors_flip` option was not exposed in the vertex color
panel.
This adds the toggle in the panel and also adds the keymap `X` to flip
the colors.
The tint color and panel was not used consistently.
In Vertex Paint mode we're using the unified paint settings,
but in Draw mode, we only use the brush color for tinting.
This fixes the issue by using the unified paint settings
for all the uses of the vertex color.
Removes many of the operators, panels, and menus used exclusively by Grease Pencil v2 that are no longer needed in v3.
No functional changes are expected.
Some operators are still used by the annotations system and have to be kept around. These may be renamed in future.
Pull Request: https://projects.blender.org/blender/blender/pulls/128521
Hides the brush asset shelf by default in weight paint, grease pencil
weight paint and grease pencil vertex paint mode. These only have one
bundled brush per tool available.
After bringing back some tools for brushes in certain modes
(3798852071), we want to hide the asset shelf in modes where there's
only one brush bundled per tool. While having these tools support
brushes can be useful, we don't expect to bundle more brushes soon. So
avoid a mostly empty asset shelf for a single brush by hiding it by
default and keeping it hidden until the user expands it (bf52f6f723 made
it possible to remember the visibility per mode).
Part of #128066 and #116337.
Previously, alignment did exist, but it only changed whole text block
position in relation to a fixed point. This was later renamed to "Anchor".
Now it correctly aligns each line of text. Alignment works with newline
character and word wrapping.
Currently newline characters can't be entered directly, but this should
be resolved soon.
To keep existing anchoring feature, new DNA fields are added and
values from old alignment are copied there.
This PR is part of bigger change [1], and originally I expected to
implement this feature at later stage. But the design called for drawing
text character by character, which would mean, that I would have to
rewrite text alignment anyway.
To render the text, a struct is built, where position and width of each
character is stored. In addition, width of each line is stored. This allows
to implement proper text alignment feature, instead of existing
anchoring. Text is then drawn character by character in a loop.
There are some small differences in text rendering, since this is only
approximation of how BLF library draws glyphs, but it is very close.
For text bounbox, `BLF_boundbox()` is used on per line basis,
because some fonts do not use their full height and this information
is not available on VSE side.
[1] https://projects.blender.org/blender/blender/issues/126547
Pull Request: https://projects.blender.org/blender/blender/pulls/126660
Layer panel (also mask/ transform etc.) and other operators are gone
when properties tab is pinned and gpv3 object is non-active.
To fix this, get grease pencil pointer from `button_context()`
(done in `grease_pencil_context()`).
Continuation of cd476226d8
Pull Request: https://projects.blender.org/blender/blender/pulls/128475
Adds a new "Select by Trait" option to select all 3-poles, 5-poles, etc.
Given the impacts of 3 & 5-poles in topology, operator default is to
select all poles which do not have 4 edges to allow easy inspection.
Select connected vertices/edges/faces based on the mode.
Ref: !128493