Commit Graph

40 Commits

Author SHA1 Message Date
luzpaz a4a9d14ba7 UI: Fix Typos in Comments and Docs
Approximately 91 spelling corrections, almost all in comments.

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

Reviewed by Harley Acheson
2021-02-05 19:08:14 -08:00
Harley Acheson 84ef3b80de Spelling: Miscellaneous
Corrects 34 miscellaneous misspelled words.

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

Reviewed by Campbell Barton
2020-10-19 09:11:00 -07:00
Pablo Dobarro 478ea4c898 Sculpt: Multires Displacement Eraser Brush
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
2020-08-12 18:26:56 +02:00
Jacques Lucke 91694b9b58 Code Style: use "#pragma once" in source directory
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
2020-08-07 09:50:34 +02:00
Pablo Dobarro 3ebe97c06b Fix T78665: Face Set visibility reverted when chaning Multires Levels
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
2020-08-04 23:33:51 +02:00
Pablo Dobarro e5ebaa9fd6 Fix T78664: Implement Mesh and Face Set boundary automasking in Multires
This implements the SCULPT_vertex_is_boundary and SCULPT_vertex_has_unique_face_set functions for PBVH_GRIDS, which makes features such as automasking now work in multires. It also fixes some other face sets related features in multires, like face set boundary smoothing.

This uses the BKE_subdiv_ccg_coarse_mesh_adjacency_info_get function to get the vertex indicies in the base mesh from multires. This way the API functions can get topology or face set information directly from it. In the future, these vertex indices can be used to get any other information from the base mesh from multires, like seams, sharp edges, disconnected elements IDs...

Reviewed By: sergey

Maniphest Tasks: T78664

Differential Revision: https://developer.blender.org/D8227
2020-07-09 17:48:24 +02:00
Sergey Sharybin b175bb2503 Subdiv CCG: Add access to first grid index of a face
Is lazily-initialized array owned by the SubdivCCG. Allows to access
index of a first grid of a given face in the flat array of grids.

Currently unused, but is needed for multires bake.
2020-06-22 17:22:53 +02:00
Campbell Barton af835ee6f8 Cleanup: use doxy sections for multires & subdiv sources 2020-04-29 12:21:12 +10:00
Sergey Sharybin 0fe3e38b57 Cleanup: Spelling in function name
Should be no functional changes.
2020-04-22 16:32:45 +02:00
Campbell Barton d52326bab3 Cleanup: spelling 2020-04-03 12:38:04 +11:00
Pablo Dobarro da3cb514e5 Multires: Initial Face Sets support
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
2020-04-01 01:07:47 +02:00
Sergey Sharybin 3351a2655d Subdiv: Extend some comments 2020-03-30 12:26:45 +02:00
Dalai Felinto 2d1cce8331 Cleanup: `make format` after SortedIncludes change 2020-03-19 09:33:58 +01:00
Jacques Lucke 5de56f9596 Cleanup: make remaining blenkernel headers work in C++ 2020-03-02 15:07:49 +01:00
Brecht Van Lommel 10ec207a6b Sculpt: support automasking, pose and mask expand for multires
These were the last remaining new sculpt tools that did not support multires.
Performance could be improved still, but it should work.

Fixes T68899
2019-10-08 17:44:46 +02:00
Brecht Van Lommel 899b7ff1de Cleanup: avoid converting from CCGElem to SubdivCCGCoord
The other direction is faster.
2019-10-08 17:41:52 +02:00
Sergey Sharybin 8f1f756b83 Subdiv CCG: add utility functions for accessing multires vertex neighbors
This is to be used by the new sculpting tools.
2019-10-04 19:00:57 +02:00
Sergey Sharybin 9a4042bed8 Subdiv CCG: Cleanup, remove unused data from adjacency storage
Makes it easier to initialze adjacency, avoid extra re-allocations during
initialization, reduces memory footprint.
2019-10-03 12:36:01 +02:00
Campbell Barton a6a0a09197 Cleanup: spelling 2019-09-30 17:07:05 +10:00
Campbell Barton e12c08e8d1 ClangFormat: apply to source, most of intern
Apply clang format as proposed in T53211.

For details on usage and instructions for migrating branches
without conflicts, see:

https://wiki.blender.org/wiki/Tools/ClangFormat
2019-04-17 06:21:24 +02:00
Sergey Sharybin 3b132778de Multires: Support smooth shading when sculpting
On CCG side it is done similar to displacement, where we have
a dedicated functor which evaluates displacement. Might be seemed
as an overkill, but allows to decouple SubdivCCG from mesh entirely,
and maybe even free up coarse mesh in order to save some memory.

Some weak-looking aspect is the call to update normals from the
draw manager. Ideally, the manager will only draw what is already
evaluated. But it's a bit tricky to find a best place for this since
we avoid dependency graph updates during sculpt as much as possible.
The new code mimics the old code, this is how it was in 2.7.

Fix shading part of T58307.
2019-02-22 17:02:51 +01:00
Campbell Barton de13d0a80c doxygen: add newline after \file
While \file doesn't need an argument, it can't have another doxy
command after it.
2019-02-18 08:22:12 +11:00
Campbell Barton eef4077f18 Cleanup: remove redundant doxygen \file argument
Move \ingroup onto same line to be more compact and
make it clear the file is in the group.
2019-02-06 15:45:22 +11:00
Campbell Barton 4ef09cf937 Cleanup: remove author/date info from doxy headers 2019-02-02 11:58:24 +11:00
Campbell Barton 65ec7ec524 Cleanup: remove redundant, invalid info from headers
BF-admins agree to remove header information that isn't useful,
to reduce noise.

