WIP: Sculpt: dynamic topology refactor #104613

Draft
Joseph Eagar wants to merge 333 commits from temp-sculpt-dyntopo into main

When changing the target branch, be careful to rebase the branch in your fork to match. See documentation.

333 Commits

Author SHA1 Message Date
Joseph Eagar 030162953c Merge branch 'main' into temp-sculpt-dyntopo 2024-03-18 10:53:21 -07:00
Joseph Eagar eac827051a Merge branch 'main' into temp-sculpt-dyntopo 2024-02-27 09:43:13 -08:00
Joseph Eagar c58e695f21 Merge branch 'main' into temp-sculpt-dyntopo 2024-02-18 11:51:41 -08:00
Joseph Eagar 8f9e4d6d65 Merge branch 'main' into temp-sculpt-dyntopo 2024-01-10 02:47:09 -08:00
Joseph Eagar 368349753e temp-sculpt-dyntopo: Fix merge bugs 2024-01-09 23:11:51 -08:00
Joseph Eagar 84a800d6d7 Merge branch 'main' into temp-sculpt-dyntopo
Branch is still buggy.
2023-12-31 23:35:42 -08:00
Joseph Eagar 96c504ca1e Merge branch 'main' into temp-sculpt-dyntopo 2023-11-23 14:03:33 -08:00
Joseph Eagar 8889a48166 temp-sculpt-dyntopo: Fix surface_smooth_v_safe not respecting sharpangle 2023-10-13 13:44:13 -07:00
Joseph Eagar 7d7d5d3c9b temp-sculpt-dyntopo: Collapse callbacks are function pointers again
Decided against the template approach.
2023-10-13 12:30:41 -07:00
Joseph Eagar a491c9fc95 Merge branch 'main' into temp-sculpt-dyntopo 2023-10-13 11:47:09 -07:00
Joseph Eagar dcac6b827e temp-sculpt-dyntopo: Use template deduction instead of BMElem for BMIDMap 2023-10-10 15:05:02 -07:00
Joseph Eagar a590a0bfd6 temp-sculpt-dyntopo: Add file comment to BM_idmap.hh 2023-10-10 14:23:12 -07:00
Joseph Eagar 12a37ed4ef temp-sculpt-dyntopo: Cleanup bmlog a bit more 2023-10-10 14:16:33 -07:00
Joseph Eagar 5401f06488 temp-sculpt-dyntopo: Remove some ASAN stuff 2023-10-10 13:56:17 -07:00
Joseph Eagar eaf57b35af temp-sculpt-dyntopo: A bit more cleanup 2023-10-10 13:51:33 -07:00
Joseph Eagar 6626cacd4a temp-sculpt-dyntopo: Remove a few comments 2023-10-10 13:40:58 -07:00
Joseph Eagar 12edd719ce temp-sculpt-dyntopo: Cleanup BMIdMap some more
Use blender::Vector for BMIdMap.map
2023-10-10 13:39:52 -07:00
Joseph Eagar 0ee525c08a temp-sculpt-dyntopo: Code cleanup 2023-10-10 13:30:33 -07:00
Joseph Eagar 7f7d43b7c7 temp-sculpt-dyntopo: Fix crash after voxel remesh 2023-10-09 16:38:37 -07:00
Joseph Eagar b3a89ad0f4 temp-sculpt-dyntopo: Revert remnants of debug draw code 2023-10-08 16:19:27 -07:00
Joseph Eagar e8e6c40a51 temp-sculpt-dyntopo Revert IDE changed file 2023-10-08 15:56:02 -07:00
Joseph Eagar 10d169506d Merge branch 'main' into temp-sculpt-dyntopo 2023-10-08 15:51:28 -07:00
Joseph Eagar 5d831c25be temp-sculpt-dyntopo: Revert a bunch of unrelated BMesh changes 2023-10-08 14:32:35 -07:00
Joseph Eagar ed58137cb5 temp-sculpt-dyntopo: Fix warning 2023-10-07 14:44:49 -07:00
Joseph Eagar ebf283c601 temp-sculpt-dyntopo: Fix broken subdivide-only dyntopo mode 2023-10-07 14:11:56 -07:00
Joseph Eagar 021f9cc17c temp-sculpt-dyntopo: Tweak snake hook dyntopo defaults 2023-10-07 12:38:22 -07:00
Joseph Eagar 1fc7b9986b temp-sculpt-dyntopo: Fix remesher not working with dyntopo
Also fixed a couple of truly nasty undo bugs.
2023-10-07 12:02:27 -07:00
Joseph Eagar c138deefe2 temp-sculpt-dyntopo: Final fix long skinny edges
Finally figured out the proper fix for long
skinny edges, which is to fetch both the subdivide
and collapse candidate edges from the minmax
heap, then decide which leads to higher quality
by comparing how far each is from the subdivide
and collapse length limits.
2023-10-07 02:10:42 -07:00
Joseph Eagar 62cbd06738 temp-sculpt-dyntopo: Use faster dyntopo settings for snake hook brush 2023-10-01 16:02:16 -07:00
Joseph Eagar cbd822132c temp-sculpt-dyntopo: Fix crash in preview file saving
buildbot/vexp-code-experimental-coordinator Build done. Details
2023-09-28 22:41:39 -07:00
Joseph Eagar 2411cda1a7 temp-sculpt-dyntopo: Cleanup warnings
buildbot/vexp-code-experimental-coordinator Build done. Details
2023-09-28 14:41:45 -07:00
Joseph Eagar 8d00a2897a temp-sculpt-dyntopo: Revert spreadsheet debug stuff 2023-09-28 14:12:37 -07:00
Joseph Eagar 43d8d2b823 temp-sculpt-dyntopo: Fix remesher thrashing on link skinny faces
buildbot/vexp-code-experimental-coordinator Build done. Details
Also fixes bug where high-valence verts are generated during remeshing.
2023-09-28 14:02:23 -07:00
Joseph Eagar 4c3150cc90 Merge remote-tracking branch 'blender/main' into temp-sculpt-dyntopo 2023-09-28 13:18:40 -07:00
Joseph Eagar 1e915c909c temp-sculpt-dyntopo: Fix bug with dyntopo collapse ignoring marked seams 2023-09-26 23:58:33 -07:00
Joseph Eagar 8ac2c44ef0 temp-sculpt-dyntopo: Fix face area calc
Also enabled dyntopo settings for simplify
brush for testing purposes.
2023-09-26 21:02:48 -07:00
Joseph Eagar 56c962aee5 Revert github stuff 2023-09-26 13:55:42 -07:00
Joseph Eagar 106cf6b83b
Merge pull request #1 from joeedh/joeedh-patch-1
Update issue templates
2023-09-26 13:52:43 -07:00
Joseph Eagar 88ab1fdae7
Update issue templates 2023-09-26 13:51:27 -07:00
Joseph Eagar 895b201a88 Revert Readme.MD 2023-09-26 13:46:30 -07:00
Joseph Eagar c340f12ce3 Merge remote-tracking branch 'blender/main' into temp-sculpt-dyntopo 2023-09-25 12:05:16 -07:00
Joseph Eagar 534c537192 temp-sculpt-dyntopo: Fix crash in thumbnail generation code 2023-09-22 13:13:17 -07:00
Joseph Eagar bfc69786b4 Merge branch 'main' into temp-sculpt-dyntopo 2023-09-22 11:37:45 -07:00
Joseph Eagar 32338a8b65 Merge branch 'main' into temp-sculpt-dyntopo 2023-09-18 09:25:01 -07:00
Joseph Eagar 7d660bcf40 Merge branch 'main' into temp-sculpt-dyntopo 2023-09-15 13:48:06 -07:00
Joseph Eagar 4424fa22a3 temp-sculpt-dyntopo: Add missing headers needed by linux
Also fixed invalid static declaration.
2023-09-12 16:59:10 -07:00
Joseph Eagar 3cfca7af34 Merge branch 'main' into temp-sculpt-dyntopo 2023-09-12 15:14:40 -07:00
Joseph Eagar 2452c71d3e Update Readme.MD 2023-09-07 14:39:31 -07:00
Joseph Eagar 489cba30e4 Merge branch 'main' into temp-sculpt-dyntopo 2023-09-07 14:35:41 -07:00
Joseph Eagar 9e3c62090b Merge branch 'main' into temp-sculpt-dyntopo 2023-08-31 23:52:14 -07:00
Joseph Eagar de93580fb4 Merge branch 'main' into temp-sculpt-dyntopo 2023-08-30 16:16:55 -07:00
Joseph Eagar b2e11a8bf2 Fix merge errors 2023-08-30 15:25:21 -07:00
Joseph Eagar 360ae95981 temp-sculpt-dyntopo: Fix broken face set undo and automasking 2023-08-30 15:21:02 -07:00
Joseph Eagar 68f09fdd50 temp-sculpt-dyntopo: Remove CD_TOOLFLAGS
Revert BMesh toolflags to behaviour in master.
2023-08-30 14:45:05 -07:00
Joseph Eagar 61d0426f46 temp-sculpt-dyntopo: Add forwarding header for bmesh_idmap.h 2023-08-30 13:14:08 -07:00
Joseph Eagar 86d4cb89d4 temp-sculpt-dyntopo: Don't reuse bmesh in trim operators
Preperation to revert changes to bmesh toolflags.

