Age | Commit message (Collapse) | Author |
|
* Sharp edge flags are now supported and are
treated much the same as face set boundaries:
+ Dyntopo preserves them
+ Interior smoothing treats them as boundaries
+ Corners are detected and pinned in smoothing
+ TODO: add a brush flag to ignore sharp boundaries
for smoothing.
* Seams are also preserved, but don't affect smoothing.
* BMLog now saves edges.
* The new edge split function is enabled.
* Dyntopo now pushes new combined BMLog entries in
its top-level function, to avoid scary id reuse
edge cases.
* SCULPT_vertex_is_boundary/corner now take a bitmask
of which types of boundaries you wish to query instead
of check_face_sets.
|
|
* New function SCULPT_vertex_is_corner, similar to
SCULPT_vertex_is_boundary it takes argument to
check face sets. PBVH_FACES/GRIDS version is
incomplete. It returns a bitmask of whether
the vert is a boundary corner and/or a face
set one.
* PBVH_BMESH uses a somewhat more expensive
calculation to detect corners of face set islands by
edge angle. This is currently not done for boundary
corners.
Corner pinning now happens in:
* The internal smoother dyntopo uses for stability reasons.
* SCULPT_vertex_neighbor_average_interior.
* Topology rake.
* Dyntopo collapse.
Note that DynTopo always pins face set corners
but everything else only does so if preserve face
sets is on.
|
|
* Added an option to weight smooth by face areas
* Dyntopo now caches face areas in a CD_PROP_FLOAT layer
* Dyntopo also caches number of edges around verts inside of
MDynTopoVert. To avoid increasing the struct size flag was
made a short.
* Cleanup mode (dissolves 3/4-valence verts) now piggybacks on
subdivide code to build list of verts; this is much faster.
|
|
(still a wip)
The boundary brush now builds a geodesic distance
field (from the boundary) from which it derives a tangent
field:
* These now define the rotation plane for bend mode.
* Rotation origins snap to these planes.
There is also typedef'd code for visualization tangents
in a temporary object (note the sculpt object), to enable
define VISBM in sculpt_boundary.c. This will be removed
lated.
Additional changes:
* Added a function to get the number of edges around verts,
SCULPT_vertex_valence_get.
* Added an API to calculate cotangent weights for vert fans,
SCULPT_cotangents_begin (call in main thread first) and
SCULPT_get_cotangents.
* Sculpt neighbors for PBVH_FACES now uses ss->vemap if it exists.
* The Mesh topology mapping code now takes extra parameters for
sorting vert/edge cycles geometrically.
* Similarly, there is now a function to sort BMesh edge cycles,
BM_sort_disk_cycle.
* MDynTopoVert->flag now has a bitflag for when the disk cycle
sorting needs to be redone, DYNVERT_NEED_DISK_SORT.
* The sculpt geodesic code now supports passing in custom vertex
coordinates.
* The geodesic API can also build an optional map of which vertex
in the initial vertex list is closest to any other vertex.
|
|
* PBVH_BMESH now supports faces other then triangles;
* Dyntopo triangulates faces as it finds them.
- I looked into methods of preserving quads and failed to
find anything that worked well in practice; it actually
worked better to use topology rake to align triangles
into quads and then mark diagonal edges for later dissolving
then to try to preserve quads explicitly (I've not
implementated that here, that was research code).
- To avoid excessive cache-destroying loops over vertex-faces,
DynTopo flags which verts have non-triangle faces.
* PBVHTriBuf now builds edge buffers so we can avoid drawing
tesselation phantom edges.
* BMLog also now supports arbitrary faces. It still does not
support edges though.
TODO:
* Fix vcol cell shading mode
* Make sure indexed drawing works
|
|
* Face set boundaries are now preserved on dyntopo remeshing.
* MDynTopoVert->flag now has a DYNVERT_FSET_BOUNDARY flag
in addition to DYNVERT_BOUNDARY.
* Instrumented uiBut with ASAN poison regions to hopefully
find the super evil memory corruption bug that's been driving
me insane. It's frustratingly intermittent. There are five
poison regions.
|
|
|
|
|
|
|
|
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
|
|
* Fix bug in pbvh face create
|
|
* Original data for bmesh pbvh is no longer handled by the undo code.
This should eliminate a whole class of subtle and hard to track down
bugs.
|
|
- To do this I made a little API to make scratch
customdata layers: SCULPT_dyntopo_[ensure/get]_templayer.
Takes a customdata type and a layer name (e.g.
'__dyntopo_bleh") and returns a customdata offset.
- Note that I also did this for the persistent base code.
* Added a macro to check if a tool supports splitting the PBVH
during a stroke, DYNTOPO_HAS_DYNAMIC_SPLIT. It is in sculpt_intern.h
(for now) to avoid the enormous amount of recompiling that is
triggered if DNA_brush_enum.h is modified.
* TODO: Right now the undo code resets original vertex coordinates for
bmesh PBVH. This means tools that rely on original data (sharp and
layer) can't split the pbvh during the stroke, since that will
allocate new undo nodes and reset original coords.
The solution is to move the original data API entirely out of the undo
code.
|
|
|
|
It stores:
- Original coordiates, colors and mask (which were previously four
seperate layers).
- A bitmask with (currently) one bitflag, whether or not a vertex is
on a boundary.
I needed to cache calculating vertex boundary state (which involves
iterating over the edges surrounding a vertex) and got fed up with
having so many CD layers for dyntopo. This struct consolidates them
and saves having yet another layer just to store a flag.
|
|
Differential Revision: https://developer.blender.org/D10387
|
|
After {rBa0867f05a48e2017a}, it is no longer necessary to pad
structs with 1 and 2 byte sizes. Most of these are geometry node
structs, where we've been avoiding using `node.custom1`.
I only found two others, the freestyle flags in custom data DNA.
Differential Revision: https://developer.blender.org/D10335
|
|
|
|
Some DNA headers already did this, most did not. Even though many of them would
be included in C++ files and thus compiled as C++. This would be confusing and
developers may think they have to add `extern "C"` too a whole lot of
(indirect) includes to be able to use a C header in C++.
However, this is a misconception.
`extern "C"` does not cause code to be compiled with C rather than C++! It only
causes the linker to not use C++ function name mangling. See
https://stackoverflow.com/a/1041880.
Because extern DNA headers don't have function declarations, using `extern "C"`
actually should not have any effect. On the other hand, adding it causes no
harm and avoids confusion. So let's just have it consistently in C header
files.
Differential Revision: https://developer.blender.org/D9578
Reviewed by: Bastien Montagne, Sybren Stüvel
|
|
It was rather a huge chunk of code, which started to become
more harder to maintain with the transition to OpenSubdiv based
implementation. Because of this transition, the compatibility was
also rather on a poor side.
Remove compatibility support for pre-2.50.9 multires.
Ref T77107
Reviewed By: brecht, mont29
Differential Revision: https://developer.blender.org/D9238
|
|
Corrects incorrect usage of contraction for 'it is', when possessive 'its' was required.
Differential Revision: https://developer.blender.org/D9250
Reviewed by Campbell Barton
|
|
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 reverts commit 39b525e0f07fa25dcda54226ade789959b642dec and
3121015dceb1d269d79690c8f15c8e1406c9b09f as tests are failing.
|
|
Use binary search for querying deform weights.
Spring 02_020_A.anim.blend on Ryzen 1700X goes from 12.4 to 12.7fps.
During profiling it was detected that adding new items to the head was faster than adding to the tail.
Reviewed By: Campbell Barton
Differential Revision: https://developer.blender.org/D8127
|
|
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
|
|
This implements a generic color datalayer and its functions. Based on
D5975.
Reviewed By: brecht
Differential Revision: https://developer.blender.org/D7838
|
|
This was not set anywhere, code relies on MLOOPUV_VERTSEL everywhere.
BMLoopUV.select_edge was never returning True and wasnt updating uv
select state when set manually.
Afaict, there were no official Addons using this from python.
Resolves T65836
Maniphest Tasks: T65836
Differential Revision: https://developer.blender.org/D6772
|
|
While the file in this report had corrupted values,
this is avoidable without adding any extra overhead.
Use unsigned vertex group indices since we don't need negative values,
this is an alternative to checking they aren't negative in many places.
Vertex group values over INT_MAX is still considered invalid,
so any accidental unsigned wrapping won't be silently ignored.
|
|
|
|
This file had become disorganized, it wasn't clear which structs/flags
were deprecated.
- Add comments explaining what each struct is for.
- Use doxy sections.
- Remove outdated notes, unused flags.
- Group custom-data.
- Group deprecated structs in their own section.
T
|
|
Also correct some outdated symbol references,
add missing 'name' commands.
|
|
|
|
|
|
Previously in 2.79 we were using a specialized drawing using derivedMesh.
Now the subsurf modifier tag each center vertex as facedot and let the
DRWManager pick it up.
Some modifiers (deforming ones) do not clear the tag so we can use this
technique even if there is deforming modifiers after subsurf modifiers.
|
|
Prepare for enabling ReflowComments.
|
|
|
|
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
|
|
|
|
Avoids mixing these in with regular variables in code-completion.
Use char for pad members except for 'void *', to make size clearer.
Removed/shrink a few redundant padding vars which were >= 8 bytes.
|
|
While \file doesn't need an argument, it can't have another doxy
command after it.
|
|
Move \ingroup onto same line to be more compact and
make it clear the file is in the group.
|
|
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.
|
|
Prevents clang-format wrapping text before comments.
|
|
Needed for clang-format in some cases, see: T53211
|
|
Not all three sides of a tesselated mesh triangle are guaranteed
to be original mesh edges, so a somewhat complicated check is
required to detect which ones are real. It seems that until now
there was no utility function for that, only some example code.
|
|
Loop triangles are tessellated triangles create from polygons, for renderers
or exporters that need to match Blender's polygon tesselation exactly. These
are a read-only runtime cache.
Tessfaces are a legacy data structure from before Blender supported n-gons,
and were already mostly removed from the C code.
Details on porting code to loop triangles is in the release notes.
Differential Revision: https://developer.blender.org/D3539
|
|
Differential Revision: https://developer.blender.org/D3736
|
|
|
|
Some sort of rudiment from many years ago, is never set by 2.5x code.
|
|
|