Age | Commit message (Collapse) | Author |
|
Followup to rBfb424db2b7bb. Found some more candidates.
UI colors should use PROP_COLOR_GAMMA to avoid being affected by scene
color management (clarification by @brecht).
Differential Revision: https://developer.blender.org/D16337
|
|
For consistency with other brush based (paint) systems we should add
these entries in the brushes context menu.
For this, expose the brushes `ob_mode` to RNA and show this (along with
the tool choice) to the appropriate menus.
Differential Revision: https://developer.blender.org/D16287
|
|
Also remove automasking_cavity_factor default from RNA for brushes.
Data-blocks set their defaults via `DNA_brush_defaults.h`
Continuation from previous commit and rBdb40b6
Thanks to Dalai for the help!
|
|
Add auto-masking as a popover in the header while in Sculpt mode,
following the design in T101593.
These properties were present in the Options panel (and popover),
they have been removed from there.
Moreover, this commit makes the auto-masking section in Brush settings
match the new popover.
In the future this popover can be used for other modes that support
auto-masking such as Grease Pencil.
See D16145 for details and screenshots.
Reviewed By: JulienKaspar
Differential Revision: https://developer.blender.org/D16145
|
|
|
|
After a lot of testing, this option is not required and
now this is managed by stroke_collsion.
If the stroke_collision is enabled, only collide strokes
are used.
|
|
|
|
Two new normal-based automasking modes.
The first mode, "brush", compares vertex normals with the initial
normal at the beginning of the brush stroke.
The second, "view", compares vertex normals with the view normal.
If "occlusion" is on then rays will be shot from each vertex to test
if it is occluded by other geometry (note: this can be very slow).\
Only geometry inside the sculpt mesh is considered.
Each mode has an associated angular limit and a falloff.
Reviewed by: Julien Kaspar and Jeroen Bakker
Differential Revision: https://developer.blender.org/D15297
Ref D15297
|
|
Quiet warnings at startup & build time.
|
|
|
|
Add new cavity automasking mode based on local mesh
curvature. Cavity masking is a great way to quickly add
detail in crevices and the like. It's meant to be used
with the Paint brush in color attribute mode. It does
work with other brushes but the results can be unpredictable.
{F13131497}
The old "dirty mask" operator has been replace with a new
"mask from cavity" operator that shares the same code with
cavity automasking.
Differences from the sculpt-dev implementation:
* It uses the word "cavity." When I first implemented
this I wasn't aware
this feature existed in other software (and other
paint modes in Blender),
and for reasons that escape me today I initially
decided to call it a concave or
concavity mask.
* The cavity factor works a bit differently. It's
no longer non-linear and functions as a simple
scale around 0.5f.
* Supports custom curves.
* Supports blurring.
Reviewed By: Julian Kaspar, Jeroen Bakker and Campbell Barton
Differential Revision: https://developer.blender.org/D15122
Ref D15122
|
|
|
|
This commit is an improvement in the previous fill tool
changes in order to improve how the extended strokes
are managed.
* Now, the algorithm checks if the extend cross a standard stroke, not only extend strokes.
* Option to enable or disable the stroke cross checking
because this can be slow in very complex scenes.
* Added `D` key to toggle stroke cross option.
* Option to use only collide strokes to be used as fill limit.
If the option to use only collide strokes is enabled, the
open extensions are in different color.
* Status text now shows mode and the actual extend factor.
This commits also contains a refactor of the loops
to use arrays as much as possible.
Reviewed By: mendio, pepeland
Differential Revision: https://developer.blender.org/D16052
|
|
* Improve how the extend lines collision is calculated.
* Added `S` key to switch between modes.
* Now extend factor does not disable visual aids (thi sis done with checkbox).
* Reduce the use of linked list and now memory array is used.
* Refactor Radius functions.
* Fixed bug of Radius mode when object is rotated.
* Cleanup code.
Differential Revision: https://developer.blender.org/D16022
|
|
This value was used to close gaps, but now with the new system is not needed.
Internally, still we need to keep a small leak size, but after doing a lot of test a
value of 3 is perfect, so it's harcoded.
|
|
|
|
The new names are:
* Radius
* Extend
The mode Radius + Extend has been removed.
Also, some code cleanup and format.
|
|
The motivation for this change: while working on an animation recently, I found that there are some gaps that won't close easily via stroke extension or leak size checking. In D14698, I attempted to address this by changing the algorithm of the raster-space flood fill. This patch attempts to address the same issue in vector space by adding two new cases where stroke extensions are added, as suggested by @frogstomp:
# **Points of high curvature:** when the curvature at a point is high enough that it's hard to visually distinguish between it and an endpoint, add a stroke extension out along the normal (pointing in the opposite direction of the stroke's acceleration.) This addresses cases where technically the endpoint points up, but there's a sharp corner right below it that should extend to connect.
# **Stroke endpoints within a radius**: when two endpoints are close together, regardless of the angle they make, connect them if they are within a radius. This addresses cases like where the two endpoints have effectively parallel tangents, so extensions won't close the gap.
Reviewed By: antoniov, mendio, frogstomp
Differential Revision: https://developer.blender.org/D14809
|
|
When a change happens which invalidates view layers the syncing will be postponed until the first usage.
This will improve importing or adding many objects in a single operation/script.
`BKE_view_layer_need_resync_tag` is used to tag the view layer to be out of sync. Before accessing
`BKE_view_layer_active_base_get`, `BKE_view_layer_active_object_get`, `BKE_view_layer_active_collection`
or `BKE_view_layer_object_bases` the caller should call `BKE_view_layer_synced_ensure`.
Having two functions ensures that partial syncing could be added as smaller patches in the future. Tagging a
view layer out of sync could be replaced with a partial sync. Eventually the number of full resyncs could be
reduced. After all tagging has been replaced with partial syncs the ensure_sync could be phased out.
This patch has been added to discuss the details and consequences of the current approach. For clarity
the call to BKE_view_layer_ensure_sync is placed close to the getters.
In the future this could be placed in more strategical places to reduce the number of calls or improve
performance. Finding those strategical places isn't that clear. When multiple operations are grouped
in a single script you might want to always check for resync.
Some areas found that can be improved. This list isn't complete.
These areas aren't addressed by this patch as these changes would be hard to detect to the reviewer.
The idea is to add changes to these areas as a separate patch. It might be that the initial commit would reduce
performance compared to master, but will be fixed by the additional patches.
**Object duplication**
During object duplication the syncing is temporarily disabled. With this patch this isn't useful as when disabled
the view_layer is accessed to locate bases. This can be improved by first locating the source bases, then duplicate
and sync and locate the new bases. Will be solved in a separate patch for clarity reasons ({D15886}).
**Object add**
`BKE_object_add` not only adds a new object, but also selects and activates the new base. This requires the
view_layer to be resynced. Some callers reverse the selection and activation (See `get_new_constraint_target`).
We should make the selection and activation optional. This would make it possible to add multiple objects
without having to resync per object.
**Postpone Activate Base**
Setting the basact is done in many locations. They follow a rule as after an action find the base and set
the basact. Finding the base could require a resync. The idea is to store in the view_layer the object which
base will be set in the basact during the next sync, reducing the times resyncing needs to happen.
Reviewed By: mont29
Maniphest Tasks: T73411
Differential Revision: https://developer.blender.org/D15885
|
|
This patch is a cleanup required before refactoring the view layer syncing
process {T73411}.
* Remove FIRSTBASE.
* Remove LASTBASE.
* Remove BASACT.
* Remove OBEDIT_FROM_WORKSPACE.
* Replace OBACT with BKE_view_layer_active_object.
* Replace OBEDIT_FROM_VIEW_LAYER with BKE_view_layer_edit_object.
Reviewed By: mont29
Maniphest Tasks: T73411
Differential Revision: https://developer.blender.org/D15799
|
|
The new factor allows to apply the current brush size to the
external stroke perimeter conversion done in draw mode.
|
|
Those strings were at least partly disambiguated:
- Area
- Zone
- Measurement
- Ease
- BBone Ease In / Out
- Back
- Camera BG image depth
- GP interpolate sequence
- Edge Crease
- Theme
- Jitter
- Brush
- GPencil
- Lens distorsion compositing node
- Cineon color management
- Black
- Gamma
- White
Reviewed By: mont29
Differential Revision: https://developer.blender.org/D15791
|
|
This new option converts the stroke to outline perimeter as soon as is drawn.
If no alternative material is set, the actual material is used.
The algorithm is similar to the new operator in D15664
Reviewed By: pepeland
Differential Revision: https://developer.blender.org/D15738
|
|
Use matching int/float/boo types for RNA callbacks.
|
|
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
|
|
|
|
I'm using the tool icons for the brush themselves.
Note: This includes a few brushes that are only defined in D15134.
Those are simply the icons rendered with a world background of #282828.
|
|
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
|
|
Add the following macros for enums as support for these features wasn't
all that obvious and there were some inconsistencies in their use.
- RNA_ENUM_ITEM_HEADING(name, description)
- RNA_ENUM_ITEM_SEPR
- RNA_ENUM_ITEM_SEPR_COLUMN
|
|
This commit makes PointerRNA passed to RNA path API const.
Main change was in the `path` callback for RNA structs, and indirectly
the `getlength` callback of properties.
|
|
This patch adjusts the UI layouts for the tool header and the tool
properties in sculpt mode in a few ways. The goals are to better group
related settings, keep fundamental settings easily accessible, fix the
availability of some options, and make better use of space.
1. Remove ID template in tool header
2. Rename "Add Amount" to "Count" for add brush
3. Add "use pressure" toggles to radius and strength sliders
4. Move strength falloff to a popover
5. Move many "Add" brush settings to popover called "Curve Shape"
6. Move two "Grow/Shrink" options to a popover called "Scaling"
7. Don't display "Falloff" panel in properties when it has no effect
See the differential revision for screenshots and more reasoning.
Differential Revision: https://developer.blender.org/D14922
|
|
This commit adds an option to interpolate the number of control points
in new curves based on the count in neighboring existing curves. The
idea is to provide a more automatic default than manually controlling
the number of points in a curve, so users don't have to think about
the resolution quite as much.
Internally, some utilities for creating new curves are extracted to a
new header file. These can be used for the various nodes and operators
that create new curves.
The top-bar UI will be adjusted in a separate patch, probably moving
all of the settings that affect the size and shape of the new curves
into a popover.
Differential Revision: https://developer.blender.org/D14877
|
|
Previously, the number of control points in a new curve was hardcoded.
Differential Revision: https://developer.blender.org/D14857
|
|
Now it's possible to use auto masking at 3 levels:
* Stroke
* Layer
* Material
The masking options can be combined and allows to limit the effect of the sculpt brush.
Diff Revision: https://developer.blender.org/D14589
|
|
Differential Revision: https://developer.blender.org/D14748
|
|
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
|
|
Ref T97444.
Differential Revision: https://developer.blender.org/D14700
|
|
This was one of multiple placeholder brushes to simplify development.
Having it is not necessary anymore.
It was a brush that could add new curves according to a specific density.
This functionality will be brought back as a new brush later.
Ref T97255.
|
|
Also ensure space around text in C-comment blocks.
|
|
This adds a new Grow/Shrink brush which is similar to the Length
brush in the old hair system.
* It's possible to switch between growing and shrinking by hold
down ctrl and/or by changing the direction enum.
* 3d brush is supported.
* Different brush falloffs are supported.
* Supports scaling curves uniformly or shrinking/extrapolating
them. Extrapolation is linear only in this patch.
* A minimum length settings helps to avoid creating zero-sized curves.
Differential Revision: https://developer.blender.org/D14474
|
|
This patch makes the grease pencil smooth operation symmetric.
It also increases the performance a lot if strong smoothing is
required. Additionally there is an option for the position smooth
operation to keep the shape closer to the original for more iterations.
Since the result differs from the previous algorithm, versioning is used
to change the iterations and factor to match the old result.
Differential Revision: http://developer.blender.org/D14325
|
|
This adds a new Add brush for the new curves object type in sculpt mode.
The brush is used to insert new curves (typically hair) on the surface object.
Supported features:
* Add single curve exactly at the cursor position when `Add Amount` is 1.
* Front faces only.
* Independent interpolate shape and interpolate length settings.
* Smooth and flat shading affects curve shape interpolation.
* Spherical and projection brush.
This also adds the `surface_triangle_index` and `surface_triangle_coordinate`
attributes. Those store information about what position on the surface each
added curve is attached to:
* `surface_triangle_index` (`int`): Index of the internal triangle that a curve
is attached to. `-1` when the curve is not attached to the surface.
* `surface_triangle_coordinate` (`float2`): First two numbers of a barycentric
coordinate that reference a specific position within the triangle.
Ref T96444.
Differential Revision: https://developer.blender.org/D14340
|
|
|
|
The constant M_PI_4 is added to GLSL to ensure it works there too.
Differential Revision: https://developer.blender.org/D14288
|
|
The brushes that are still called "Test" still need to be changed
until they can get their correct name.
Ref T96259.
|
|
The exact behavior of the brushes is still being iterated on, but it
helps having a base implementation that we can work upon.
All of that is still hidden behind an experimental feature flag anyway.
The brushes will get a name in the ui soon.
Differential Revision: https://developer.blender.org/D14241
|
|
Correct misspellings in code comments of "vertex" and "vertices".
See D13932 for more details.
Differential Revision: https://developer.blender.org/D13932
Reviewed by Harley Acheson
|
|
This adds a prototype for the first brush that can add new curves by
painting on a surface. Note that this can only be used when the curves
object has a surface object set in the properties panel.
The brush can take minimum distance into account. This allows
distributing curves with a somewhat consistent density.
Differential Revision: https://developer.blender.org/D14207
|
|
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
|
|
This is requested by artist for some animation styles where is necessary to fill the area, but create a gap between fill and stroke.
Also some code cleanup and fix a bug in dilate for top area.
Reviewed By: pepeland, mendio
Differential Revision: https://developer.blender.org/D14082
|