* The trim operators no longer reuses ss->bm (and thus don't
  depend on toolflags being a customdata layer).
* New method BKE_sculpt_set_bmesh.  It sets a new bmesh,
  frees the old one and recalculates the PBVH (if needed).
2023-08-30 13:07:26 -07:00
Joseph Eagar bea6bcb915 Merge branch 'main' into temp-sculpt-dyntopo 2023-08-27 08:57:21 -07:00
Joseph Eagar 0e65cc861e Merge branch 'main' into temp-sculpt-dyntopo 2023-08-26 00:35:53 -07:00
Joseph Eagar 2f66a84ecd Merge branch 'main' into temp-sculpt-dyntopo 2023-08-22 12:00:25 -07:00
Joseph Eagar 79ba826820 Merge remote-tracking branch 'blender/main' into temp-sculpt-dyntopo 2023-08-14 22:41:33 -07:00
Joseph Eagar 9a0bdd8fea temp-sculpt-dyntopo: Fix spiky artifacts in layer brush 2023-07-27 09:57:35 -07:00
Joseph Eagar df7c991f10 temp-sculpt-dyntopo: Fix undo bugs 2023-07-21 18:23:14 -07:00
Joseph Eagar 5e9da50bc5 temp-sculpt-dyntopo: Fix snake hook spacing bug
Brush spacing didn't work for snake hook, which
instead relied on INBETWEEN_MOUSEMOVE to throttle
mousemove events.  Since snake hook is an incremental
tool this is not correct and led to frustratingly
inconsistent behavior.

Brush spacing now works with snake hook.
2023-07-19 13:19:37 -07:00
Joseph Eagar dc0d3a2cba temp-sculpt-dyntopo: Revert more build system changes 2023-07-17 09:59:15 -07:00
Joseph Eagar 8d1701ac6c temp-sculpt-dyntopo: revert build system change 2023-07-17 09:52:28 -07:00
Joseph Eagar b0570eecad Merge branch 'main' into temp-sculpt-dyntopo 2023-07-13 11:22:25 -07:00
Joseph Eagar 50e48248b5 temp-sculpt-dyntopo: pre-merge commit 2023-07-13 10:51:08 -07:00
Joseph Eagar 25e796ec25 temp-sculpt-dyntopo: Fix crash 2023-07-13 10:01:40 -07:00
Joseph Eagar 6a6c8cd7b2 temp-sculpt-dyntopo: Fix crash 2023-07-13 09:12:39 -07:00
Joseph Eagar b6ba93f41d temp-sculpt-dyntopo: Add back function declaration deleted in merge 2023-07-13 08:31:33 -07:00
Joseph Eagar e53c1fb7da temp-sculpt-dyntopo: Remove extra shapekey code in bmesh conversion
We probably do need it, but I'm not sure it survived all the
repeated merging so I'm going to do it again.
2023-07-13 02:06:24 -07:00
Joseph Eagar e02d617212 temp-sculpt-dyntopo: Code cleanup 2023-07-13 01:52:56 -07:00
Joseph Eagar 47bde28f3c temp-sculpt-dyntopo: Remove various unused code 2023-07-13 00:55:35 -07:00
Joseph Eagar c74a6319df Merge branch 'main' into temp-sculpt-dyntopo 2023-07-12 00:55:05 -07:00
Joseph Eagar 0e9beeae97 temp-sculpt-dyntopo: more format fixes 2023-07-11 11:40:40 -07:00
Joseph Eagar 5d7f8e84b7 temp-sculpt-dyntopo: Format fixes 2023-07-11 11:37:31 -07:00
Joseph Eagar d9c88f32a5 temp-sculpt-dyntopo: remove unused code
buildbot/vexp-code-experimental-coordinator Build done. Details
2023-07-09 01:36:57 -07:00
Joseph Eagar eb47c52706 temp-sculpt-dyntopo: Cleanup some code
buildbot/vexp-code-experimental-coordinator Build done. Details
2023-07-09 01:26:05 -07:00
Joseph Eagar ae46f6ed02 temp-sculpt-dyntopo: View sculpt bmesh attributes in spreadsheet
For debugging use only, uncomment `//#define DEBUG_SCULPT_BM_ATTRS`
in spreadsheet_data_source_geometry.cc.  Also wrote a basic
BMesh attribute GVArray backend.

To display hidden attributes, enter `bpy.app.debug_value = 892`
into the python console.
2023-07-09 01:06:45 -07:00
Joseph Eagar 1378a29103 temp-sculpt-dyntopo: Make attribute undistortion more user-configurable
Also fixed a few bugs
2023-07-08 22:04:21 -07:00
Joseph Eagar 99f79a6c5e temp-sculpt-dyntopo: Fix nasty memory leak 2023-07-04 01:22:28 -07:00
Joseph Eagar a91c4bd93f Merge branch 'main' into temp-sculpt-dyntopo 2023-07-03 20:28:04 -07:00
Joseph Eagar df388b4546 temp-sculpt-dyntopo: Pre-emptively apply commit to avoid merge conflicts 2023-07-03 20:03:41 -07:00
Joseph Eagar 6be5fac602 temp-sculpt-dyntopo: remove test code 2023-06-30 16:01:05 -07:00
Joseph Eagar 7e78f221ff temp-sculpt-dyntopo: Add missing small buffer optimization size 2023-06-30 16:00:05 -07:00
Joseph Eagar 24c5536e46 temp-sculpt-dyntopo: Fix compile error
buildbot/vexp-code-experimental-coordinator Build done. Details
2023-06-30 15:49:19 -07:00
Joseph Eagar 71148abcd1 temp-sculpt-dyntopo: Don't update sharp angle flags when not requested
This was happening inside the dyntopo remesher loop,
which led to mesh artifacts.
2023-06-30 15:48:18 -07:00
Joseph Eagar c269861369 temp-sculpt-dyntopo: Remove debug timer
buildbot/vexp-code-experimental-coordinator Build done. Details
2023-06-30 15:31:22 -07:00
Joseph Eagar 4731773294 temp-sculpt-dyntopo: Yet again tweak num. stability smoothing factor
I may have to come up with some sort of hueristic for this.
2023-06-30 15:26:09 -07:00
Joseph Eagar 00d4fa3dec temp-sculpt-dyntopo: Fix uv collapse bug
Apparently you have to use minmax instead of centroid
when collapsing UV edges.  I thought I had all the
weights summing to produce the same result, but apparently
not.  This is also how editmode does it btw, that's where
I finally found the solution.

In other news, there is now a debug option to show UV edges
in the uv editor in sculpt mode (in dynamic topology mode).
It's purely for testing and is not meant for master.
To use, simply uncomment the DEBUG_SHOW_SCULPT_BM_UV_EDGES definition
in BKE_sculpt.h.
2023-06-30 15:19:30 -07:00
Joseph Eagar ae401b4a0d temp-sculpt-dyntopo: Add back missing nullptr check 2023-06-30 04:27:35 -07:00
Joseph Eagar b135761e5c temp-sculpt-dyntopo: Fix a few undo crashes 2023-06-30 01:35:15 -07:00
Joseph Eagar 37fb533ce5 temp-sculpt-dyntopo: Fix more performance regressions
* Use BM_log_face_if_modified instead of BM_log_face_modified.
  This ensures modified face data is only written once per
  stroke.
* BM_log_vert_before_modified now uses same logic as
  BM_log_face_if_modified
* Both functions now work by maintaining a Set inside of
  the owning BMLogEntry instead of checking each entry
  differential subset inside the entry manually.
