Age | Commit message (Collapse) | Author |
|
At first sight this code should not build at all
but due to the use of macro's that look like functions
this seemingly has no issues building.
Clang-format alerted me to this strange bit of code
by placing the `if` on it's own line for some reason.
added the missing brackets, and clang-format is happy
again.
|
|
This refactors Box Mask and Lasso mask making both functions share the
same code. After this change it should be easier to add new
functionality, new gesture tools or implement new gesture modes.
No functional changes.
Reviewed By: sergey
Differential Revision: https://developer.blender.org/D8707
|
|
This implements Snake Hook as a deform type for the cloth brush. This
brush changes the strength of the deformation constraints per brush step
to avoid affecting the results of the simulation as much as possible. It
allows to grab the cloth without producing any artifacts in the surface
and create more natural looking folds than any of the other deformation
modes.
Reviewed By: sergey
Differential Revision: https://developer.blender.org/D8621
|
|
In 2.83 and previous versions there was a bug that was causing boundary
vertices to be detected incorrectly that was preventing the smooth brush
to work on boundaries if there was a pole on them.
In 2.90 the boundary vertex detection was fixed, but it was still using a
simplified version of the algorithm without any boundary smoothing. This
patch implements a similar smoothing algorithm to what I think it was
the intention of 2.83 and previous versions, but working correctly.
Reviewed By: sergey
Maniphest Tasks: T80008
Differential Revision: https://developer.blender.org/D8680
|
|
This moves the allocation for filter to separate functions, removes all
repeated calls to RNA_enum_get an fixes some other code quality issues.
Reviewed By: sergey
Differential Revision: https://developer.blender.org/D8639
|
|
|
|
This updates the view navigation origin after modifying the pivot
position.
Reviewed By: sergey
Maniphest Tasks: T79924
Differential Revision: https://developer.blender.org/D8632
|
|
Cloth deform brushes (both in cloth brush or other tools with cloth
simulation targets) should not have their spacing as a value relative
the brush radius to avoid affecting the simulation speed when changing
the brush radius.
Reviewed By: sergey
Differential Revision: https://developer.blender.org/D8620
|
|
This adds the orientation modes to the Cloth Filter.
Similar to the mesh filter, they set the orientation of the axis when
limiting the forces.
When using the gravity mesh filter, the orientation also sets the gravity
direction. In world orientation, cloth will always fall towards the
ground plane. In view mode, cloth will always fall down relative to the
view.
Reviewed By: sergey
Differential Revision: https://developer.blender.org/D8618
|
|
|
|
|
|
And use manual save/restore mechanism.
The stack method is not used so much to be considered useful.
|
|
|
|
We now use GPU_blend for enabling / disabling blending and explicitly
set the blend equation.
|
|
|
|
This make use of the GLStateStack functions for:
- `GPU_blend()`
- `GPU_blend_set_func()`
- `GPU_blend_set_func_separate()`
The goal is to unify them using an explicit state setting.
This will remove the need to use obscure blend functions
|
|
This adds a new brush property called "Deformation Target" which
controls how the brush deformations is going to affect the mesh data. By
default is set to Geometry, which makes the brushes displace the
vertices. When set to Cloth Simulation, the deformation of the brush is
applied to the cloth solver constraints, so the simulation is
responsible to apply the final deformation. This allows to add cloth
simulation effects to other sculpt tools with minor modifications to their
code.
This patch enables Cloth Simulation deformation target for Pose and
Boundary brushes, which are tools that are already designed to work in
low poly counts and produce large deformations. This allows creating the
most common cloth effects, like bending and compressing folds, without
relying on collisions.
Reviewed By: sergey
Differential Revision: https://developer.blender.org/D8578
|
|
Same concept as the Multires Displacement Eraser Brush but implemented
as a mesh Filter. This allows to delete the displacement of an entire
area uniformly.
Reviewed By: sergey
Differential Revision: https://developer.blender.org/D8608
|
|
Exact same operation as D8509, implemented as a Mesh Filter.
Reviewed By: sergey
Differential Revision: https://developer.blender.org/D8510
|
|
This enables the invert mode in the smooth brush as Enhance Details.
The operation is similar to the Sharpen Filter intensify details parameter,
which consist in applying the laplacian smooth displacement in the opposite
direction calculated using the original coordinates.
Reviewed By: sergey
Differential Revision: https://developer.blender.org/D8509
|
|
The evaluated mesh is now only recomputed when the required data layers
are missing. Previously the evaluated mesh was re-evaluated incorrectly,
which caused the stippled result and the failing assert.
Since now only the evaluated mesh is used, and never a temporary mesh,
there is also no more need to keep track of whether the mesh needs
freeing or not.
Reviewed By: sergey
Differential Revision: https://developer.blender.org/D8574
|
|
Previously, the XYZ deform axis of the Mesh Filter were limited to
object space (which is the default for sculpt mode). Now it is possible
to limit the XYZ displacement in Local, Global or View space.
Reviewed By: sergey
Differential Revision: https://developer.blender.org/D8582
|
|
This uses the same concept of the Mesh Filter but for applying the cloth
filter forces, so now it can be limited to a specific axis.
Reviewed By: sergey
Differential Revision: https://developer.blender.org/D8567
|
|
Functions `mesh_create_eval_final_view()` and
`mesh_create_eval_final_render()` were doing the exact same thing,
except for a hack introduced in d3eb9dddd6b4 (2012-10-08, Better fix for
T32846: dupligroup messes up particle instancing on rendering) that
appears to be no longer necessary. Besides that, these functions had
confusing names. Their functionality changed over time, and whether to
do for-render or for-viewport evaluation is now actually determined by
the depsgraph evaluation mode. This means that the `..._render` function
could evaluate a mesh with viewport settings, and vice versa.
The functions are now merged into `mesh_create_eval_final()`, and the
hack has been removed. The `OB_NO_PSYS_UPDATE` flag has been removed
entirely (instead of keeping it around as deprecated flag), because it
was always only temporarily set on objects during mesh evaluation and
thus not saved to the blend file.
No expected functional changes as far as users are concerned.
|
|
Reviewed By: sergey
Differential Revision: https://developer.blender.org/D8556
|
|
Even the Cloth Brush grab works like a regular grab brush, it makes
sense to support spacing just in this brush in order to prevent creating
more brush steps that update the simulation. This way, it is possible to
create grab brushes that update the simulation constantly while grabbing
(using the dots stroke mode) or brushes that only update the simulation
when the cursor moves (using spacing).
Reviewed By: sergey
Differential Revision: https://developer.blender.org/D8568
|
|
This code was left here after the refactor, it was doing nothing and it
was causing an assert.
Reviewed By: sergey
Differential Revision: https://developer.blender.org/D8579
|
|
The Face Set visibility operator was using the last active Face Set
updated by the paint cursor, so when the paint cursor is not used (when
using a filter or a transform tool), the active Face Set was not updating
and it was hidding the wrong Face Set based on the last cursor position
with a brush tool active. Now the Face Set Visitility operator has an
invoke callback wich forces a active vertex and face set update
regardless of the active tool, so it should always work correctly.
Reviewed By: sergey
Differential Revision: https://developer.blender.org/D8580
|
|
This was a TODO in the code. Previously the Face Set datalayer was
deleted and recreated with a constant ID of 0. Now the datalayer is
preserved and set to the SculptSession after slicing the mask and a new
ID is calculated for the new faces that the slicing operation produced,
so they can be easily isolated for further tweaking.
Reviewed By: sergey
Differential Revision: https://developer.blender.org/D8583
|
|
This will be used for new features like supporting cloth deformation in
other brushes and tools outside of the cloth brush code.
No functional changes.
Reviewed By: sergey
Differential Revision: https://developer.blender.org/D8602
|
|
The paint cursor now uses a single call to
SCULPT_cursor_geometry_info_update and the Sculpt API to update both the
radius and the SculptSession data, so random access needs to be
initialized for dyntopo before using API functions.
Reviewed By: sergey
Maniphest Tasks: T79597
Differential Revision: https://developer.blender.org/D8489
|
|
|
|
Remove extra words in the message and avoid repeating
the name in the description.
|
|
|
|
|
|
When using constant falloff symmetry was working fine because the same
deformation is applied twice on the same vertices. When using no
constant falloffs, the deformation is different between symmetry passes,
so vertices need to be separated by symmetry areas to get the right
deformation from its symmetry pass without being overwriten by the next
one.
Reviewed By: sergey
Differential Revision: https://developer.blender.org/D8541
|
|
This adds the boundary_falloff_type and boundary_offset to control how the
falloff of the Boundary Brush is applied.
Boundary Origin Offset is the same concept as the Pose Origin offset in
the Pose Brush. It is a multiplier that adds extra length to the brush
radius to locate the deformation pivot further from the boundary without
affecting the falloff.
The Falloff type includes Constant (previous default), brush radius, loop
and loop and invert. Loop and Loop and Invert can be used to create
deformation patterns in a mesh.
Reviewed By: sergey
Differential Revision: https://developer.blender.org/D8526
|
|
This brush deletes displacement information of the Multires Modifier,
resetting the mesh to the subdivision limit surface.
This can be use to easily delete parts of the sculpt or to fix
reprojection artifacts after applying a shrinkwrap.
Reviewed By: sergey
Differential Revision: https://developer.blender.org/D8543
|
|
Previously the way to use this operations was using the shortcut Ctrl +
W and Ctrl + Alt + W, which was not very discoverable and it was
limiting the amount of options that can be added to the operator.Now the
same functionality of the operator is available as a tool, which will
make easier to add other editing operations and options without adding
more entries to the keymap.
Reviewed By: sergey
Differential Revision: https://developer.blender.org/D8545
|
|
Differential Revision: https://developer.blender.org/D8553
|
|
Reviewed By: sergey
Differential Revision: https://developer.blender.org/D8529
|
|
Reviewed By: sergey
Differential Revision: https://developer.blender.org/D8528
|
|
Reviewed By: sergey
Differential Revision: https://developer.blender.org/D8523
|
|
|
|
For a locked shapekey, a SculptSession's orig_cos / deform_cos /
deform_imats are not initialized (they only are when
deform_modifiers_active is true -- this in turn is only true for
shapekeys if they are //not// locked [and for deforming modifiers of
course])
We can just update that keyblock with sculpt_update_keyblock() in case
of a locked shapekey
Maniphest Tasks: T79622
Differential Revision: https://developer.blender.org/D8499
|
|
This options allows to perform Face Sets operations while preserving the
mesh visibility. Edit hidden face sets is enabled by default in order to
expand the visible area of the mesh with the grow/shrink operator, but
this can be changed in the keymap per edit operation as more operations
are supported.
Reviewed By: sergey
Differential Revision: https://developer.blender.org/D8029
|
|
|
|
This adds a property that checks the normals of each vertex against the
view direction to decide if they should be masked (similar to the
"Front Faces Only" option works for brushes.
Reviewed By: sergey
Maniphest Tasks: T77637
Differential Revision: https://developer.blender.org/D8448
|
|
This brush includes a set of deformation modes designed to deform and
control the shape of the mesh boundaries, which are really hard to do
with regular sculpt brushes (and even in edit mode). This is useful
for creating cloth assets and hard surface base meshes.
The brush detects the mesh boundary closest to the active vertex and
propagates the deformation using the brush falloff into the mesh.
It includes bend, expand, inflate, grab and twist deform modes.
The main use cases of this brush are the Bend and Expand deformation
modes, which depend on a grid topology to create the best results.
In order to do further adjustments and tweaks to the result of these
deformation modes, the brush also includes the Inflate, Grab and
Twist deformation modes, which do not depend that much on the topology.
Grab and Inflate are the same operation that is implemented in the
Grab and Inflate tools, they are also available in the boundary brush
as producing deformations with regular brushes in these areas is very
hard to control.
Even if this brush can produce deformations in triangle meshes and
meshes with a non-regular quad grid, the more regular and clean the
topology is, the better. Most of the assets this brush is intended to
deform are always created from a cylindrical or plane quad grid, so it
should be fine. Also, its algorithms can be improved in future versions
to handle more corner cases and topology patterns.
Reviewed By: sergey
Differential Revision: https://developer.blender.org/D8356
|
|
Also order sizeof(..) first to promote other values to size_t.
|