- BEGIN/END license blocks

  Developers should add non license comments as separate comment blocks.
  No need for separator text.

- Contributors

  This is often invalid, outdated or misleading
  especially when splitting files.

  It's more useful to git-blame to find out who has developed the code.

See P901 for script to perform these edits.
2019-02-02 01:36:28 +11:00
Sergey Sharybin d3ec4259af Subdiv CCG: Cleanup, comments 2019-01-18 12:29:53 +01:00
Sergey Sharybin 6ccf961915 Fix T59478: Information Bar Missing Data when in Sculpt Mode
Display statistics from CCG structure.

This makes values to be different from what is shown in object
mode, since CCG is operating on individual grids, and object
mode will stitch those grids. But on another, those values from
CCG is what sculpt mode is actually "sees" or "uses".

The number of faces should be the same in both sculpt and object
modes.
2018-12-18 14:22:12 +01:00
Brecht Van Lommel 342e73f90f Spelling fixes in comments and descriptions (2.8 changes), patch by luzpaz.
Differential Revision: https://developer.blender.org/D3719
2018-09-24 18:48:29 +02:00
Sergey Sharybin b32832a7e8 Subdiv: CCG, initialize grid mask from paint mask 2018-09-21 15:31:43 +02:00
Dalai Felinto cffae36381 Fix build for MSVC: Remove trailing double semicolon
Not sure why but MSVC is complaining for some of those.

In particular for the struct in BKE_subdiv_ccg.h. Those were the ones
crashing here..
2018-09-20 14:59:55 +00:00
Sergey Sharybin d3aafbddd9 Subdiv: CCG, store vertex adjacency information
Similar to previous commit, but for vertices.
2018-09-20 15:39:41 +02:00
Sergey Sharybin d511c72056 Subdiv: CCG, store edge adjacency information
This information is stored for each non-loose edge.

For each of such edge we store:

- List of CCG faces it is adjacent to.

  This way we can easily check whether it is adjacent to
  any face which is tagged for update or so.

- List of boundary elements from adjacent grids.

  This allows to traverse along the edge and average all
  adjacent grids.
2018-09-20 15:39:41 +02:00
Sergey Sharybin 0a596eda2a Subdiv: CCG, localize Mesh usage even more 2018-09-20 15:39:41 +02:00
Sergey Sharybin ebcbb50420 Subdiv: CCG, implement stitching of given faces
Will speed up (or rather bring speed back to what it is supposed to be)
for brushes like smooth.
2018-09-18 17:46:00 +02:00
Sergey Sharybin 9bf3e0299b Subdiv: CCG, initial grids stitching implementation
Currently is only working on an "inner" grid boundaries.
Need to implement averaging across face edges.
2018-09-18 17:09:08 +02:00
Sergey Sharybin 41c039d6e9 Subdiv: CCG, evaluate final position for multires
This makes it so coordinates and normals for CCG are calculated
with mutires displacement taken into account. This solves issues
with multires displacement being lost when entering sculpt mode.

The missing part is averaging of normals along grid boundaries.
But even then sculpting shows decent results.

The plan to solve that would be to introduce function to stitch
grids, which can also be used by Smooth brush which requires
this.
2018-09-18 14:48:27 +02:00
Sergey Sharybin 8e8952b7e3 Multires: Initial work to get sculpting to work with OpenSubdiv
Allows to go to sculpt mode, do brush strokes, get out of sculpt mode
and have deformation preserved.

The issues currently is that the current implementation of CCG
storage is created from the limit surface, without displacement
taken into account. It is trivial to get displaced coordinates,
but it is more tricky to get displaced normals. This is something
to be solved next.

Another limitation is that this only works for sculpting at a maximal
multires level. There is code to be done to support propagation
of displacement onto a higher levels.
2018-09-14 14:43:56 +02:00
Sergey Sharybin f827e3c84b Subdiv: Cache Subdiv in CCG surface
Allows to do re-shaping easier, since we will know for sure
what was the limit surface the CCG is created for.
2018-09-14 14:43:56 +02:00
Sergey Sharybin 3fbdcefa17 Subdiv: Initial implementation of CCG
Attempts to substitude CCGDM with an OpenSubdiv based structure
which has less abstraction levels. The missing part in this
substitude is a face pointers which old CCGDM/multires code was
using to stitch faces (averaging boundaries).

Another curial bit missing: "reshaping" of multires CD_MDISPS
to the state of new PBVH grids.

The new code is only available when OpenSubdiv modifier is
enabled (WITH_OPENSUBDIV_MODIFIER=ON) and with debug value of
128. This is so this WIP code is not interfering with current
production machines in the studio.

Reviewers: brecht

Reviewed By: brecht

Differential Revision: https://developer.blender.org/D3685
2018-09-11 16:37:02 +02:00
Sergey Sharybin 79e8805a9e Subdiv: Some ground work for CCG support
Nothing really interesting, just starting laying down API which
seems to be a decent substitute to CCGDM, without requiring too
much work be done in sculpting area.
2018-09-06 11:32:21 +02:00