2023-06-29 21:00:26 -07:00
Joseph Eagar 8bbb475912 temp-sculpt-dyntopo: Run make format 2023-06-29 16:02:14 -07:00
Joseph Eagar 336c5b82a3 temp-sculpt-dyntopo: Fix performance regressions 2023-06-29 15:54:24 -07:00
Joseph Eagar 657103d0cc temp-sculpt-dyntopo: Fix anchored and drag dot modes for dyntopo
* Anchored and drag dot now work with dyntopo
* They also now only undo the parts of the mesh they changed.
2023-06-28 09:45:59 -07:00
Joseph Eagar 32b40dba50 temp-sculpt-dyntopo: Grey out overriden dyntopo settings 2023-06-28 05:02:05 -07:00
Joseph Eagar a0e1b02cc6 temp-sculpt-dyntopo: Rewrite uv collapse and other fixes
buildbot/vexp-code-experimental-coordinator Build done. Details
* Rewrote edge collapse's UV collapse code.  It now uses
  C++ and is hopefully clearer and less buggy.
* Fixed recently introduced dyntopo spacing bug.
* Fixed vertex paint not working.
2023-06-28 03:30:12 -07:00
Joseph Eagar 21f7238e76 temp-sculpt-dyntopo: Remove dyntopo inherit flags from UI
* Inherit flags are now hardcoded in BKE_brush_dyntopo_inherit_flags.
* DynTopoSettings.inherit has been removed from RNA.
* There are now "overriden" properties in DynTopoSetting's RNA,
  e.g. is_subdivide_overriden.  This is used to show a warning
  checkbox when a setting is local to a brush (as in the simplify
  or snake hook brushes).
2023-06-28 00:22:09 -07:00
Joseph Eagar a59c5c0683 temp-sculpt-dyntopo: Fix crashed in last commit 2023-06-27 10:57:38 -07:00
Joseph Eagar 4a134abfa1 temp-sculpt-dyntopo: Fix UV reprojection and a few other fixes
* Loop_is_corner now falls back to an angle test if the
  number of charts around a vertex is less than 2.
* Dyntopo now starts at first dab.
* Fixed crash.
2023-06-27 10:11:11 -07:00
Joseph Eagar 8a9ea83fa6 temp-sculpt-dyntopo: Fix texture draw in dynamic topology mode
Also fixed a few crashes
2023-06-27 03:21:45 -07:00
Joseph Eagar 05a6480666 temp-sculpt-dyntopo: Re-enable wire cleanup code 2023-06-27 03:12:40 -07:00
Joseph Eagar 3680fa1d41 Merge branch 'main' into temp-sculpt-dyntopo 2023-06-27 01:52:27 -07:00
Joseph Eagar b66ad0cc53 temp-sculpt-dyntopo: Fix broken foundary flags for PBVH_FACES
And a few other minor bugs.
2023-06-25 06:34:55 -07:00
Joseph Eagar 944c12b947 temp-sculpt-dyntopo: Increase defautl sharp angle limit to 35 degrees 2023-06-24 01:05:59 -07:00
Joseph Eagar 509f68d594 temp-sculpt-dyntopo: Enable dyntopo for paint, but disable it for smear
buildbot/vexp-code-experimental-coordinator Build done. Details
2023-06-23 03:37:41 -07:00
Joseph Eagar adea20c375 temp-sculpt-dyntopo: Add Sculpt to DNA defaults.
Also tweaked dyntopo defaults.
2023-06-23 03:33:22 -07:00
Joseph Eagar 57391bd079 temp-sculpt-dyntopo: Make dyntopo detail mode a menu 2023-06-23 02:50:06 -07:00
Joseph Eagar 1e8603a878 temp-sculpt-dyntopo: Remove detail_range parameter
Detail_range controls how much edges have to deviate
from the goal length before remeshing kicks in.

It's a confusing paramter and 0.4f seems to work for
most cases.
2023-06-23 02:36:40 -07:00
Joseph Eagar d2529dfce3 Merge branch 'main' into temp-sculpt-dyntopo 2023-06-23 01:25:35 -07:00
Joseph Eagar 6e3817ee23 temp-sculpt-dyntopo: Fix broken vertex and weight paint modes 2023-06-23 00:48:28 -07:00
Joseph Eagar e037eab4b9 temp-sculpt-dyntopo: Fix a few minor bugs
buildbot/vexp-code-experimental-coordinator Build done. Details
* Only run displacement erase/smear with PBVH_GRIDS
* Fix mesh filter undo bug
2023-06-22 23:39:28 -07:00
Joseph Eagar 1d8a19141d temp-sculpt-dyntopo: Fix imporper handling of sharp flags in collapse 2023-06-21 05:24:21 -07:00
Joseph Eagar 76d11437a2 Merge branch 'main' into temp-sculpt-dyntopo 2023-06-21 01:47:36 -07:00
Joseph Eagar c29549339b temp-sculpt-dyntopo: Fix edge boundary flag update bug
Fixes broken face set boundary smoothing.
2023-06-19 05:45:24 -07:00
Joseph Eagar cfe1472596 temp-sculpt-dyntopo: Fix bug with seam and marked sharp corner flags 2023-06-19 05:11:28 -07:00
Joseph Eagar 3a7b4cb0ff temp-sculpt-dyntopo: Split GPU normals of marked sharp edges
TODO: use autosmooth settings to split by face angles too.
2023-06-19 05:06:42 -07:00
Joseph Eagar 7986eaa20c temp-sculpt-dyntopo: Fix performance problem and a few minor bugs 2023-06-18 04:09:06 -07:00
Joseph Eagar cd4aafc471 temp-sculpt-dyntopo: Fix box/lasso trim 2023-06-16 19:27:45 -07:00
Joseph Eagar 909130c7e9 temp-sculpt-dyntopo: Cleanup dyntopo code a bit more
buildbot/vexp-code-experimental-coordinator Build done. Details
* Fixed a few issues in the detail flood fill operator.
* The entire notion of limiting "edge steps" has been removed
  from the API (since we limit by time now).
2023-06-16 02:55:34 -07:00
Joseph Eagar 0fc08ada7a temp-sculpt-dyntopo: Face set init operator now works with dyntopo 2023-06-16 01:58:58 -07:00
Joseph Eagar f95e6d51e5 temp-sculpt-dyntopo: Use normal smooth code for relax brush 2023-06-15 22:23:28 -07:00
Joseph Eagar 7ec336c4f4 temp-sculpt-dyntopo: Fix memory corruption 2023-06-15 05:39:39 -07:00
Joseph Eagar 371639896b Merge branch 'main' into temp-sculpt-dyntopo 2023-06-15 04:22:16 -07:00
Joseph Eagar 97c181c2f8 temp-sculpt-dyntopo: Prevent degenerate topology from very skinny faces 2023-06-15 04:21:30 -07:00
Joseph Eagar a78e5e2d04 temp-sculpt-dyntopo: Fix smoothing bugs 2023-06-15 01:07:03 -07:00
Joseph Eagar 5d74725397 temp-sculpt-dyntopo: Fix fairing and topological boundary smoothing
Also removed a debug operator.
2023-06-14 22:42:00 -07:00
Joseph Eagar 0b1f6c2605 Merge branch 'main' into temp-sculpt-dyntopo 2023-06-14 20:45:35 -07:00
Joseph Eagar 9b5a872b22 temp-sculpt-dyntopo: Fix thread conflict 2023-06-10 23:37:54 -07:00
Joseph Eagar aaa30bce53 temp-sculpt-dyntopo: Fix bug in last commit
buildbot/vexp-code-experimental-coordinator Build done. Details
2023-06-10 02:59:35 -07:00
Joseph Eagar 734223b5f2 temp-sculpt-dyntopo: Fix a large number of small bugs
buildbot/vexp-code-experimental-coordinator Build done. Details
2023-06-10 02:54:57 -07:00
Joseph Eagar 284588fd4c temp-sculpt-dyntopo: Bugfixes
buildbot/vexp-code-experimental-coordinator Build done. Details
* Fixed exploding layer and draw sharp brushes
* Fixed various crashes.
2023-06-09 23:25:34 -07:00
Joseph Eagar a326423612 temp-sculpt-dyntopo: Fix edge seam smoothing bug
buildbot/vexp-code-experimental-coordinator Build done. Details
2023-06-09 19:05:27 -07:00
Joseph Eagar ef919c26ed temp-sculpt-dyntopo: fix windows compile error
buildbot/vexp-code-experimental-coordinator Build done. Details
2023-06-09 17:55:35 -07:00
Joseph Eagar b04276fc60 temp-sculpt-dyntopo: Tweak maximum remesh time constant 2023-06-09 17:54:43 -07:00
Joseph Eagar a5bf1a92b7 temp-sculpt-dyntopo: Fix performance regressions
buildbot/vexp-code-experimental-coordinator Build done. Details
* Quality now controls a time limit instead of an
  edge limit.
