Commit Graph

29 Commits

Author SHA1 Message Date
Lukas Tönne
7a3cd753ba GPv3: Fill tool to generate strokes in empty areas
Implementation of the GPv2 Fill tool in Grease Pencil 3.

This tool creates new strokes where the user clicks, by rendering
strokes into an image and then performing flood-fill and boundary
search operations.

This is a minimal first part, several features of the GPv2 tool are
still missing (gap filling methods, smoothing, dilate/erode).

Co-authored-by: Falk David <falk@blender.org>
Pull Request: https://projects.blender.org/blender/blender/pulls/120693
2024-05-15 13:36:06 +02:00
Campbell Barton
5088b0154d Cleanup: replace %-formatting with str.format in scripts/modules/
The "bl_i18n_utils" module has been excluded I'm not sure how best
to run it with reasonable code coverage.
2024-04-27 16:06:51 +10:00
Sietse Brouwer
4fbef3dc6b GPv3: Cutter tool
This PR implements the Cutter Tool for GPv3. The Cutter tool deletes
points in between intersecting strokes. New points are created at the
exact intersection points, so as a result the cutted strokes will fit
perfectly.

For feature parity, the tool follows the GPv2 behavior:

- The cutter tool works on all editable layers.
- Intersections are only detected for curves on the same layer,
so intersection of curves on _seperate_ layers are not handled.

Technical notes
The implementation uses the `compute_topology_change` function
created for the Hard Eraser. So at intersection points, point
attributes will be interpolated.

Pull Request: https://projects.blender.org/blender/blender/pulls/113953
2024-04-22 14:05:22 +02:00
casey bianco-davis
2df13ce4a3 GPv3: Primitive Tools: Line, Polyline, Arc, Curve, Box and Circle Tool
Adds the primitive tools in draw mode to GPv3.

This also adds rotation and scale sub-operators with `r` and `s` keybinds.
Also all control points are editable after extruding.

Pull Request: https://projects.blender.org/blender/blender/pulls/119039
2024-04-22 10:48:03 +02:00
Campbell Barton
ae950451ea Cleanup: remove redundant f-string use 2024-04-01 16:51:32 +11:00
Germano Cavalcante
a159654ab2 Fix #118103: Warning property alt navigation
"alt_navigation" can also be present in:
- transform.transform
- transform.vert_slide
- transform.edge_slide
- transform.shrink_fatten
2024-02-12 09:33:07 -03:00
Campbell Barton
bc5a8f33d8 Cleanup: correct misleading name 2024-02-09 18:18:13 +11:00
Campbell Barton
5affe322cc Correct version bump from 41b63ebda2b264165feee1f7c4c0113eb76c8bd9 2024-02-09 18:15:05 +11:00
Campbell Barton
41b63ebda2 Versioning: add missing version update for renamed key-map
Account for the renamed key-map when loading older saved key-maps &
stored user preferences. [0] missed these changes.

[0]: 661e7e451a0eadd7955a6074a79d570ac4ce2927
2024-02-09 18:11:12 +11:00
Campbell Barton
c59b9ff9c2 Fix #105548: I18n: many keymap sections cannot be translated
Ensure tool keymaps are registered when calling:
bl_keymap_utils.keymap_hierarchy.generate() in background mode.

This is an alternative to !116299 that doesn't require keymap
initialization in background mode.
Thanks to Damien Picard's for reporting & investigating this issue.
2023-12-20 11:54:52 +11:00
Germano Cavalcante
14c2f6856a Suppress warnings by removing unused properties from keymaps
Between Blender versions, properties of some operators may be removed.

When this happens, when importing the keymap from the previous version,
a series of warnings may appear in the console. For example:
```
Warning: property 'alt_navigation' not found in item 'TRANSFORM_OT_translate'
Warning: property 'alt_navigation' not found in item 'TRANSFORM_OT_rotate'
Warning: property 'alt_navigation' not found in item 'TRANSFORM_OT_resize'
Warning: property 'alt_navigation' not found in item 'VIEW3D_OT_edit_mesh_extrude_move_normal'
...
```

Therefore, it seems to be convenient to edit these properties when
versioning.

This commit implements a `remove_properties` utility that makes this
removal simpler.

Pull Request: https://projects.blender.org/blender/blender/pulls/114936
2023-11-30 12:22:47 +01:00
Nate Rupsis
661e7e451a Anim: Rename NLA "Channels" to "Tracks"
Updating "NLA Channel"  to "NLA Tracks" across board, since the terminology "Tracks" is the most prevalent in operators, code, etc.
2023-11-16 17:59:18 +01:00
Germano Cavalcante
c6db3f98bb Fix modal key assignment for "Rotate Normals" in keymap versioning
Error in 78943edc5d

