Age | Commit message (Collapse) | Author |
|
Also use doxy style function reference `#` prefix chars when
referencing identifiers.
|
|
Generally the evaluated mesh should not be changed, since that is the
job of the modifier stack. Current code is far from const correct in
that regard. This commit uses a const variable for the reult of
`BKE_object_get_evaluated_mesh` in some cases. The most common
remaining case is retrieving a BVH tree from the mesh.
|
|
|
|
|
|
|
|
SCULPT_nearest_vertex_get expects a distance, not a distance squared.
This should make symmetry work as expected, but it still can fail if the
mesh topology is not completely symmetrical.
Reviewed By: JacquesLucke
Maniphest Tasks: T89221
Differential Revision: https://developer.blender.org/D11642
|
|
|
|
This patch fixes many minor spelling mistakes, all in comments or
console output. Mostly contractions like can't, won't, don't, its/it's,
etc.
Differential Revision: https://developer.blender.org/D11663
Reviewed by Harley Acheson
|
|
After looking into task isolation issues with Sergey, we couldn't find the
reason behind the deadlocks that we are getting in T87938 and a Sprite Fright
file involving motion blur renders.
There is no apparent place where we adding or waiting on tasks in a task group
from different isolation regions, which is what is known to cause problems. Yet
it still hangs. Either we do not understand some limitation of TBB isolation,
or there is a bug in TBB, but we could not figure it out.
Instead the idea is to use isolation only where we know we need it: when
holding a mutex lock and then doing some multithreaded operation within that
locked region. Three places where we do this now:
* Generated images
* Cached BVH tree building
* OpenVDB lazy grid loading
Compared to the more automatic approach previously used, there is the downside
that it is easy to miss places where we need isolation. Yet doing it more
automatically is also causing unexpected issue and bugs that we found no
solution for, so this seems better.
Patch implemented by Sergey and me.
Differential Revision: https://developer.blender.org/D11603
|
|
These were limited to obvious cases. Some less obvious cases
were kept as refactoring might make them necessary in future.
|
|
|
|
Under some circumstances using task isolation can cause deadlocks.
Previously, our task pool implementation would run all tasks in an
isolated region. Now using task isolation is optional and can be
turned on/off for individual task pools.
Task pools that spawn new tasks recursively should never enable
task isolation. There is a new check that finds these cases at runtime.
Right now this check is disabled, so that this commit is a pure refactor.
It will be enabled in an upcoming commit.
This fixes T88598.
Differential Revision: https://developer.blender.org/D11415
|
|
2 sided faces aren't supported and will cause problems in many areas
of Blender's code.
Removing (implied) support for faces with fewer than 3 sides
means the total number of triangles is known ahead of time.
This simplifies adding support for multi-threading and partial updates
to an existing tessellation - as the face and loop indices can be used
to access the range of triangles associated with a face.
Also correct outdated comments.
|
|
|
|
When projecting into screen space Z value isn't always needed.
Add 2D projection functions, renaming them to avoid accidents
happening again.
- Add GPU_matrix_project_2fv
- Add ED_view3d_project_v2
- Rename ED_view3d_project to ED_view3d_project_v3
- Use the 2D versions of these functions when the Z value isn't used.
|
|
Error in 87cafe92ce2f99d8da620b80e1c26f8078554f93
|
|
Some warnings remain that require larger changes.
|
|
|
|
Expand is not expected to update the visibility state of the PBVH, only
the Face Sets IDs. If visibility updates are made accidentally, PBVH
rendering breaks.
In order for this to work properly, the following fixes are needed:
- Expand should always check for active component before attempting to
modify a Face Set ID
- Expand should always check the visibility state on original_face_sets, as
it is the array that contains the visiblilty state that corresponds with the
current state used for PBVH rendering. This implies that after any modification
done by Expand, the visibility state of ss->face_sets and
expand_cache->original_face_sets should match (like in any other tool that
does not modify visibility).
- Expand should never modify the Face Set ID of a poly that is hidden in
expand_cache->original_face_sets.
- When deleting an ID, hidden Face Sets should be skipped when picking IDs for
content filling. This avoids introducing hidden IDs back into the visible
geometry even after updating its visibility state.
Reviewed By: JulienKaspar, JacquesLucke
Maniphest Tasks: T88230
Differential Revision: https://developer.blender.org/D11243
|
|
|
|
Sculpting tools are designed to ignore hidden geometry and behave like
hidden geometry does not exist.
When getting the neighbors of a vertex, now this takes into account
hidden geometry to avoid returing neighbors which connected edge is not
visible. This should make corner cases of a lot of tools work properly,
especially when working in low poly meshes when is common to have a
single face loop hidden.
Reviewed By: JacquesLucke
Differential Revision: https://developer.blender.org/D11007
|
|
When using a tool that is not a brush, the previously used brush
preset will still be active in the tool settings, so the cursor will
draw its custom reviews.
This checks if the current active tool is a brush before drawing its
previews. If it is not a brush tools, it draws a default white cursor.
Reviewed By: sergey
Differential Revision: https://developer.blender.org/D9418
|
|
|
|
Introduced when refactoring the function in
8815e3e3303933e2cc662f15fc9d11ca68a47d16
|
|
|
|
When checking if the mesh has only one Face Set only the current active
component for expand needs to be checked. Otherwhise other components
that won't be modified by Expand that contain other IDs will be taken
into account, making the Face Set deletion go into an infinite loop.
Reviewed By: JacquesLucke
Maniphest Tasks: T88060
Differential Revision: https://developer.blender.org/D11169
|
|
This add the missing keymaps.
Requested by Jukien Kaspar.
Differential Revision: https://developer.blender.org/D11183
|
|
Add missing operator poll, depend on the 3D view for all
sculpt paint/mask operators.
|
|
Face set visibility is already flushed to all mesh elements in the right
way in SCULPT_visibility_sync_all_face_sets_to_vertices, calling
BKE_mesh_flush_hidden_from_verts is legacy code from the previous
visibility system that was causing the vertex visibility to take
priority over face sets. When hidding a single loop, all vertices of
those faces are still visibile, so this line was tagging all loop faces
visible. This was leaving mesh/face set visibiltiy in an unconsistent
state.
Reviewed By: JacquesLucke
Maniphest Tasks: T87474
Differential Revision: https://developer.blender.org/D11008
|
|
Automasking cache factors were missing in the pose brush deform function.
Reviewed By: JacquesLucke
Maniphest Tasks: T87596
Differential Revision: https://developer.blender.org/D11005
|
|
This was just not implemented for curve strokes when world spacing was
introduced in rB87cafe92ce2f.
Now do the equivalent of what was done in said commit in
'paint_space_stroke', now in 'paint_line_strokes_spacing' as well.
Maniphest Tasks: T87815
Differential Revision: https://developer.blender.org/D11098
|
|
|
|
Typo in {rBafcfc6eb0842}.
Maniphest Tasks: T87267
Differential Revision: https://developer.blender.org/D10915
|
|
Before this change, you could have the new sculpt symmetry code and the
older weight paint symmetry code active at the same time. This would
lead to users easily trashing their weigh paint data if they were not
careful when switching between modes.
Now the specific weight paint symmetry code is an exclusive toggle so
the user can't accidentally mirror strokes and vertex groups at the same
time. This also paves the way of supporting Y and Z symmetry in the
future for weight groups mirroring if we decide to add it in the future.
Reviewed By: Sybren
Differential Revision: http://developer.blender.org/D10426
|
|
For projection painting tools besides the `DRAW` tool:
- Don't show the texture from viewport stencil drawing.
- Don't show the texture panel.
Based on D10564 by @lichtwerk with own changes.
|
|
|
|
|
|
Reviewed By: JacquesLucke
Differential Revision: https://developer.blender.org/D10707
|
|
This operator initializes mask values for the entire mesh. It supports
different modes for initializing those values, and more will be added in
the future.
The initial version supports generating a random mask per vertex, Face
Sets or loose parts. These masks are useful for introducing variations
in the model using the filters (both shapes and colors).
Reviewed By: JacquesLucke
Differential Revision: https://developer.blender.org/D10679
|
|
Sculpt undo relied on having a mode-changing undo step to properly
apply changes.
However this isn't the case with startup files or when mixing
global undo steps with sculpt (see T82851, also fixed).
Undo stepping logic follows image_undosys_step_decode_undo.
|
|
Also correct typo.
|
|
|
|
A missing continue in this loop.
Reviewed By: JacquesLucke
Differential Revision: https://developer.blender.org/D10610
|
|
This adds an extra option to the Face Sets Init operator to initialize
individual Face Sets based on the current Face Sets boundaries.
In particular, this is useful for splitting the patterns created by
Expand into individual Face Sets for further editing.
Reviewed By: JacquesLucke
Differential Revision: https://developer.blender.org/D10608
|
|
Prior to rB99a7c917eab7, Shift + D was used to set detail size for both
constant and relative detail (using radial control). The commit added an
improved operator for doing this for constant detail (showing the
triangle grid representation), but left the user without a shortcut to
do this for relative detail.
Interestingly rB99a7c917eab7 only changed this for the Blender keymap,
the Industy Compatible keymap still has the "old" entry.
This patch changes both keymaps to have both entries.
For user experience, the real change here is to have both available on
one 'primary' shortcut (Shift+D), the improved
'dyntopo_detail_size_edit' operator will now act on all possible cases.
If it deals with constant detail, it acts as before, if it deals with
relative detail etc, it will fallback to the "old" way of doing it via
radial control instead. I assume this adresses what was stated in
rB99a7c917eab7: "Deciding if both detail sizes can be unified needs a
separate discussion"
Also, move dyntopo_detail_size_edit to sculpt_detail.c
Fixes T83828
Maniphest Tasks: T83828
Differential Revision: https://developer.blender.org/D9871
|
|
The commit rB6f63417b500d that made exact boolean work on meshes
with holes (like Suzanne) unfortunately dramatically slowed things
down on other non-manifold meshes that don't have holes and didn't
need the per-triangle insideness test.
This adds a hole_tolerant parameter, false by default, that the user
can enable to get good results on non-manifold meshes with holes.
Using false for this parameter speeds up the time from 90 seconds
to 10 seconds on an example with 1.2M triangles.
|
|
Can use const parameter.
|
|
Warning: else-after-return/break
|
|
Also use doxygen comments for sculpt functions.
|
|
Expand is a new operator for Sculpt Mode which is intended to be the main
tool for masking, Face Set editing, interacting with the filters and pattern
creation.
The fundamentals of the tool are similar to the previous sculpt.mask_expand
operator. It shares the same default shortcuts and functionality, making
the previous operator obsolete.
The shortcuts to execute the operator are:
- Shift + A: Expand mask
- Shift + Alt + A: Expand mask by normals
- Shift + W: Expand Face Set
- Shift + Alt + W: Resize current Face Set
The main changes compared to the previous sculpt.mask_expand operator are:
- Modal keymap, all operator options can be changed in real time while the
operator is running.
- Supports creating Mask, Face Sets and Sculpt Vertex Colors.
- Much better code, new features can be easily integrated.
Limitations:
- All Mask operations are supported for Sculpt Vertex colors, but not exposed
by default as their support is still experimental.
- Dyntopo does not support any Face Set or Sculpt Vertex Colors. functionality
(they are not implemented in general for Dyntopo).
- Multires does not support any feature related to geodesic distances.
- Multires does not support vertex colors.
- Multires does not support recursions.
- In Multires, Face Sets snaping does not initialize all current enabled Face
Sets when toggling snapping.
- In Multires, Face Sets are created at base mesh level (works by this by
design, like any other tool).
- Unlike the previous mask_expand operator, this one does not blur the mask
by default after finishing Expand as that does not fit the new design.
The mask can still be blurred by using the mask filter manually.
Reviewed By: JacquesLucke
Differential Revision: https://developer.blender.org/D10455
|