Commit Graph

513 Commits

Author SHA1 Message Date
71bce6d8e8 Merge branch 'master' into sculpt-dev 2023-01-26 20:13:46 -08:00
88e9826529 Sculpt: Fix T102889: Sculpt trim tool extrudes in perspective
Added an extrude mode enum to the trim operators to
control extrusion: "project" and "fixed."  "Fixed" just
extrudes along a fixed normal and is the new default.
2023-01-11 09:57:58 -08:00
706b13959e Cleanup: use double-quotes for non-enum strings 2023-01-06 14:00:36 +11:00
7571222a69 Cleanup: add trailing commas for multi-line collections
Avoid accidentally missing commas between strings, see: T101020.
Also use single quotes for enum identifiers.
2022-12-15 17:34:09 +11:00
e53a8f9c51 Merge branch 'master' into sculpt-dev 2022-12-03 03:26:49 -08:00
56ae4089eb GPencil: Allow interpolation to use breakdown keyframe as extremes
Actually, the interpolation can be done only between keyframes different of breakdown type,
but in some cases, this is not convenient.

Now, a new option is displayed to allow the interpolation using breakdown keyframes
as interpolation extremes.

Reviewed By: mendio, pepeland

Differential Revision: https://developer.blender.org/D16515
2022-11-28 19:32:18 +01:00
84342ed7b2 Merge remote-tracking branch 'origin' into sculpt-dev 2022-09-17 17:58:13 -07:00
7f733e294d Merge branch 'blender-v3.3-release' 2022-08-12 14:43:53 +10:00
95cc5c6081 Fix T96885: Drag Fallback on Tweak is using Move instead
Since [0] (fix for T95591), the tweak tools fallback action used tweak
instead of press.

This was enabled so tools such as "Measure" & "Add Cube" could use
fallback tools (otherwise is wasn't possible to add a new ruler without
also selecting for e.g.), however this is of limited use since both
tools support dragging anywhere to activate, making them less useful
with other selection tools beside tweak (box/lasso for e.g.).

Resolve by disabling the fallback option for tools where using the
tweak tool to select is undesirable. Selection by clicking with
"Measure" & "Add Cube" is still supported as this is also set in the
3D view's key-map.

[0]: 0e51defcf4
2022-08-12 14:24:31 +10:00
169216684a Merge branch 'blender-v3.3-release' 2022-08-10 16:43:33 +10:00
b114993305 Fix T99963: Fallback actions are used in RCS on left click
Regression in [0].

Disable fallback tools for the 3D cursor so other shortcuts are
available such as lasso-select.

[0]: b0847eff2a
2022-08-10 16:39:29 +10:00
18377c4f5e UI: Improve circle drawing of cursor for uv sculpting
Calculate segments based on radius.

Differential Revision: https://developer.blender.org/D15591
2022-08-03 09:44:06 +12:00
5fa8dbeacd Merge remote-tracking branch 'origin' into sculpt-dev 2022-07-30 00:18:24 -07:00
1e55b58e4f UI: Sort tools in curves sculpting mode
The previous order was based on the order of when the tools were
developed. Instead we now cluster them based on similar functionality:

* Selection
* Add/Remove
* Deform/Transform
* Annotation

Done in collaboration with Pablo Vazquez.
2022-07-27 11:15:48 +02:00
becb1530b1 Hair Curves: The new curves object is now available
This commit doesn't implement any new feature but makes the new curves
object type no longer experimental.

Documentation:

* https://docs.blender.org/manual/en/3.3/modeling/curves/primitives.html#empty-hair
* https://docs.blender.org/manual/en/3.3/sculpt_paint/curves_sculpting/introduction.html

Note: This also makes the Selection Paint tool available. This tool
should have been moved out of the "New Curves Tool" flag when we got the
selection drawing to work.

Differential Revision: https://developer.blender.org/D15402
2022-07-08 15:11:32 +02:00
93b96bab9a Merge branch 'master' into sculpt-dev 2022-07-03 23:39:50 -07:00
416aef4e13 Curves: New tools for curves sculpt mode.
This commit contains various new features for curves sculpt mode
that have been developed in parallel.

* Selection:
  * Operator to select points/curves randomly.
  * Operator to select endpoints of curves.
  * Operator to grow/shrink an existing selection.