* Only log loop customdata when necassary.
* Removed the "Relax during remeshing" option, it was added
  to test the small amount of relaxation that's stochastically
  applied to reduce the numerical instability of collapse. Sadly
  it turned out to be necassary after all.
2023-06-09 17:46:17 -07:00
Joseph Eagar 29f25abb66 temp-sculpt-dyntopo: Performance tweaks 2023-06-09 16:23:42 -07:00
Joseph Eagar b88fc8d69d temp-sculpt-dyntopo: Cleanup dyntopo code some more
Move a few functions into methods of EdgeQueueContext
2023-06-09 15:53:41 -07:00
Joseph Eagar b678c3b3f6 temp-sculpt-dyntopo: Revert some unrelated changes and cleanup collapse 2023-06-09 15:05:28 -07:00
Joseph Eagar ee1f44c804 temp-sculpt-dyntopo: Remove old pre-C++ debugging API 2023-06-09 14:58:06 -07:00
Joseph Eagar 3a7d6d41d7 temp-sculpt-dyntopo: Fix boundery smoothing and undo bugs
* Smoothing should prioritize hard edges over smooth ones.
* Undo wasn't properly setting SCULPTFLAG_NEED_TRIANGULATE flags.
2023-06-09 04:04:02 -07:00
Joseph Eagar 24f23f42b4 temp-sculpt-dyntopo: Add missing break statements 2023-06-09 01:38:26 -07:00
Joseph Eagar 9fc556a14c Merge branch 'main' into temp-sculpt-dyntopo 2023-06-08 23:41:11 -07:00
Joseph Eagar ee4a37f38b temp-sculpt-dyntopo: Cleanup sculpt boundary code
* Cleaned up inconsistent function naming.
* Moved most pbvh api functions into the blender::bke::pbvh namespace.
* Edge boundary flags are now cached in an attribute like vertex
  boundary flags are.
* UV boundary flags are now only calculated when requested (and
  preserved during dyntopo remeshing).
* UV snap limit is now calculated automatically, from 1/10th
  of the average uv edge length around a vertex.
2023-06-08 14:49:06 -07:00
Joseph Eagar c90f603a6d temp-sculpt-dyntopo: Cleanup gpu index buffer code
Also fixed very nasty bug in customdata code.
2023-06-06 14:39:57 -07:00
Joseph Eagar b49a18e497 temp-sculpt-dyntopo: Move call to interp_face_corners into if block 2023-06-06 04:03:46 -07:00
Joseph Eagar 27bf295b3c temp-sculpt-dyntopo: Use new uv smooth code for stability smooth
Use the new UV smoothing code instead of reprojection for
the small amount of surface relaxation dyntopo does to
reduce numerical instability.
2023-06-06 03:59:14 -07:00
Joseph Eagar a974c1ebf2 temp-sculpt-dyntopo: UV and attribute reprojection changes
* Attempted to code a better reproject function, kind of
  turned into a uv smooth funcion with boundary constraints.
  - The idea of the function is you feed it the same weights
    you're using to smooth the vertex coordinates and it derives
    reprojection weights.  But UVs turned out to have so many
    edge cases and other types didn't that it sort of turned
    into a uv-only thing.
* Rewrote edge collapse from scratch yet again, this time
  with almost no use of bitflag tags.  Instead, `blender::Set`
  is used with static buffers.
* Fixed paint tool with corner colors.
* Fixed various UV boundary issues.
2023-06-06 02:42:02 -07:00
Joseph Eagar 5ba920d371 temp-sculpt-dyntopo: Fix bug in new split function 2023-06-04 22:13:08 -07:00
Joseph Eagar 9044aefe8f temp-sculpt-dyntopo: Fix bug in cleanup mode 2023-06-04 20:59:52 -07:00
Joseph Eagar 370be3d365 temp-sculpt-dyntopo: Remove pattern based triangle subdivider
This turned out to be a dead end. The original idea of using a
pattern based subdivider was to preserve quads.  But that turned
out to be more trouble than it was worth and just converged to
triangle in the end anyway, except for little floating quads
that messed up smoothing.

So I removed support for quads (quite a while ago) and recent
tests have shown a simple edge splitter is faster and produces
higher quality results.
2023-06-04 20:44:58 -07:00
Joseph Eagar 029b6ab9a2 temp-sculpt-dyntopo: Suppress false positive warning 2023-06-04 17:47:43 -07:00
Joseph Eagar 9cd4f0d4d3 temp-sculpt-dyntopo: Move edge collapse code to C++.
* The new code is a return to the original tracing-based
  callback system for informing PBVH of changes to the mesh.
  This ended up saving quite a lot of memory in undo steps
  and is much faster too.
* Mercifully C++ templates make this much less painful than
  the original C version of tracer callbacks.
* New code is still in somewhat of a wip state.
* Also fixed some bugs in attribute reprojection
2023-06-04 06:22:44 -07:00
Joseph Eagar fa8959a881 temp-sculpt-dyntopo: Fix another crash related to uvs
buildbot/vexp-code-experimental-coordinator Build done. Details
2023-06-03 03:24:30 -07:00
Joseph Eagar 45a68a54f6 temp-sculpt-dyntopo: Fix crash when no uv layers 2023-06-03 03:00:13 -07:00
Joseph Eagar 6c45d0b0d0 temp-sculpt-dyntopo: Fix a few bugs with cleanup mode 2023-06-03 02:38:56 -07:00
Joseph Eagar 1763f9fb63 temp-sculpt-dyntopo: Commit various bugfixes
* Fixed various corruptions of PBVHNode.bm_other_verts.
2023-06-03 01:11:02 -07:00
Joseph Eagar 78d338b208 temp-sculpt-dyntopo: Remove redundant declaration
buildbot/vexp-code-patch-coordinator Build done. Details
2023-06-02 05:25:10 -07:00
Joseph Eagar 21aeab573d temp-sculpt-dyntopo: Cleanup warnings
buildbot/vexp-code-experimental-coordinator Build done. Details
2023-06-02 05:23:01 -07:00
Joseph Eagar 0b5cb2945f temp-sculpt-dyntopo: another compiler error
buildbot/vexp-code-experimental-coordinator Build done. Details
2023-06-02 04:51:57 -07:00
Joseph Eagar dbebea6343 temp-sculpt-dyntopo: More clang-related compile errors
buildbot/vexp-code-experimental-coordinator Build done. Details
2023-06-02 04:49:07 -07:00
Joseph Eagar c49db52349 temp-sculpt-dyntopo: Fix compile error again
buildbot/vexp-code-experimental-coordinator Build done. Details
2023-06-02 04:44:43 -07:00
Joseph Eagar 65251574be temp-sculpt-dyntopo: Fix compiler error
buildbot/vexp-code-experimental-coordinator Build done. Details
Clang is sometimes excessively agressive
in pruning unused template code, and allows
syntax errors.
2023-06-02 04:38:46 -07:00
Joseph Eagar 1944b90d02 temp-sculpt-dyntopo: Fix misc. issues related to UVs
buildbot/vexp-code-experimental-coordinator Build done. Details
* BKE_sculpt_reproject_cdata is in somewhat of a mess,
  lots of debug code.  It is starting to become more reliable
  though.
* Rewrote the API by which changes in the attribute layout
  of the base mesh is propagated to the sculpt bmesh and
  vice versa.
* The add/remove operators for UV maps, color attributes,
  and normal attributes now properly invoke sculpt undo
  and calls the above API to push the new layer into the
  sculpt mesh.
* Fixed UV island boundary detection.
2023-06-02 04:29:42 -07:00
Joseph Eagar a3650b9008 temp-sculpt-dyntopo: Revert extraneous change 2023-05-31 20:41:26 -07:00
Joseph Eagar 71a0ca63b2 temp-sculpt-dyntopo: Revert more unrelated stuff 2023-05-31 20:39:09 -07:00
Joseph Eagar 329770b622 temp-sculpt-dyntopo: Forgot to add this file 2023-05-31 20:33:42 -07:00
Joseph Eagar 057f6b48ed temp-sculpt-dyntopo: Remove old TableGSet iter macro from clang-format 2023-05-31 20:32:52 -07:00
Joseph Eagar dcc6302acf temp-sculpt-dyntopo: Rewrite TableGSet in c++
* Rewrote TableGSet to be fully C++.  Since I'm not sure
  this is generally useful beyond dyntopo I've situated
  it in blenkernel, `BKE_dyntopo_set.hh`.

