Age | Commit message (Collapse) | Author |
|
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 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
|
|
|
|
This replaces header include guards with `#pragma once`.
A couple of include guards are not removed yet (e.g. `__RNA_TYPES_H__`),
because they are used in other places.
This patch has been generated by P1561 followed by `make format`.
Differential Revision: https://developer.blender.org/D8466
|
|
This implements collisions in the solver of the cloth brush/filter. It
uses the scene colliders as a regular physics simulation.
There are still some parameters (friction, distance to the surface...)
that can be exposed as properties in later patches.
Thanks to Sebastian Parborg for helping me with the implementation.
Reviewed By: sergey, zeddb
Differential Revision: https://developer.blender.org/D8019
|
|
|
|
Face Sets where only set and updated on the PBVH after starting a sculpt
tool. In order to preserve the visibility they store when changing
levels, they need to be updated and sync also on PBVH creation
Reviewed By: sergey
Maniphest Tasks: T78665
Differential Revision: https://developer.blender.org/D8225
|
|
Previously, deform brushes were modifying the final positions in the
simulation directly, which was causing all sorts of artifacts in the
deformed area and problems with other features of the solver.
Now these brushes deform a separate array of positions and the solver
adds constraints to them, so the real vertices are moved when solving
the constraints. This prevents those artifacts and gives the brush a
much better behavior.
Reviewed By: sergey
Differential Revision: https://developer.blender.org/D8424
|
|
|
|
This property adds constraints to the simulation using the initial
location of the vertices, making it behave like a soft body. The
strength of these constraints can be modified with the brush parameter.
This makes some deformation modes more subtle and predictable, making it
possible to use the cloth brush to add surface detail in a more
controllable way without loosing completely the original shape of the
mesh.
Reviewed By: sergey
Differential Revision: https://developer.blender.org/D7845
|
|
for the first time
When there is no color layer available,
BKE_sculpt_update_object_for_edit creates a new one and tags the mesh
with ID_RECLAC_GEOMETRY, so this layer is inmediatly available when the
tool starts. This also deletes the PBVH and when it is created again in
BKE_sculpt_update_object_after_eval, the pmap is not initialized, making
the tool crash.
This moves the color layer creation to a separate function outside
BKE_sculpt_update_object_for_edit, which now runs after the color
layer is available, so it won't need to update again and the pmap will
still be available when the tool is used.
Reviewed By: sergey
Maniphest Tasks: T78242
Differential Revision: https://developer.blender.org/D8135
|
|
This issue was produced by a hack in the sculpt mode code from 2.80
when the sculpt API for connectivity info was not available.
The smooth brush was the only brush that needed connectivity info,
so there were 3 different smooth functions with the connectivity
queries implemented for dyntopo, meshes and grids. The mesh version
of smoothing was checking the number of connected faces to a vertex
to mask the mesh boundaries, which was not covering all cases and
was hardcoded in the smooth function itself.
This patch removes all those legacy functions and unifies all
smooth functions into a single one using the new API and the
automasking system. In order to achieve this, there were needed
some extra changes:
- The smooth brush now does not automasks the boundaries by default,
so its default preset needs to be updated to enable automasking
- The mesh boundary info is extracted once and cached in a
bitmap, similar to the disconnected elements IDs. This makes
boundary detection work as expected in all cases, solving a lot
of known issues with the smooth brush. In multires, this info is
extracted and cached only at the base mesh level, so it is much
more memory efficient than the previous automasking system.
- In order to keep the brushes responsive as they were before,
the automasking system can now skip creating the cache when it
is not needed for the requested options. This means that for
high poly meshes and simple automasking options the brushes
won't lag on start.
Reviewed By: sergey
Maniphest Tasks: T78747
Differential Revision: https://developer.blender.org/D8260
|
|
I spotted a duplicate struct declaration, so I had to check for other duplicated as well
There might be some other but i am not confident enough for deleting them
this regex search for duplicate ^(.*;)$\n(\1)$
Reviewed By: JacquesLucke
Differential Revision: https://developer.blender.org/D8146
|
|
|
|
This renames the layer persistent base and adds new API functions to get
the mesh state from the base, so it can be used from other tools and
replaced in the future with a better system.
Reviewed By: sergey
Maniphest Tasks: T77738
Differential Revision: https://developer.blender.org/D8003
|
|
This option allows posing meshes with different disconnected elements
using the Pose Brush.
This is achieved by doing the following:
- Creating an ID per vertex that stores the connected component of that vertex.
- By using those IDs, one fake topology connection is created per vertex to the nearest vertex in a different ID. The maximum distance to create that connection is determined by the "Max Element Distance" property. These fake connectivity neighbors are used in the Sculpt API functions iterators, so all the algorithms of the Pose Brush can run without modifications as if everything was part of the same mesh.
In order to make this work, the "Connected only" property of the Pose Brush needs to be disabled. This will add an extra performance cost to the Pose Brush and its preview. To achieve optimal results, max element distance should be as low as possible.
Reviewed By: sergey, campbellbarton
Differential Revision: https://developer.blender.org/D7282
|
|
The report does not include any file, but probably that file is using the
settings for unified colors, which are currently not available in the UI,
so it always paints black. This enables unified colors and secondary
colors for sculpt vertex colors, so it should solve that issue.
Unified color does not make much sense now as the Paint tool is the only
one that has paint capabilities, but it will do in the future when
sculpt and paint at the same time is enabled and the paint capability is
added to more tools.
Reviewed By: sergey
Maniphest Tasks: T78323
Differential Revision: https://developer.blender.org/D8136
|
|
|
|
Sculpt Vertex Colors is a painting system that runs inside sculpt mode, reusing all its tools and optimizations. This provides much better performance, easier to maintain code and more advanced features (new brush engine, filters, symmetry options, masks and face sets compatibility...). This is also the initial step for future features like vertex painting in Multires and brushes that can sculpt and paint at the same time.
This commit includes:
- SCULPT_UNDO_COLOR for undo support in sculpt mode
- SCULPT_UPDATE_COLOR and PBVH flags and rendering
- Sculpt Color API functions
- Sculpt capability for sculpt tools (only enabled in the Paint Brush for now)
- Rendering support in workbench (default to Sculpt Vertex Colors except in Vertex Paint)
- Conversion operator between MPropCol (Sculpt Vertex Colors) and MLoopCol (Vertex Paint)
- Remesher reprojection in the Voxel Remehser
- Paint Brush and Smear Brush with color smoothing in alt-smooth mode
- Parameters for the new brush engine (density, opacity, flow, wet paint mixing, tip scale) implemented in Sculpt Vertex Colors
- Color Filter
- Color picker (uses S shortcut, replaces smooth)
- Color selector in the top bar
Reviewed By: brecht
Maniphest Tasks: T72866
Differential Revision: https://developer.blender.org/D5975
|
|
Introduced in D8007
|
|
Previously, constraints were added multiple times from different
vertices. This adds a GSet to check that the same constraint is not
being added twice when iterating over the neighbors of two different
vertices.
Reviewed By: zeddb
Differential Revision: https://developer.blender.org/D8007
|
|
This operator performs an edit operation in the active face set defined
by the cursor position and updates the visibility. For now, it has a
Grow and Shrink operations, similar to Select More/Less in edit mode or
to the mask filter Grow/Shrink modes. More operations can be added in
the future.
In multires, this updates the visibility of an entire face from the base
mesh at once, which makes it very convenient to edit the visible area
without manipulating the face set directly.
Reviewed By: sergey
Differential Revision: https://developer.blender.org/D7367
|
|
This implements squash and stretch as a deform mode for the Pose Brush.
It is similar to scale, but it applies different scale values in different
axis. To achieve this, the pivot local space of the transform needs to
be aligned to the segment when using this deform mode to apply the scale
in the correct direction.
Reviewed By: sergey
Differential Revision: https://developer.blender.org/D7934
|
|
Previously, the twist rotation was aligned using the stroke location.
This was causing unexpected results when rotating some Face Sets rigs.
Now the intersection with the first Face Set in the flood fill is used,
which produces much better results.
Reviewed By: sergey
Differential Revision: https://developer.blender.org/D7900
|
|
This is an alternative deformation brush for the Pose Brush intended
quickly change the proportions of the mesh. The regular mode scales
using the segment's origin as a pivot. The inverted mode drags the
entire segment using the grab delta.
The only difference with the regular pose brush is that it is not
compatible with IK, so the option is disabled and set to 1 segment. The
rest of the options should work as expected.
Reviewed By: sergey
Differential Revision: https://developer.blender.org/D7374
|
|
Conflicts:
release/scripts/startup/bl_ui/properties_render.py
source/blender/blenkernel/BKE_blender_version.h
|
|
Sculpt overlay assumed that the sculpt session was always in sculpt
mode. But the sculpt session was also used for Vertex/Weight painting.
This resulted that when a mask was defined in the sculpt mode this
resulted into render artifacts.
This patch adds a check to see if the object has a sculpt session for
OB_MODE_SCULPT.
Reviewed By: Clément Foucault
Differential Revision: https://developer.blender.org/D7704
|
|
|
|
Surrounding includes with an 'extern "C"' block is not necessary anymore.
Also that made it harder to add any C++ code to some headers, or include headers
that have "optional" C++ code like `MEM_guardedalloc.h`.
I tested compilation on linux and windows (and got help from @LazyDodo).
If this still breaks compilation due to some linker error, the header containing
the symbol in question is probably missing an 'extern "C"' block.
Differential Revision: https://developer.blender.org/D7653
|
|
Multires uses the data of the Face Sets stored in the base mesh to
manage the grid's visibility, so these pointers can no longer be set to
NULL when editing Multires objects as they are requried for some operations.
Reviewed By: sergey
Differential Revision: https://developer.blender.org/D7431
|
|
The Layer brush was in Blender before 2.81, when the sculpt API was
introduced. It had a huge amount of bugs and glitches which made it
almost unusable for anything but the most trivial cases. Also, it needed
some hacks in the code just to support the persistent base.
The brush was completely rewritten using the Sculpt API. It fulfills the
same use case as the old one, but it has:
- All previous artifacts fixed
- Simpler code
- Persistent base now works with multires thanks to the sculpt API
- Small cursor widget to preview the layer height
- More controllable and smoother strength and deformation
- More correct masking support
- More predictable invert support. When using persistent base, the brush invert mode resets to layer height 0, instead of jumping from +1 to -1. The brush can still be inverted in the brush direction property.
Reviewed By: jbakker
Differential Revision: https://developer.blender.org/D7147
|
|
Allows to know what level sculpting has been done after the value has
been changed in the MultiresModifierData.
No functional changes, just preparing code to have everything needed
for propagation undo.
Differential Revision: https://developer.blender.org/D7307
|
|
This fixes the following issues:
- Previously, the face set from the active vertex was used directly. Vertices always return the most recently created face set, so in some cases there may be some face sets that were not possible to select as active. Now the active face set is set in the ray intersection, so it always matches the face under the cursor.
- When drawing face sets they were set per vertex, so it was not possible to paint one face at a time. Now face sets are painted per poly when using the brush on meshes, testing the distance to the center of each poly.
- The code for the active vertex on PBVH_GRIDS was not correct, so I also fixed that to test if everything was working correctly.
{F8441699}
Reviewed By: jbakker
Differential Revision: https://developer.blender.org/D7303
|
|
This implements the Sculpt Mode API functions needed for Face Sets and
visibility management for PBVH_GRIDS. No major changes were needed in
the operators and the sculpt mode code. This implementation stores the
face sets in the base mesh, so faces created in higher subdivision
levels can't be modified individually. Also, we are not checking for
multiple face sets per vertex (that can be added in the future), so
relax tools don't work yet. The rest of the features (paint, undo,
visibility operators..) work as expected.
Reviewed By: brecht
Differential Revision: https://developer.blender.org/D7168
|
|
|
|
|
|
This commit is a full refactor of the grease pencil modules including Draw Engine, Modifiers, VFX, depsgraph update, improvements in operators and conversion of Sculpt and Weight paint tools to real brushes.
Also, a huge code cleanup has been done at all levels.
Thanks to @fclem for his work and yo @pepeland and @mendio for the testing and help in the development.
Differential Revision: https://developer.blender.org/D6293
|
|
|
|
|
|
Face Sets are the new system to control the visibility state of the mesh in sculpt and paint modes. They are designed to work in modes where brushes are the primary way of interaction and they provide much more control when working with meshes with complex shapes and overlapping surfaces.
This initial commit includes:
- Sculpt Face Sets data structures and PBVH rendering.
- Face Set overlay and opacity controls.
- Sculpt Undo support.
- Remesher reprojection support. The visibility state of the mesh is also preserved when remeshing.
- Automasking and Mesh filter support.
- Mask expand operator mode to expand Face Sets (Shift + W) and flood fill areas by connectivity (press Ctrl while expanding).
- Sculpt Mode Face Sets and Visibility API.
- Sculpt Face Sets creation and visibility management operators.
- Operator to randomize the Face Sets colors.
- Draw Face Sets brush tool to create and edit the Face Sets. Drawing on the mesh creates a new Face Set. Pressing Ctrl before drawing modifies the Face Set under the brush at the beginning of the stroke.
- Updated keymap and menu to work with Face Sets from Sculpt Mode (H to toggle visibility, Alt + H to show all, Shit + H to hide).
- Pie menu on the W key with Face common Sets operations.
Know limitations:
- Multires support. The Face Sets and Visibility API needs to be implemented for Multires.
Reviewed By: jbakker, #user_interface, Severin
Differential Revision: https://developer.blender.org/D6070
|
|
Instead of using anonymous booleans flags, also allows to keep the same
behavior in all cases, without needing special handling from calling
code for our beloved oddballs object proxies...
|
|
|
|
This brush has a simple physics solver that helps when sculpting cloth.
- The mass and the damping properties of the simulation are properties of the brush.
- It has two additional radius control to limit the influence and falloff of the simulation.
- Masked vertices are pinned in the simulation, and it applies the sculpt gravity directly in the solver.
- The Cloth Brush has 7 deformation modes with 2 falloff types (radial and plane).
The brush can create the constraints only on the required PBVH nodes, so the simulation is isolated on high poly meshes. As long
as the brush size is not too big it should be possible to keep it real time.
Known issues:
- The way constraints are created is extremely basic and it creates repeated constraints. Maybe there is another way to create fewer constraints while keeping the simulation quality decent. This part can also be multithreaded. (As it is it works ok, but it could be better)
Reviewed By: jbakker
Differential Revision: https://developer.blender.org/D6715
|
|
- Replace 'unsigned' used on it's own with 'uint'.
- Replace 'unsigned const char' with 'const uchar'.
|
|
PoseIKChain for example reads as if this is related to armature/pose
when it's a sculpting feature.
|
|
This commits introduces the pose_ik_segments brush property in the Pose Brush. When increasing the IK segments count, the brush generates more segments and weights associations following the topology of the mesh. When moving the brush, these segments are transformed using an IK solver and they are used to deform the mesh.
When pressing Ctrl, the brush controls the segments' roll rotation instead of using the IK solver. The brush falloff controls how much rotation is propagated from the first to the last segment in the chain.
Reviewed By: jbakker
Differential Revision: https://developer.blender.org/D6389
|
|
Viewport: Disable Clipping For EEVEE and External Renderers
Currently it is possible that, when using viewport clipping, the display and tools communicate
different information to the user then the renderer does. The reason is
that the renderer does not support viewport clipping. Both EEVEE and
Cycles do not support it.
This patch will disable the clipping in all the tools and drawing code
when the viewport drawing mode is `Material Preview` or `Rendered`.
This patch introduces a `RV3D_CLIPPING_ENABLED` util that checks if
clipping is enabled for the given `rv3d` and `v3d`. Also in places where
it was needed we added the `ViewContext` as a carrier for the `View3D`
and `RegionView3D`.
There are a few areas in the tooling (select, projection painting) that
still needs to be tackled after this patch.
Reviewed By: fclem
Differential Revision: https://developer.blender.org/D6047
|
|
Issue likely caused by 8b31f6fb2169.
With this, initializing the toolsystem (e.g. for a new workspace-scene
combination) would skip the entire create->initialize routine for
image/texture painting settings. Reason being that these are not
allocated, unlike other paint settings. So while correctly skipping the
create part, it also skipped the initialization, which was still needed.
This does further changes in related code to avoid NULL pointer
accesses.
|
|
This introduces object mode tagging for data which hasn't yet been
written back to the ID data.
Now when selecting other sculpt objects, the original objects data is
flushed back to the ID before writing a memfile undo step.
|
|
|