* New Brushes:
  * Pinch: Moves points towards the brush center.
  * Smooth: Makes individual curves straight without changing the root
    or tip position.
  * Puff: Makes curves stand up, aligning them with the surface normal.
  * Density: Add or remove curves to achieve a certain density defined
    by a minimum distance value.
  * Slide: Move root points on the surface.

Differential Revision: https://developer.blender.org/D15134
2022-06-30 15:09:13 +02:00
Pablo Dobarro
e90ba74d3e D15041: Sculpt: Elastic Transform
This implements transform modes for the transform tool and Elastic
Transform. This mode uses the Kelvinlets from elastic deform to apply
the transformation to the mesh, using the cursor radius to control the
elasticity falloff.

{F9269771}

In order for this to work, the transform tool uses incremental mode when
elastic transform is enabled. This allows to integrate the displacement of
the Kelvinet in multiple steps.

Review By: Sergey Sharbin & Daniel Bystedt & Julian Kaspar & Campbell
Barton

Differential Revision: https://developer.blender.org/D9653

Ref D15041
2022-06-04 13:50:28 -07:00
d54416506a Merge remote-tracking branch 'origin' into sculpt-dev 2022-06-02 23:44:50 -07:00
3ca76ae0e8 Cleanup: remove "<pep8 compliant>" from headers
It can be assumed that all scripts comply with basic pep8 formatting
regarding white-space, indentation etc.

Also remove note in best practices page & update `tests/python/pep8.py`.

If we want to exclude some scripts from make format,
this can be done by adding them to `ignore_files` in:
source/tools/utils_maintenance/autopep8_format_paths.py

Or using `# nopep8` for to ignore for individual lines.

Ref T98554
2022-06-02 20:16:20 +10:00
a1830859fa Curves: Add soft selection in sculpt mode
This commit adds a float selection to curve control points or curves,
a sculpt tool to paint the selection, and uses the selection influence
in the existing sculpt brushes.

The selection is the inverse of the "mask" from mesh sculpt mode
currently. That change is described in more detail here: T97903

Since some sculpt tools are really "per curve" tools, they use the
average point selection of all of their points. The delete brush
considers a curve selected if any of its points have a non-zero
selection.

There is a new option to choose the selection domain, which affects how
painting the selection works. You can also turn the selection off by
clicking on the active domain.

Sculpt brushes can be faster when the selection is small, because
finding selected curves or points is generally faster than the
existing brush intersection and distance checks.

The main limitation currently is that we can't see the selection in the
viewport by default. For now, to see the selection one has to add a
simple material to the curves object as shown in the differential
revision. And one has to switch to Material Preview in the 3d view.