TODO: Make PBVHNode.bm_unique_verts/bm_other_verts/bm_faces
      members instead of pointers after PBVH->nodes becomes
      a Vector.
2023-05-31 20:28:46 -07:00
Joseph Eagar 5f6125a301 temp-sculpt-dyntopo: Remove changes to customdata
* No more per-customdata-layer default data, BMIdMap no longer
  needs it.
* Fixed formatting differences.
2023-05-31 17:41:35 -07:00
Joseph Eagar ea8c4dd15b temp-sculpt-dyntopo: Remove ASAN code for CustomData bmesh blocks 2023-05-31 17:13:24 -07:00
Joseph Eagar f498ec60f5 temp-sculpt-dyntopo: Remove more code, and cleanup dyntopo debug code
* Removed show_ids option
* Cleaned up dyntopo mesh validation code.  It now
  uses BMesh's element checkers.
2023-05-31 17:08:29 -07:00
Joseph Eagar 93a92fa0fd temp-sculpt-dyntopo: Remove blf_font.c change 2023-05-31 05:22:56 -07:00
Joseph Eagar 8ad27d180e Add files deleted by merge error 2023-05-31 05:21:01 -07:00
Joseph Eagar 8c99399597 temp-sculpt-dyntopo: Remove unrelated drawing code changes
* Vcol cell drawing was in this PR for debugging purposes.
  As it is (hopefully) no longer needed for that purpose the
  time has come to remove it.
* Also remove PBVH_BMESH's "smooth shading" and PBVH's "fast draw"
  modes.
2023-05-31 05:18:22 -07:00
Joseph Eagar cfbe3b64f7 temp-sculpt-dyntopo: Remove atomics changes
* Removed the root cause of why they were needed: I had forgotten
to revert changes to BLI_strict_flags.h I apparently made in sculpt-dev.
* Also removed a few other unrelated changes.
2023-05-31 04:36:51 -07:00
Joseph Eagar 744759dcae Merge branch 'main' into temp-sculpt-dyntopo 2023-05-31 04:01:34 -07:00
Joseph Eagar 51e5b7a33b temp-sculpt-dyntopo: Fix arm compiler error
buildbot/vexp-code-experimental-coordinator Build done. Details
2023-05-31 03:50:20 -07:00
Joseph Eagar 7235d33e57 temp-sculpt-dyntopo: Topology rake fixes
buildbot/vexp-code-experimental-coordinator Build done. Details
* Properly handle smooth boundaries.
2023-05-31 03:29:25 -07:00
Joseph Eagar 64963b6556 temp-sculpt-dyntopo: Fix crash in recent cleanup commits
buildbot/vexp-code-experimental-coordinator Build done. Details
2023-05-30 15:48:31 -07:00
Joseph Eagar dcfb042cba temp-sculpt-dyntopo: fix msvc error
buildbot/vexp-code-experimental-coordinator Build done. Details
2023-05-30 15:21:36 -07:00
Joseph Eagar 309cf9fb82 temp-sculpt-dyntopo: fix compile error
buildbot/vexp-code-experimental-coordinator Build done. Details
2023-05-30 15:15:01 -07:00
Joseph Eagar 7ffab5395e temp-sculpt-dyntopo: revert more unrelated code
buildbot/vexp-code-experimental-coordinator Build done. Details
2023-05-30 13:49:42 -07:00
Joseph Eagar aee491cb59 temp-sculpt-dyntopo: more reversions 2023-05-30 13:16:00 -07:00
Joseph Eagar 02d4bab58d temp-sculpt-dyntopo: Remove extraneous code:
* Cotangent API
* BMesh vertex disk sorting method.
* Lots of small changes to BMesh.
* Remnants of the original bmesh idmap API.
2023-05-30 12:16:22 -07:00
Joseph Eagar 2a0244cf1a temp-sculpt-dyntopo: Fix bug with layer brush exploding the geometry
buildbot/vexp-code-experimental-coordinator Build done. Details
2023-05-29 22:29:14 -07:00
Joseph Eagar ac71908680 temp-sculpt-dyntopo: Smooth and topology rake fixes
* Certain tools need to have their original coordinates
  attribute processed during autosmoothing and topology
  raking, otherwise they get noise.
* For now it's just draw sharp, other brushes will be tested
  (the layer brush might need it).
* Tried to improve the behavior of topology rake a bit more.
2023-05-29 22:01:32 -07:00
Joseph Eagar c606bce67e temp-sculpt-dyntopo: Don't ignore detail_range setting 2023-05-29 17:41:31 -07:00
Joseph Eagar 79c28f1ee2 temp-sculpt-dyntopo: Remove unneccasry bmesh table building 2023-05-29 17:06:42 -07:00
Joseph Eagar 673d176f66 Merge branch 'main' into temp-sculpt-dyntopo 2023-05-29 14:49:52 -07:00
Joseph Eagar b1fd3ad48f temp-sculpt-dyntopo: Dyntopo cleanup and bugfixes
* Remove BMTracer callback system for BM_edge_collapse
* Fix mask/automasking weighting for dyntopo.
* Fix bug in minmax heap
2023-05-26 03:41:43 -07:00
Joseph Eagar d69a80cf5b temp-sculpt-dyntopo: Fix automasking bug 2023-05-25 16:10:44 -07:00
Joseph Eagar 774d08bfd4 temp-sculpt-dyntopo: Improve dyntopo remeshing quality
buildbot/vexp-code-experimental-coordinator Build done. Details
Also cleaned up the code some more.
2023-05-25 03:28:53 -07:00
Joseph Eagar bd6069248e temp-sculpt-dyntopo Move core dyntopo loop into EdgeQueueContext
* remesh_topology has been split into methods in EdgeQueueContext.
  This allows us to run detail flood fill in a special "developer"
  mode to watch the queue update in real time.
2023-05-23 03:40:32 -07:00
Joseph Eagar 3e9493937a temp-sculpt-dyntopo: Fix memory leak
buildbot/vexp-code-experimental-coordinator Build done. Details
2023-05-22 14:22:58 -07:00
Joseph Eagar 57b1ad9809 temp-sculpt-dyntopo: Improve dyntopo convergence 2023-05-22 14:09:04 -07:00
Joseph Eagar fe647b9e33 temp-sculpt-dyntopo: Fix brush resetting not affecting dyntopo settings 2023-05-22 12:10:24 -07:00
Joseph Eagar 70acf884dd temp-sculpt-dyntopo: Use eigen decomposer from Eigen for curvature rake
Pun not intended.
2023-05-22 12:03:38 -07:00
Joseph Eagar 1d572e238b temp-sculpt-dyntopo: Remove unused enum 2023-05-21 18:34:49 -07:00
Joseph Eagar e036659014 Merge branch 'main' into temp-sculpt-dyntopo 2023-05-21 18:25:06 -07:00
Joseph Eagar 4de7f2b06f temp-sculpt-dyntopo: Cleanup dyntopo code
buildbot/vexp-code-experimental-coordinator Build done. Details
* New header BKE_dyntopo.hh
* blender::dyntopo -> blender::bke::dyntopo
* PBVH_pbvh_bmesh_update_topology ->
  blender::bke::dyntopo::remesh_topology.
* Vertex/tri brush test callbacks are now handled
  via C++ classes.
2023-05-21 17:12:25 -07:00
Joseph Eagar 3ab1999b41 temp-sculpt-dyntopo: Make detail flood fill dynamic, add quality slider
* Detail flood fill now updates the mesh in real time via
  a modal mode and the jobs API.
* Added a quality slider to control dyntopo quality.
2023-05-21 13:10:28 -07:00
Joseph Eagar bd35096a79 temp-sculpt-dyntopo: Cleanup: Move code around to avoid long rebuild times
* Move some of the SCULPT_TOOL_DOES_XXX macros to a new file,
  BKE_sculpt.h from DNA_brush_enums.h (they were there because
  rna needs them).
