With the brush assets project, brushes were moved from being local to
the working blendfile to being linked from asset libraries. This breaks
the Image Paint 'Clone' brush, as it has a brush property that links to
other Image datablocks.
To support this functionality, this commit adds the corresponding
properties into the `ImagePaintSettings` struct so that it is stored
locally with the images that will be used by the tool, inside the main
blendfile.
The source image property is shared with the 3D version of the 'Clone'
brush instead of adding a separate field to preserve old behavior.
Notably, this has the following limitations:
* If clone brush assets have been made and shared with external packs,
they would not work out of the box with linked image assets.
* Despite these settings being stored on the scene, they are populated
inside the tool window under "Brush Settings" which is potentially
misleading. However, this is already the case for the 3D version of
the brush, so further UI refinement will happen outside of this PR.
* Users will be unable to use separate images simultaneously for the
Image editor and the 3D viewport, unlike in pre-4.3 versions. This
can be adjusted in the future if it is a critical workflow.
Because the intended design and functionality of this tool is currently
questionable, this commit opts to make these changes instead of doing
further design to support both accessing data on the brush and on the
scene.
Pull Request: https://projects.blender.org/blender/blender/pulls/134474
Move the mask_random function to BLI_index_mask.hh, so it can be shared between curves, grease pencil and point cloud.
Copied/inspired by the curves select code.
Pull Request: https://projects.blender.org/blender/blender/pulls/134624
Though "Point Cloud" written as two words is technically correct and should be used in the UI, as one word it's typically easier to write and parse when reading. We had a mix of both before this patch, so better to unify this as well.
This commit also renames the editor/intern/ files to remove pointcloud_ prefix.
point_cloud was only preserved on the user facing strings:
* is_type_point_cloud
* use_new_point_cloud_type
Pull Request: https://projects.blender.org/blender/blender/pulls/134803
This adds:
- support for snapping for the pointcloud object (selection to cursor/
grid, cursor to selection)
- as usual, "Warp" an "Randomize" operators come along "for free" with
this
Pull Request: https://projects.blender.org/blender/blender/pulls/134799
Conversion was only possible if the active object was editable &
selected, this complicated overriding the operator from Python
since it wasn't enough to override the selection & active-object.
Now it's possible to use bpy.ops.object.convert() from Python
overriding the selected_editable_objects only.
For users the difference isn't so significant:
- Having an active object is no longer required.
- It's possible there are no objects to operate on,
as previously the active object was used to check at least one
object could be converted, although this check wasn't fool-proof
as it didn't check the objects data-type.
Resolves#100664.
Ref !134728.
Use the existing "remove_points_and_split" utility added
for grease pencil to implement the operator for the curves
object type. The whole structure is similar to the recently
added point cloud separate operator (4cd3540579).
Pull Request: https://projects.blender.org/blender/blender/pulls/134763
This reverts 06a2617107.
Commit has introduced few errors from user perspective (#134277) and
python side (#134380). Best to revert it now then handle the bug fixes later.
The error in #134380 was due to `context.layer_collection` and
`active_layer_collection` returning excluded collection.
Pull Request: https://projects.blender.org/blender/blender/pulls/134546
Note: The point cloud bounding box is not being updated once the points are deleted.
This is a known issue with BKE_pointcloud_nomain_to_pointcloud and Hans is looking into it.
Code inspired/built based on the Delete Geometry node.
Pull Request: https://projects.blender.org/blender/blender/pulls/134622
This ends up being very simple because point cloud has
no connectivity information and each element is just one
position.
Also implement the 3D transform gizmo.
The geometry deformation system isn't implemented in this
commit. That can be tacked later.
Select All operator and boiler plate for future point cloud operators.
The selection code is basically copied/inspired by the curves selection
code. A lot of it could probably be moved to shared attribute selection
functions.
Note, while this patch is working well, there are some caveats
to test it:
* Shortcuts are being defined (you can see them in the Preferences). Yet
they are not working for whatever reason.
* There is no way to visualize the selection. I've been testing it by
using a Nodes tool that changes the material based on selection.
Pull Request: https://projects.blender.org/blender/blender/pulls/134450
Adds a new python operator to Grease Pencil for adding the layer
above or below as a masking layers to the active layer.
Creates a new file for Grease Pencil python operators in
`scripts/startup/bl_operators/grease_pencil.py`.
Pull Request: https://projects.blender.org/blender/blender/pulls/134401
This is due to the click_drag event assigned for primitives. Event types
that are not "PRESS" are forwarded to drag_queue then waits until
`WM_event_drag_test_with_delta/WM_event_drag_test` is true i.e. mouse
threshold value.
Pull Request: https://projects.blender.org/blender/blender/pulls/134480
<img width="298" alt="image.png" src="attachments/9336d17d-7dd5-445b-892c-ad7e91bb98d6">
---
The Selection tools are not working, so I did not add them to the toolbar.
Pull Request: https://projects.blender.org/blender/blender/pulls/134453
The "Red Alert" color is currently hard-coded, which causes problems in
themes. It also has an Enum value of 0, which precludes using this
value as "unset". We also use Error, Warning, and Info colors that are
part of the Info Editor. This PR moves these out of the Info Editor
and into the "State" part of the theme. And then makes TH_REDALERT use
the TH_ERROR color.
Pull Request: https://projects.blender.org/blender/blender/pulls/131127
The Grease Pencil `Clipboard` only stored a single `CurvesGeometry`. This meant
that the `Paste by Layer` operation (from 4.2 LTS) couldn't be implemented.
This PR adds an `Array` of `ClipboardLayer`s to the `Clipboard`. Each layer stores
the name of the Grease Pencil layer that it was copied from and the `CurvesGeometry`.
The `grease_pencil.paste` operator has a new property `type` (`ACTIVE` or `LAYER`)
that decides how to paste the strokes.
Using the `ACTIVE` type, the strokes of all the `ClipboardLayer`s get merged and then
pasted to the active layer.
Using the `LAYER` type, we first try to find layers to paste the `ClipboardLayer`s into.
We just look for matching layer names. If no matching layer is found, the strokes are
pasted into the active layer instead.
This should be consistent with how Grease Pencil used to behave in 4.2. LTS.
Pull Request: https://projects.blender.org/blender/blender/pulls/134168