Differential Revision: https://developer.blender.org/D14934
2022-05-31 19:00:24 +02:00
2cb7a0066d Merge remote-tracking branch 'origin/master' into sculpt-dev 2022-04-29 22:37:03 -07:00
Ramil Roosileht
33d102e5b2 Reorder sculpt tools
Changed tool order as proposed in [[ https://developer.blender.org/T97206 | T97206 ]]
{F12987559}

Reviewed By: JulienKaspar, jbakker

Maniphest Tasks: T97206

Differential Revision: https://developer.blender.org/D14612
2022-04-22 08:05:45 +02:00
58d86527ae Cleanup: run autopep8 on release/scripts/startup/ 2022-04-19 15:07:04 +10:00
6f5535e56c Merge branch 'master' into sculpt-dev 2022-04-08 17:27:29 -07:00
Pratik Borhade
77ae30517f Fix: UI alignment in knife tool settings popover
Remove the extra space given for decorators on right of the popover.

Differential Revision: https://developer.blender.org/D14518
2022-04-06 17:01:07 -05:00
11b0824d89 Cleanup: line wrapping, remove unused args, variables in UI scripts 2022-04-06 09:40:14 +10:00
eae36be372 Refactor: Unify vertex and sculpt colors into new
color attribute system.

This commit removes sculpt colors from experimental
status and unifies it with vertex colors. It
introduces the concept of "color attributes", which
are any attributes that represents colors.  Color
attributes can be represented with byte or floating-point
numbers and can be stored in either vertices or
face corners.

Color attributes share a common namespace
(so you can no longer have a floating-point
sculpt color attribute and a byte vertex color
attribute with the same name).

Note: this commit does not include vertex paint mode,
      which is a separate patch, see:
      https://developer.blender.org/D14179

Differential Revision: https://developer.blender.org/D12587
Ref D12587
2022-04-05 11:42:55 -07:00
Dilith Jayakody
336082acba Curves: Curve Pen
This tool can be used to rapidly edit curves. The current set of
functionalities for Bezier splines are as follows:

The functionalities are divided into three versions of the operator:
* Left-Click
* Ctrl + Left-Click
* Double Click

All current functionalities and their defaults are as follows:
* Extrude Point: Add a point connected to an existing point.
Enabled for Left-Click.
* Extrude Handle Type: Type of the handles of the extruded points.
Can be either Vector or Auto. Defaults to Vector.
* Delete Point: Delete existing point.
Enabled for Ctrl + Left-Click.
* Insert Point: Insert a point into a curve segment.
Enabled for Ctrl + Left-Click.
* Move Segment: Move curve segment.
Enabled for Left-Click.
* Select Point: Select a single point or handle at a time.
Enabled for Left-Click.
* Move point: Move existing points or handles.
Enabled for Left-Click.
* Close Spline: Close spline by clicking the endpoints consecutively.
Defaults to True.
* Close Spline Method: The condition for Close Spline to activate.
Can be one of None, On Press or On Click.
Defaults to On Click for Left-Click and None for the others.
  * None: Functionality is turned off.
  * On Press: Activate on mouse down.
  This makes it possible to move the handles by dragging immediately
  after closing the spline.
  * On Click: Activate on mouse release.
  This makes it possible to avoid triggering the Close Spline
  functionality by dragging afterward.
* Toggle Vector: Toggle handle between Vector and Auto handle types.
Enabled for Double Click on a handle.
* Cycle Handle Type: Cycle between all four handle types.
Enabled for Double Click on the middle point of a Bezier point.

The keybindings for the following functionalities can be adjusted from
the modal keymap
* Free-Align Toggle: Toggle between Free and Align handle types.
Defaults to Left Shift. Activated on hold.
* Move Adjacent Handle: Move the closer handle of the adjacent vertex.
Defaults to Left Ctrl. Activated on hold.
* Move Entire: Move the entire point by moving by grabbing on the handle
Defaults to Spacebar. Activated on hold.
* Link Handles: Mirror the movement of one handle onto the other.
Defaults to Right Ctrl. Activated on press.
* Lock Handle Angle: Move the handle along its current angle.
Defaults to Left Alt. Activated on hold.

All the above functionalities, except for Move Segment and
those that work with handles, work similarly in the case of Poly
and NURBS splines.

Reviewed By: HooglyBoogly, weasel, campbellbarton
Differential Revision: http://developer.blender.org/D12155
2022-04-03 22:37:22 +05:30
54a3c7525b Merge branch 'master' into sculpt-dev 2022-03-12 00:15:29 -08:00
0a4fdcbb5f Cleanup: unused Python variables & imports 2022-03-04 11:07:37 +11:00
a7c944e50d Merge branch 'master' into sculpt-dev 2022-02-24 02:05:52 -08:00
61aaeb3745 Curves: initial brush system integration for curves sculpt mode
This adds the boilerplate code that is necessary to use the tool/brush/paint
systems in the new sculpt curves mode.

Two temporary dummy tools are part of this patch. They do nothing and
only serve to test the boilerplate. When the first actual tool is added,
those dummy tools will be removed.

Differential Revision: https://developer.blender.org/D14117
2022-02-18 09:14:54 +01:00
c434782e3a File headers: SPDX License migration
Use a shorter/simpler license convention, stops the header taking so
much space.

Follow the SPDX license specification: https://spdx.org/licenses

- C/C++/objc/objc++
- Python
- Shell Scripts
- CMake, GNUmakefile

While most of the source tree has been included

- `./extern/` was left out.
- `./intern/cycles` & `./intern/atomic` are also excluded because they
  use different header conventions.

doc/license/SPDX-license-identifiers.txt has been added to list SPDX all
used identifiers.

See P2788 for the script that automated these edits.

Reviewed By: brecht, mont29, sergey

Ref D14069
2022-02-11 09:14:36 +11:00
3165ec4dac Sculpt-dev: Add some more debug printfs for wintab 2022-01-25 14:21:58 -08:00
c8aedd75d7 Sculpt-dev: New normal automasking modes
Two new automasking modes: "Brush Normal"
and "View Normal."

Brush Normal compares vertex normals to
the initial sculpt normal, while View
Normal of course compares with the
view vector.

Each of these modes have an angular limit
and a falloff.  There's also an "original
normal" option, which needs a better name;
"original normal" is actually already taken,
but "automasking original normal" is a lot of
characters.  Not sure what to do here.
2022-01-07 12:03:40 -08:00
268e18e9a3 Sculpt-dev: More improvements to detail enhance
* Detail enhance is now it's own dedicated toolslot.
  This makes it possible to use autosmooth with
  detail enhance.

  Note the behavior of the smooth brush (which
  invokes enhance when pressing control)
  is unchanged.

* Fixed a bug with temporary attribute layers being constantly
  cleared and reallocated with multires.

* Cleaned up velocity smooth code a bit.
* Pruned various dead #if blocks.
* generate_from_enum_ex in space_toolsystem.py
  now takes a special argument to combine enum
  items.  This is used to make enhance a subtool
  of smooth.
2021-12-12 05:03:24 -08:00
9a77a920f0 Merge branch 'master' into sculpt-dev 2021-12-04 20:07:32 -08:00
d8edc2c634 VSE: Disable interactivity in combined view
Combined view of timeline and preview causes seemingly unpredictable
behavior after some operators have been allowed to run in preview
region.

Disable new features in this combined view, so behavior should be
consistent with previous versions.

ref: https://developer.blender.org/T92584

Reviewed By: campbellbarton

Differential Revision: https://developer.blender.org/D13419
2021-11-30 11:15:20 +01:00
e21c21bbf9 Sculpt-dev: support area weighted smooth for PBVH_FACES
* This was actually kind of annoying; the
  vertex->face-area-list code is in pbvh and
  relies on edge ordering
  around verts, but that order is non-trivial for
  PBVH_FACES (relying as it does on a vertex->poly
  map).  This ordering was calculated entirely in
  editors/sculpt_paint/sculpt.c, not callable from
  pbvh.
* The solution was to add a helper function to pbvh
  for building vertex->edge lists from vertex->poly
  maps.  This is then used by both sculpt.c and the
  vertex->face-area-list code.

* Also improved boundary bevel smooth a bit.  I'm
  thinking of extracting it from SCULPT_neighbor_coords_average_interior
  into its own function and possibly its own brush.
2021-11-28 01:19:23 -08:00
2255892f5b Sculpt-dev: add random_[hue/sat/value]
color filter options from
	    sculpt-mode-features

* Follows comment in mesh filter's randomize and
  uses BLI_hash_int_3d.
* Added a seed parameter.
* Also renamed SCULPT_get_mdyntopo to SCULPT_get_sculptvert.
2021-11-20 08:49:14 -08:00
cddcc54f32 Sculpt-dev: fix brush input mapping inheritance
* Brush input mappings now have three
  inheritance mode: "always", "never" and
  "channel" (use channel's inheritance mode).
* Note that the UI exposes a single inherit icon,
  which just toggles between "always" and
  "never," to lessen user confusion.
* Brush mappings default to "never" inheritance
  mode.
* Fixed wrong node update flag in bke_pbvh_insert_face_finalize
  leading to disappearing parts of the mesh.
2021-11-16 13:26:39 -08:00
e1cf0657d8 Merge branch 'master' into sculpt-dev 2021-11-14 02:35:23 -08:00
b3597f310d Fix T92469: Transform tools inaccessible in weight-paint + pose mode
Expose transform tools when in weight paint mode with pose-mode enabled,
displaying transform tools in the toolbar, as is already done in
object & pose mode.

These are only shown when weight-paint + pose mode are active at once.

This allows single key-strokes to activate tools, needed when
tool-access is set as the default action for G/R/S key bindings.

Reviewed By: JulienKaspar

Ref D13028
2021-11-09 15:43:34 +11:00
78d62d9be7 Merge remote-tracking branch 'origin/temp-sculpt-colors' into sculpt-dev
This was necassary because sculpt colors is currently broken in master,
and temp-sculpt-colors hasn't been approved for merging to master
yet.
2021-11-08 17:55:19 -08:00
6c0da7cc81 Merge branch 'master' into temp-sculpt-colors 2021-11-08 13:17:16 -08:00
a3f4e93497 Merge branch 'master' into sculpt-dev 2021-11-08 13:16:18 -08:00
cd8350764b Docs: improve comments & doc-strings for the tool-system 2021-11-09 00:23:55 +11:00
1a5ea3c8b3 Merge branch 'master' into temp-sculpt-colors 2021-11-03 13:03:43 -07:00
1dcc741f43 temp-sculpt-colors: commit patch 2021-11-03 12:15:13 -07:00