* Fix lazy updating of sharp angle boundaries.
2023-05-20 02:08:01 -07:00
Joseph Eagar 88bab95b8c temp-sculpt-dyntopo: Tweak UI for new smooth boundary settings 2023-05-19 02:57:55 -07:00
Joseph Eagar 78a0e81d9a temp-sculpt-dyntopo: Fix uv reprojection bug and cleanup code
buildbot/vexp-code-experimental-coordinator Build done. Details
2023-05-19 02:02:04 -07:00
Joseph Eagar c40d7cc278 temp-sculpt-dyntopo: Improve dyntopo remesher quality
buildbot/vexp-code-experimental-coordinator Build done. Details
* Sharp-by-angle boundaries now test for degenerate triangles.
* Increases maximum number of edges that can be processed at
  once.
2023-05-19 01:09:27 -07:00
Joseph Eagar 225df16d81 temp-sculpt-dyntopo: Fix a large number of memory leaks
* ss->bm wasn't being freed at all, a holdover from the
  old PBVH caching experiment I ended up ditching.
* Fixed a few memory leaks in BMLog.
2023-05-19 00:20:42 -07:00
Joseph Eagar f704e272fc temp-sculpt-dyntopo: Remove debug code from last 2 commits
buildbot/vexp-code-experimental-coordinator Build done. Details
2023-05-18 15:34:20 -07:00
Joseph Eagar 71dda6300b temp-sculpt-dyntopo: Fix strings of boundary edges shrinking during smooth 2023-05-18 15:33:14 -07:00
Joseph Eagar 15d4621739 temp-sculpt-dyntopo: Expose smooth brush boundary settings to UI 2023-05-18 15:18:51 -07:00
Joseph Eagar ab46277a5d temp-sculpt-boundary: New boundary type: sharp-angle edges
* Detects sharp edges by face angles.
* Sharp-angle boundaries are respected by dyntopo only
  for now.
2023-05-18 13:55:41 -07:00
Joseph Eagar 83362d4611 temp-sculpt-dyntopo: Fix BMLog not saving edge flags properly 2023-05-18 02:11:12 -07:00
Joseph Eagar d25e597adb temp-sculpt-dyntopo: remove dyntopo smooth shading from UI
buildbot/vexp-code-experimental-coordinator Build done. Details
2023-05-17 14:12:22 -07:00
Joseph Eagar 61fe3ae8d2 temp-sculpt-dyntopo: Fix undoing past first undo step locking the mesh
buildbot/vexp-code-experimental-coordinator Build done. Details
2023-05-17 14:06:06 -07:00
Joseph Eagar 62404b3878 temp-sculpt-dyntopo: Improve dyntopo support for face sets
* Face set edit operator is now supported.
* Fixed various bugs in the visibility operators.
2023-05-17 13:24:06 -07:00
Joseph Eagar 6d9faebd0f temp-sculpt-dyntopo: Fix crash with original mask code 2023-05-17 10:27:05 -07:00
Joseph Eagar 5243408f68 temp-sculpt-dyntopo: Fix various face set bugs
buildbot/vexp-code-experimental-coordinator Build done. Details
* Face set undo now updates boundary flags properly.
* Fixed bug with draw face set brush sometimes only drawing one face set
2023-05-17 09:10:48 -07:00
Joseph Eagar 380ad68d84 temp-sculpt-dyntopo: Fix smoothing bug 2023-05-17 02:57:24 -07:00
Joseph Eagar 64b21b4d1f temp-sculpt-dyntopo: Minor smoothing fixes and code cleanups
* Fixed a few minor smoothing code issues
* Removed a few unused functions
2023-05-17 02:06:15 -07:00
Joseph Eagar 972df91bc5 temp-sculpt-dyntopo: UV reprojection improvements
* UVs are now reprojected in dyntopo's topology smoother
  (dyntopo relaxes the topology a small amount to improve
   convergence).
* Moved SCULPT_reproject_cdata to BKE_sculpt_reproject_cdata
  in blenkernel.
* Fixed numerical instability issue that was causing corrupted
  UVs.
2023-05-16 13:11:59 -07:00
Joseph Eagar f8a77a6265 temp-sculpt-dyntopo: Add an option to control hard edge corner pinning
buildbot/vexp-code-experimental-coordinator Build done. Details
2023-05-16 01:35:48 -07:00
Joseph Eagar 3e29e32c0a temp-sculpt-dyntopo: Fix sculpt boundary corner handling
buildbot/vexp-code-experimental-coordinator Build done. Details
2023-05-15 17:37:43 -07:00
Joseph Eagar 5e2ee83131 temp-sculpt-dyntopo: Fix cached flags and vert valences not being set 2023-05-15 15:59:22 -07:00
Joseph Eagar 45e7875b70 temp-sculpt-dyntopo: Bring back 3/4 pole cleanup option
This will probably not be user-configurable.  It makes
nicer topology and, more importantly, seems to improve
convergence of subdivide only mode.
2023-05-15 15:32:13 -07:00
Joseph Eagar ea48ba1f8b temp-sculpt-dyntopo: Fix various bugs related to area weights and dyntopo
buildbot/vexp-code-experimental-coordinator Build done. Details
2023-05-15 01:04:13 -07:00
Joseph Eagar f4951c51e5 temp-sculpt-dyntopo: Fix broken boundary flags after draw face sets
buildbot/vexp-code-experimental-coordinator Build done. Details
2023-05-14 17:20:07 -07:00
Joseph Eagar 3d4d32c568 temp-sculpt-dyntopo: Remove SculptPMap struct
SculptPMap was a referenced counted wrapper
around a vertex to poly map. It was originally
created to solve a bug that no longer exists.
2023-05-14 16:53:40 -07:00
Joseph Eagar 2da1624d9f Merge branch 'main' into temp-sculpt-dyntopo 2023-05-14 11:47:42 -07:00
Joseph Eagar 5c19910e71 temp-sculpt-dyntopo: Fix crash in boundary brush
buildbot/vexp-code-experimental-coordinator Build done. Details
2023-05-09 12:16:56 -07:00
Joseph Eagar d6fc5552f1 temp-sculpt-automasking: Remove brush->autosmooth_fset_slide 2023-05-09 11:59:25 -07:00
Joseph Eagar 7aa38adaab temp-sculpt-dyntopo: Fix face set boundary smoothing 2023-05-09 11:51:09 -07:00
Joseph Eagar 4891066754 temp-sculpt-dyntopo: Fix bugs in smoothing code and draw face sets
Draw face sets' code has been rewritten to use new
sculpt face API.
2023-05-09 11:19:45 -07:00
Joseph Eagar 58a41db224 temp-sculpt-dyntopo: Fix incorrect member initialization in last commit
buildbot/vexp-code-experimental-coordinator Build done. Details
2023-05-08 21:35:57 -07:00
Joseph Eagar 2a219a1167 temp-sculpt-dyntopo: Fix topology automasking not working with boundary 2023-05-08 21:33:09 -07:00
Joseph Eagar c2bd9849d0 temp-sculpt-dyntopo: Fix various original coordinates bugs 2023-05-08 21:25:35 -07:00
Joseph Eagar bdfec66f8c Merge branch 'main' into temp-sculpt-dyntopo 2023-05-05 15:58:29 -07:00
Joseph Eagar dcec104fbd temp-sculpt-dyntopo: fix odd merge error
buildbot/vexp-code-experimental-coordinator Build done. Details
2023-05-03 00:21:23 -07:00
Joseph Eagar 18de7e5281 temp-sculpt-dyntopo: Run clang-format 2023-05-02 23:34:24 -07:00
Joseph Eagar eb76f7114e Merge branch 'main' into temp-sculpt-dyntopo 2023-05-02 23:33:15 -07:00
Joseph Eagar e741fba3c6 temp-sculpt-dyntopo: Cleanup a comment 2023-05-02 23:09:14 -07:00
Joseph Eagar fce8273d08 temp-sculpt-dyntopo: Fix dyntopo temp attribute bug 2023-05-02 22:52:22 -07:00
Joseph Eagar 79b3b8e093 temp-sculpt-dyntopo: Finish getting rid of MSculptVert 2023-05-02 16:51:14 -07:00
Joseph Eagar 3c40e6c5d9 temp-sculpt-dyntopo: Continue splitting up MSculptVert
Mostly done, just need to remove MSculptVert struct itself
2023-05-02 15:43:05 -07:00
Joseph Eagar 82ebcc018e temp-sculpt-dyntopo: Begin splitting MSculptVert into attributes
Note: not all attributes exist all the time.