The key was not included in the appropriate condition block, leading to
an error.
2023-11-13 09:47:10 -03:00
Germano Cavalcante
78943edc5d Transform: Custom modifier to navigate while transforming
Discussed in #114646.

This commit transforms the "alt_navigation" option of the transform
operators into a new modal key item. "PASSTHROUGH_NAVIGATE"

In addition to cleaning up a lot of the code, it allows you to
customize the key chosen to navigate while transforming.
2023-11-09 21:33:34 -03:00
Campbell Barton
e955c94ed3 License Headers: Set copyright to "Blender Authors", add AUTHORS
Listing the "Blender Foundation" as copyright holder implied the Blender
Foundation holds copyright to files which may include work from many
developers.

While keeping copyright on headers makes sense for isolated libraries,
Blender's own code may be refactored or moved between files in a way
that makes the per file copyright holders less meaningful.

Copyright references to the "Blender Foundation" have been replaced with
"Blender Authors", with the exception of `./extern/` since these this
contains libraries which are more isolated, any changed to license
headers there can be handled on a case-by-case basis.

Some directories in `./intern/` have also been excluded:

- `./intern/cycles/` it's own `AUTHORS` file is planned.
- `./intern/opensubdiv/`.

An "AUTHORS" file has been added, using the chromium projects authors
file as a template.

Design task: #110784

Ref !110783.
2023-08-16 00:20:26 +10:00
Campbell Barton
53e6803977 Cleanup: check for "BaseException" instead of "Exception"
Prefer the more generic exception type as it's possible exceptions
derive from this and not "Exception".

Also use the name 'ex' for exceptions instead of 'e'.
2023-07-30 16:14:13 +10:00
Germano Cavalcante
1a44120d71 Error importing keymaps prior to version 4.0.3
Caused by 3010f1233b.

The keymap format was incorrect because `extend` was being used instead
of `append`.
2023-07-04 20:19:48 -03:00
Germano Cavalcante
c0d230e0b8 Revert "Transform: Allow navigation by default"
This reverts commit d53862351d042c4c36c7ebb49feb230725e43a0b.

After conducting tests with artists at the studio, it was observed that
altering the Transform Modal Maps caused significant disruption due to
the heavy reliance on the "Proportional Editing" and "Automatic
Constraint" features.

Considering this, it is now deemed more beneficial to provide users
with the choice of adapting their muscle memory to the new changes.

Pull Request: https://projects.blender.org/blender/blender/pulls/109660
2023-07-04 14:53:39 +02:00
Germano Cavalcante
d53862351d Transform: Allow navigation by default
As suggested in #108669, the "Navigate during Transform" option has
been removed and this feature works by default.

Now if you press `G`, `R` or `S` to move, rotate or scale an object you
can also navigate in the viewport.

Note that this update modifies the default keymap.
Now pressing `Alt` is required for the following modals:
- `PROPORTIONAL_SIZE_UP`,
- `PROPORTIONAL_SIZE_DOWN`,
- `PROPORTIONAL_SIZE`,
- `AUTOIK_CHAIN_LEN_UP`,
- `AUTOIK_CHAIN_LEN_DOWN`,
- `AUTOCONSTRAIN`,
- `AUTOCONSTRAINPLANE`.

Pull Request: https://projects.blender.org/blender/blender/pulls/109388
2023-06-27 20:29:05 +02:00
Campbell Barton
65f99397ec License headers: use SPDX-FileCopyrightText in all sources 2023-06-15 13:35:34 +10:00
Germano Cavalcante
8dd1a6d91b Fix keymap versioning mistake in 3010f1233b
The file version was bumped to (4, 0, 4), so the new version check
should be done against (4, 0, 3).
2023-06-07 09:22:55 -03:00
Falk David
b29ba95cae GPv3: Add "(De)select All" operator and keymap
This adds the `GREASE_PENCIL_OT_select_all` operator as well as a new keymap for edit mode for the new grease pencil objects.

Pull Request: https://projects.blender.org/blender/blender/pulls/108628
2023-06-06 14:45:54 +02:00
Germano Cavalcante
3010f1233b Transform: new feature to edit the 'Snap Base'
This commit implements a new modifier key (`B`) for the transform
operators.

This new key allows changing the 'Snap Base' of a transform by snapping
it to a defined point in the scene.

Ref #66424

# Implementation Details

- This feature is only available in the 3D View.
- This feature is only available for the transform modes:
  - `Move`,
  - `Rotate`,
  - `Scale`,
  - `Vert Slide` and
  - `Edge Slide`.
- The `Snap Base Edit` is enabled while we are transforming and we
  press the key `B`
- The `Snap Base Edit` is confirmed when we press any of the keys:
 `B`, `LMB`, `Enter`