New attributes:
* flags         : byte
* origco        : float3
* origno        : float3
* origmask      : float
* origcolor     : float4
* curvature_dir : float3;
* valence       : int;
2023-05-01 16:46:52 -07:00
Joseph Eagar d9975b4bf3 temp-sculpt-dyntopo: Apply sculpt attribute api cleanup patch 2023-05-01 14:11:23 -07:00
Joseph Eagar 8dc0922439 Merge branch 'main' into temp-sculpt-dyntopo 2023-05-01 13:34:24 -07:00
Joseph Eagar b2afa60968 temp-sculpt-dyntopo: Fix compile errors and remove unused code 2023-05-01 13:26:18 -07:00
Joseph Eagar a1102c366c Merge branch 'main' into temp-sculpt-dyntopo 2023-04-26 01:38:43 -07:00
Joseph Eagar 34c0a7690d temp-sculpt-dyntopo: Revert old mempool ASAN code prior to merge 2023-04-26 01:14:34 -07:00
Joseph Eagar b3838ec90d temp-sculpt-dyntopo: Remove editmode fair op 2023-04-24 12:45:39 -07:00
Joseph Eagar 904f47b12b Merge branch 'main' into temp-sculpt-dyntopo 2023-04-24 11:46:02 -07:00
Joseph Eagar d464132d63 temp-sculpt-dyntopo: Fix detail set operators 2023-04-24 11:45:08 -07:00
Joseph Eagar 23a048ca58 temp-sculpt-dyntopo: Fix detail flood fill operator 2023-04-24 11:03:08 -07:00
Joseph Eagar cfc638d4b2 temp-sculpt-dyntopo: Fix trim booleans 2023-04-21 16:38:13 -07:00
Joseph Eagar a04c6e15a8 temp-sculpt-dyntopo: Fix crash in box trim 2023-04-21 16:15:07 -07:00
Joseph Eagar d439ae22af Merge branch 'main' into temp-sculpt-dyntopo 2023-04-19 16:14:14 -07:00
Joseph Eagar 4dbd79499a temp-sculpt-dyntopo: fix compile error
buildbot/vexp-code-experimental-coordinator Build done. Details
2023-04-18 23:55:58 -07:00
Joseph Eagar 75eab27366 temp-sculpt-dyntopo: Fix compile error 2023-04-18 23:54:05 -07:00
Joseph Eagar 6682751b28 Merge branch 'main' into temp-sculpt-dyntopo 2023-04-18 23:49:03 -07:00
Joseph Eagar 6d53e23e03 temp-sculpt-dyntopo: bugfixes
buildbot/vexp-code-experimental-coordinator Build done. Details
* Fixed crash in color sample (SKEY) tool
* Fixed bugs in visibility code
* Fixed nasty undo bugs when saving full meshes
2023-04-18 18:28:25 -07:00
Joseph Eagar 59801f80c1 temp-sculpt-dyntopo: Fix bug with valence caching in PBVH_GRIDS 2023-04-17 16:46:43 -07:00
Joseph Eagar 52dd137e53 temp-sculpt-dyntopo: Fix bug in CustomData_copy_all_layout
Also fixed bug in CustomData_layout_is_same.
2023-04-15 00:54:13 -07:00
Joseph Eagar ab81b1163d Merge branch 'main' into temp-sculpt-dyntopo 2023-04-14 13:44:54 -07:00
Joseph Eagar c5d6a03dea temp-sculpt-dyntopo: Finish merge 2023-04-14 12:32:54 -07:00
Joseph Eagar 8b35c62c2b temp-sculpt-dyntopo: Remove unrelated code 2023-04-14 12:06:56 -07:00
Joseph Eagar 9c774138aa Merge branch 'main' into temp-sculpt-dyntopo 2023-04-14 12:06:17 -07:00
Joseph Eagar bd18203239 temp-sculpt-dyntopo: Add comment for stroke api and remove ATTR_NO_OPTs 2023-04-14 11:14:15 -07:00
Joseph Eagar 0acc6c51d6 temp-sculpt-dyntopo: Fix bmesh toolflags bug and curvature bug
buildbot/vexp-code-experimental-coordinator Build done. Details
* Fixed a few bugs with handling of CD_TOOLFLAGS layer.
* Sculpt curvature API now handles completely flat geometry.
2023-04-09 03:06:00 -07:00
Joseph Eagar aae820d385 Merge branch 'main' into temp-sculpt-dyntopo 2023-04-09 02:04:17 -07:00
Joseph Eagar cce5029a59 temp-sculpt-dyntopo: Fix versioning bug 2023-04-06 14:55:16 -07:00
Joseph Eagar c2d85cddaf Merge branch 'main' into temp-sculpt-dyntopo 2023-04-06 13:48:10 -07:00
Joseph Eagar 212eeabd16 temp-sculpt-dyntopo: Various random fixes
* Expose dyntopo radius scale in UI; needed for snake hook.
* Created a dyntopo "repeat" setting, also used by snake hook.
* Fixed nasty bug in CustomData_bmesh_copy_data_exclude_by_type,
  it may exist in master.
* Dyntopo subdivide now adds to unified minmax heap again.
* Fixed versioning error in Sculpt.dyntopo.
* Fix bug in new blender::Map TableGSet backend.
* Vertex IDs are now only uploaded to the GPU when
  "show ids" overlay is on.
* Dyntopo spacing may now be zero, in which case native
  brush spacing will be used.
* Undo nodes of SCULPT_UNDO_COORDS/COLOR/MASK/FACE_SETS can
  now be pushed multiple times.
* Removed last vestiges of PBVH caching code.
2023-04-03 00:08:14 -07:00
Joseph Eagar f4e9cf982d temp-sculpt-dyntopo: Code cleanups
* TableGSet now uses blender::Map instead of SmallHash.
* Removed a few duplicate CustomData API methods.
* Remove last vestiges of the old mesh element ID
  system.  Note that old files from sculpt-dev with
  CD_MESH_ID layers (which is now CD_DYNTOPO_VERT)
  are detected and patched.
2023-04-02 14:34:39 -07:00
Joseph Eagar 66b2f57e5e temp-sculpt-dyntopo: Fix merge error 2023-03-30 23:28:11 -07:00
Joseph Eagar a1369dda51 Merge branch 'main' into temp-sculpt-dyntopo 2023-03-30 23:21:05 -07:00
Joseph Eagar b959acf9f7 temp-sculpt-dyntopo: Fix editmode seperate operator 2023-03-28 08:00:56 -07:00
Joseph Eagar 759c5072e0 temp-sculpt-dyntopo: Fix bug where original coords not initialized 2023-03-28 06:39:29 -07:00
Joseph Eagar 8bbbba537f temp-sculpt-dyntopo: Clean up some more warnings
buildbot/vexp-code-experimental-coordinator Build done. Details
2023-03-28 05:07:12 -07:00
Joseph Eagar ae79a9fe9f temp-sculpt-dyntopo: Cleanup some warnings 2023-03-28 04:52:55 -07:00
Joseph Eagar aabc29b249 temp-sculpt-dyntopo: Fix compile error and minor versioning bug
buildbot/vexp-code-experimental-coordinator Build done. Details
2023-03-28 03:28:20 -07:00
Joseph Eagar d2ef2d905c temp-sculpt-dyntopo: Make use of DynTopoSettings again
All DynTopo settings are now stored in a single struct,
DynTopoSettings, which is used by both Brush and Sculpt.

DynTopo settings can be set to either inherit from Sculpt.dyntopo
or Brush.dyntopo; this in controlled with Brush.dyntopo.inherit
which is a bitflag.

This is the original system I came up prior to the more
generic brush property proposals.  I decided to bring it
back for the same reason I wrote it in the first place:
to avoid hardcoding behavior for specific brushes, specifically:

* Simplify always has subdivide and collapse on.
* Snake hook needs a much smaller dyntopo
  spacing than other tools.
2023-03-28 03:08:05 -07:00
Joseph Eagar b8712aade7 temp-sculpt-dyntopo: Remove ATTR_NO_OPTs and fix merge errors 2023-03-26 16:59:13 -07:00
Joseph Eagar 3dfcd45b09 temp-sculpt-dyntopo: Fix error in merge 2023-03-26 15:00:36 -07:00
Joseph Eagar ffa6fafa33 Merge branch 'main' into temp-sculpt-dyntopo 2023-03-26 14:56:37 -07:00
Joseph Eagar 1889224bd0 temp-sculpt-dyntopo: Fix visibility bug
PBVH_BMESH no longer tries to use a .hide_poly
layer instead of BM_ELEM_HIDDEN, this is something
that will have to happen inside of the BMesh code
itself.
2023-03-25 13:46:45 -07:00
Joseph Eagar a2f908ec6d temp-sculpt-dyntopo: Fix undo bug 2023-03-25 11:54:48 -07:00
Joseph Eagar ec76d621f6 temp-sculpt-dyntopo: Fix smooth boundary/corner handling
* Face set projection now works.
* Hard edge mode (which forcibly sets face set projection to 0)
* Exposed settings for both in ui.
2023-03-22 18:48:32 -07:00
Joseph Eagar c2a2c8265c temp-sculpt-dyntopo: Fix face set init operator 2023-03-22 17:53:48 -07:00
Joseph Eagar 6064c650e2 temp-sculpt-dyntopo: Fix bugs in edit face sets operator 2023-03-19 03:25:40 -07:00
Joseph Eagar 9364c401af Merge branch 'main' into temp-sculpt-dyntopo 2023-03-19 03:13:42 -07:00
Joseph Eagar 6a14199f7d temp-sculpt-dyntopo: Code cleanup and bugfixes
* Removed experimental uv solver brush code
* Fixed undo bug in draw face sets
* Fixed draw face sets not working in extend mode.
* Fixed extract ops not working in dyntopo.
2023-03-18 17:01:28 -07:00
Joseph Eagar 8ee94a8582 temp-sculpt-dyntopo: Cleanup code 2023-03-18 15:15:39 -07:00
Joseph Eagar 51e6f898d1 temp-sculpt-dyntopo: Bring back custom dyntopo spacing 2023-03-16 17:14:44 -07:00
Joseph Eagar f071a4bb04 temp-sculpt-dyntopo: Bring back improved topology rake 2023-03-16 16:51:13 -07:00
Joseph Eagar 27bdf013ec temp-sculpt-dyntopo: Rewrite minmax heap in c++ 2023-03-16 16:26:12 -07:00
Joseph Eagar 29038867a9 temp-sculpt-dyntopo: Add back global dyntopo disable
Also renamed "Dyntopo" panel back to "Dynamic topology."
2023-03-10 02:15:59 -08:00
Joseph Eagar 0e582f1cc3 temp-sculpt-dyntopo: Fix "weight by area" for smooth brush
Also exposed local brush dyntopo disable property in ui.
2023-03-10 02:11:14 -08:00
Joseph Eagar 681a55bb01 temp-sculpt-dyntopo: Fix crash in modifier stack 2023-03-10 01:15:43 -08:00
Joseph Eagar e35f676b82 temp-sculpt-dyntopo: Make enhance details use sculpt attribute api 2023-03-09 19:31:24 -08:00
Joseph Eagar 656c075843 temp-sculpt-dyntopo: Fix symmetrize undo and a few ASAN errors
The new BMLog code was failing to call CustomData_bmesh_asan_unpoison
prior to directly memcpy'ing a customdata block.
2023-03-09 14:57:39 -08:00
Joseph Eagar 619c2e1eb9 temp-sculpt-dyntopo: Various fixes
* Disable idmap debug mode.
* Fixed "show original coordinates" draw mode.
* Fixed bug with idmap debug mode corrupting meshes.
2023-03-08 04:16:22 -08:00
Joseph Eagar a72c470c5e temp-sculpt-dyntopo: Finish merge 2023-03-07 18:02:18 -08:00
Joseph Eagar 806cbce745 Merge branch 'main' into temp-sculpt-dyntopo 2023-03-07 16:55:45 -08:00
Joseph Eagar f5748abef8 temp-sculpt-dyntopo: Fix compile errors 2023-03-07 16:30:02 -08:00
Joseph Eagar 939e58a263 Merge branch 'main' into temp-sculpt-dyntopo 2023-02-24 00:47:02 -08:00
Joseph Eagar e50fe40d0f Merge branch 'main' into temp-sculpt-dyntopo 2023-02-20 18:39:05 -08:00
Joseph Eagar 26b3aefb8f temp-sculpt-dyntopo: More debugging stuff 2023-02-20 18:37:00 -08:00
Joseph Eagar f52415f82a temp-sculpt-dyntopo: Add debug code for BMIdMap 2023-02-20 13:54:14 -08:00
Joseph Eagar 874668f0ad temp-sculpt-dyntopo: Attempt to fix element id bugs from merge 2023-02-17 03:35:44 -08:00
Joseph Eagar 4b0e540d6c Merge branch 'main' into temp-sculpt-dyntopo 2023-02-17 03:16:12 -08:00
Joseph Eagar bef4f18cbc temp-sculpt-dyntopo: Remove more of the old unique ID API 2023-02-16 21:49:32 -08:00
Joseph Eagar 029b2bc025 temp-sculpt-dyntopo: fix compile errors 2023-02-16 21:31:44 -08:00
Joseph Eagar 185d06ae74 temp-sculpt-dyntopo: Remove unrelated multres changes and old ID api 2023-02-16 12:03:25 -08:00
Joseph Eagar 555b703afa temp-sculpt-dyntopo: ANother compiler error
buildbot/vexp-code-experimental-coordinator Build done. Details
2023-02-11 15:18:59 -08:00
Joseph Eagar b0ba5dece3 temp-sculpt-dyntopo: more compiler error fixes
buildbot/vexp-code-experimental-coordinator Build done. Details
2023-02-11 15:13:27 -08:00
Joseph Eagar 1c0c0d377c temp-sculpt-dyntopo: More compiler fixes
buildbot/vexp-code-experimental-coordinator Build done. Details
2023-02-11 15:01:22 -08:00
Joseph Eagar b51ec6b1fc temp-sculpt-dyntopo: Fix compiler error
buildbot/vexp-code-experimental-coordinator Build done. Details
2023-02-11 14:48:46 -08:00
Joseph Eagar ac5c108234 temp-sculpt-dyntopo: And more compiler errors. . .
buildbot/vexp-code-experimental-coordinator Build done. Details
2023-02-11 14:43:40 -08:00
Joseph Eagar 8d47a57bae temp-sculpt-dyntopo: And yet more compiler errors
buildbot/vexp-code-experimental-coordinator Build done. Details
And to think, I went through the effort of compiling this
locally with clang
2023-02-11 14:36:07 -08:00
Joseph Eagar 65bdb7d53e temp-sculpt-dyntopo: And yet more compiler errors
And to think, I went through the effort of compiling this
locally with clang
2023-02-11 14:34:07 -08:00
Joseph Eagar 9188bf38c0 temp-sculpt-dyntopo: More compiler errors
buildbot/vexp-code-experimental-coordinator Build done. Details
2023-02-11 14:26:27 -08:00
Joseph Eagar d656a1aa13 temp-sculpt-dyntopo: Fix another compiler error
buildbot/vexp-code-experimental-coordinator Build done. Details
2023-02-11 14:18:12 -08:00
Joseph Eagar 1b788b5cf8 temp-sculpt-dyntopo: Fix compiler error 2023-02-11 14:17:08 -08:00
Joseph Eagar b82d08950d temp-sculpt-dyntopo: Fix compiler error 2023-02-11 14:14:33 -08:00
Joseph Eagar b413062a09 temp-sculpt-dyntopo: Fix layer brush and bmesh conversion bug
buildbot/vexp-code-experimental-coordinator Build done. Details
2023-02-11 14:09:04 -08:00
Joseph Eagar 206334fefd Merge branch 'main' into temp-sculpt-dyntopo 2023-02-11 12:57:17 -08:00
Joseph Eagar f319e95198 temp-sculpt-dyntopo: Remove multires stuff 2023-02-11 12:56:13 -08:00
Joseph Eagar 03878a08e8 temp-sculpt-dyntopo: Remove lockfree mempool
buildbot/vexp-code-experimental-coordinator Build done. Details
2023-02-11 11:47:25 -08:00
Joseph Eagar 5b7845cecc temp-sculpt-dyntopo: Turn on new unique element id api 2023-02-11 11:45:10 -08:00
Joseph Eagar c5a69cead3 temp-sculpt-dyntopo: Remove more unrelated changes
buildbot/vexp-code-experimental-coordinator Build done. Details
* Removed now-unused SCULPT_TOOL_ entries.
* Removed BLI_even_spline.h.
* Removed some changes to the pose brush.
* Cleaned up some brush flags.
2023-02-11 11:40:35 -08:00
Joseph Eagar 3f59466c29 temp-sculpt-dyntopo: Fix compile error
buildbot/vexp-code-patch-coordinator Build done. Details
2023-02-11 01:52:57 -08:00
Joseph Eagar d1fae4250e temp-sculpt-dyntopo: Rebase on top of master 2023-02-11 00:53:29 -08:00