- During um operation, if no snap target is set for an element in the
  scene (Vertex, Edge...), the snap targets to geometry Vertex, Edge,
  Face, Center of Edge and Perpendicular of Edge are set automatically.
- Constraint or similar modal features are not available during the
  `Snap Base Edit` mode.
- Text input is not available during the `Snap Base Edit` mode.
- A prone snap base point is indicated with an small cursor drawing.

Pull Request: https://projects.blender.org/blender/blender/pulls/104443
2023-06-03 04:18:49 +02:00
Sietse Brouwer
397a14deff GPencil: Several Weight Paint additions
This patch adds several tools and options to the weight paint mode of Grease Pencil.

* Blur tool: smooths out vertex weights, by calculating a gaussian blur of adjacent vertices.
* Average tool: painting the average weight from all weights under the brush.
* Smear tool: smudges weights by grabbing the weights under the brush and 'dragging' them.

* With the + and - icons in the toolbar, the user can easily switch between adding and subtracting weight while drawing weights.
* With shortcut `D` you can toggle between these two.

* The auto-normalize options ensures that all bone-deforming vertex groups add up to 1.0 while weight painting.
* With `Ctrl-F` a radial control for weight is invoked (in addition to the radial controls for brush size and strength).
* With `Ctrl-RMB` the user can sample the weight. This sets the brush Weight from the weight under the cursor.

* When painting weights in vertex groups for bones, the user can quickly switch to another vertex group by clicking on a bone with `Ctrl-LMB`.
For this to work, follow these steps:
* Select the armature and switch to Pose Mode.
* Select your Grease Pencil object and switch immediately to Weight Paint Mode.
* Select a bone in the armature with `Ctrl-LMB`. The corresponding vertex group is automatically activated.

Pull Request: https://projects.blender.org/blender/blender/pulls/106663
2023-04-20 07:55:24 +02:00
Campbell Barton
c4c1cc7cd3 Cleanup: double quotes for non-enum strings
Also use back-ticks for code-references in comments.
2023-04-18 10:51:32 +10:00
Germano Cavalcante
bb67d4c298 Transform: expose hardcoded 'Rotate Normals' key
"Rotate Normals" is a changeable operation like any other and does not
need to be hardcoded.

An advantage of exposing this modal is that the shortcut key now
appears in the header when rotating an edited mesh.
2023-03-27 14:38:47 -03:00
Tarek Yasser
da65b21e2e Sculpt: Add Transform, Trim, and Mesh Filter operators to Sculpt menu
Hello, this is a small PR to check that my understanding of #102427 is correct before moving on to the rest of the issue.
This PR contains the updated UI of the `Sculpt` menu only. Other menus will be submitted for review later.

Currently exposed operators:
* Move
* Rotate
* Scale
* Box Trim (Trim Mode ="Difference")
* Lasso Trim (Trim Mode ="Difference")
* Box Add (Trim Mode ="Join")
* Lasso Add (Trim Mode ="Join")
* Line Project
* Smooth
* Surface Smooth
* ~~Scale (Could be left out?)~~
* Inflate
* Random
* Relax Topology
* Relax Face Set Boundaries
* Sharpen
* Enhance Details
* Erase Displacement

The original issue specifies `Relax Face Set Boundaries` and `Erase Displacement`. I'm not quite sure if this is done in the UI code or somewhere else.

Reviewed By: Joseph Eagar & Julian Kaspar
Pull Request: https://projects.blender.org/blender/blender/pulls/104718
2023-03-08 01:18:21 +01:00
Germano Cavalcante
03f17c42d0 Fix #100129: Status bar incorrectly shows "[G] Move" after pressing G
Add specific modal keyitem for `Vert/Edge Slide` and `TrackBall`.
So they don't need to reuse modal items from other operators.

Note that there is a workround to avoid repeated keys in the status bar.
2023-03-01 16:06:20 -03:00
Sergey Sharybin
03806d0b67 Re-design of submodules used in blender.git
This commit implements described in the #104573.

The goal is to fix the confusion of the submodule hashes change, which are not
ideal for any of the supported git-module configuration (they are either always
visible causing confusion, or silently staged and committed, also causing
confusion).

This commit replaces submodules with a checkout of addons and addons_contrib,
covered by the .gitignore, and locale and developer tools are moved to the
main repository.

This also changes the paths:
- /release/scripts are moved to the /scripts
- /source/tools are moved to the /tools
- /release/datafiles/locale is moved to /locale

This is done to avoid conflicts when using bisect, and also allow buildbot to
automatically "recover" wgen building older or newer branches/patches.

Running `make update` will initialize the local checkout to the changed
repository configuration.

Another aspect of the change is that the make update will support Github style
of remote organization (origin remote pointing to thy fork, upstream remote
pointing to the upstream blender/blender.git).

Pull Request #104755
2023-02-21 16:39:58 +01:00