Commit Graph

109440 Commits

Author SHA1 Message Date
8a99bc0829 Sculpt: couple of small ui tweaks 2021-09-28 10:26:20 -07:00
d1b0677817 Sculpt: UI updates and fixed hard edge mode setting
* Brush editor tab now defaults to old
  interface, with two options:
  - Advanced, which shows more options
  - Edit Mode, which shows workspace visibility buttons
* Hard edge mode (which forcibly sets face set slide to 0
  and enables preserve faceset boundarys) now works again.
* Smooth_strength_factor is now a brush channel with
  inheritance set to true.
* Alt-smooth now restores the hard edge mode and
  smooth_strength_factor from the active brush context.
  While both are default inherited from toolsetting defaults,
  it can be quite confusing if either have inheritance unset
  by the user in the Smooth brush.
2021-09-28 09:46:32 -07:00
b825fb4625 Fix last commit (why did that ever work?) 2021-09-27 02:55:25 -07:00
0d8fb1464e Sculpt Dyntopo: Fixed memory leak
* Fixed a particularly nasty memory leak
  where the entire process of entering sculpt
  mode was being done twice.

* Discovered that range tree is extremely slow.
  Got the alternative freelist version up and running,
  and replace a usage of GSet with a bitmap. However
  the new code is disabled pending further testing.
  Literally an order of magnutude improvement.
2021-09-27 02:39:05 -07:00
ef88b4f98b Sculpt: fix crash in multires layer brush 2021-09-26 15:50:24 -07:00
71c9af7eb5 Sculpt: Cleaned up custom customdata api
* Cleaned up the SculptCustomLayer API that is
  used for custom data.
* Various SculptCustomLayer references are now maintained
  in ss->custom_layers and are updated automatically when
  the CD layout changes.
* PBVH_GRIDS now forcibly allocate custom layers in simple_array
  mode (i.e. they don't allocated real customdata layers at all).
* SculptCustomLayers can optionally be preserved in the final mesh.
* Fixed handling of CD_TEMPORARY which was broken.
* The layer brush can now split the pbvh during use.
* Persistent base data is now saved as permanent CD layers (except
  for PBVH_GRIDS).  This is necessary for undo, if we want we can
  add special code to remove them on exising sculpt mode.
* The layer brush now uses the SculptCustomLayer API instead of
  having seperate bmesh and faces/grids implementations.

* In unrelated changes, fixed curve presets for clay brushes.
  - Still need to implement stabilized input mappings, which the
    clay thumb brush needs.
2021-09-26 15:11:42 -07:00
45f45d9e07 Sculpt: more brush engine stuff
* Setting sculpt paint color from
  the palette works again.
* Fixed various defaults.
2021-09-26 02:47:01 -07:00
fa8195ba55 Fix color palette panel 2021-09-25 14:20:57 -07:00
c1b8049adf Fix a few defaults for sculpt paint brush 2021-09-25 01:49:52 -07:00
49e64d4e26 Fix dyntopo undo crash 2021-09-25 01:36:23 -07:00
63044a696b Sculpt: fix paint brush defaults 2021-09-25 00:38:54 -07:00
028a0770f1 fix small but significant typo 2021-09-25 00:21:24 -07:00
6b382e7fb0 Fix a few regressions in other paint modes. 2021-09-25 00:19:31 -07:00
1b6beea2df Sculpt: More brush channels stuff 2021-09-24 21:04:49 -07:00
430e7efd09 Sculpt: Unnest channels.channels in RNA
* BrushChannelSet is now a pure collection. This
  eliminated the annoying brush.channels.channels
  paths, and also makes library overriding work.
* Now sure I've done this correctly. Struct extended
  collection properties are a bit confusing.
2021-09-24 18:47:24 -07:00
23f952d7d7 fix python script error 2021-09-24 02:44:13 -07:00
b7c1d58f9c remove debug line from last commit 2021-09-24 02:41:39 -07:00
eb9a5e8f8b Sculpt: more brush stuff
* Move more dyntopo settings to brush channels
* Implemented the unprojected radius hack in
  the new brush system.  I'm not really happy
  with it, but doing it properly is going to
  take some thought.
2021-09-24 02:38:20 -07:00
33cd635a82 Sculpt: fix clay brush
* BRUSH_MAPPING_INHERIT is now respected
  when unset.
* Also added inherit icon to
  input mapping curves ui.
2021-09-23 21:39:20 -07:00
aca54ad3e6 Fix bug in last commit 2021-09-23 16:15:50 -07:00
ccb3ca41cd Sculpt: Add a curve brush channel type
* Added a new curve brush channel type
* Added a BKE_brush_curve_strength_ex method
  that just takes preset and curve as arguments,
  instead of pulling them from Brush.
* Autosmooth and topology rake now have their
  own falloff curves.
2021-09-23 16:11:29 -07:00
99c0ee0558 Sculpt: cloth brush constraint solver is now multi-threaded
* Used a simple method of assigning constraints
  to threads.
* Constraints that couldn't be assigned are solved
  in the main thread.
2021-09-23 03:40:11 -07:00
c6a51c1259 Sculpt: move more brush settings to brush channels 2021-09-23 02:13:00 -07:00
7e220dc3f0 Fix brush defaults bug 2021-09-22 19:05:27 -07:00
36d5b6e959 Sculpt: Brush settings panel editor
* Moved brush settings (in sculpt mode) to
  (for now) a new properties editor tab.
* Brush settings can now be individually configured
  to show up in the workspace buttons.
* Brush settings can also be reordered.
* The new brush tab has a "preview" subpanel
  to preview the workspace settings layout.
  This is where settings are reordered.
2021-09-22 18:26:25 -07:00
0e2ec88e6b Tweak more brush channel settings 2021-09-22 03:31:34 -07:00
2a5b98c78f Fix backwards preset in last commit 2021-09-22 02:50:30 -07:00
668a819bec Sculpt: Added compile-type name checking for
brush channels.
2021-09-22 02:47:42 -07:00
a67ff7552c Tune up a few hot loops revealed by profiling. 2021-09-21 02:39:33 -07:00
c8004ff653 Just what version of C++ does the linux buildbot use, anyway. 2021-09-21 00:44:36 -07:00
fdffbf87ac Fix last commit 2021-09-21 00:13:43 -07:00
bee00909bc forgot a line 2021-09-21 00:04:10 -07:00
562723b080 More linux fixes 2021-09-21 00:03:32 -07:00
2195a5eb2c Try to fix another linux compile error 2021-09-20 23:28:03 -07:00
4307c0eb68 try to fix weird gcc compile error 2021-09-20 22:56:02 -07:00
2d473ff4a8 Sculpt: more brush stuff 2021-09-20 22:52:17 -07:00
2b2b569229 Disable a static assert on gcc. 2021-09-20 20:26:53 -07:00
015dae3dc5 add missing files 2021-09-20 19:42:31 -07:00
3fc687ad75 Sculpt: Finish color support for brush channels
* BRUSH_CHANNEL_VEC3/4 are now implemented
* New flag BRUSH_CHANNEL_COLOR
* Also tried to sculpt's usage of wm.radial_control in keymaps
2021-09-20 19:41:00 -07:00
76beed9068 Sculpt: More brush engine stuff, got automasking to work with it
* Sculpt now has an API to get brush channel settings.
  If a sculpt cache exists it will use the channels there
  (ss->cache->channels_final), otherwise it pulls them
  from a brush and Sculpt toolsettings. Exampes:

  float f = SCULPT_get_float(ss, "setting", sd, brush);
  itn i = SCULPT_get_int(ss, "setting", sd, brush);

* Improved the UI a bit
2021-09-20 14:10:35 -07:00
645aee0835 Fix small crash in last commit and a few typos 2021-09-20 03:34:13 -07:00
83bfa950b1 Sculpt: add missing files 2021-09-20 03:14:39 -07:00
898625547f Fix problem in last commit 2021-09-20 03:14:14 -07:00
73150981c8 Sculpt: More brush channel stuff
* The input device curves for brush channels
  now use a copy on write mechanism.
  + It's based on a global cache of curves.
    The alternative is to reference count
    BrushChannels, which I also implemented
    then abandoned.
  + Profiling showed that copying CurveMapping
    instances was actually a problem.

* Lots of small fixes to the old<-> new brush setting
  conversion code;

* Brush commands can now, sortof, have individual
  spacing.  The default brush spacing still acts
  as a minimum though.

* Added a BLI_ghash_lookup_p_ex method that
  returns the key ptr inside the ghash (it
  returns the actual key, not a pointer to
  Entry.key).
* Added a general 1d CurveMapping preset operator
  that uses an RNA path to get the curve.
2021-09-20 03:01:30 -07:00
c9f1e104da Sculpt: Brush channels names are now lower-case instead
of upper case.
2021-09-19 16:17:01 -07:00
336b263b56 Sculpt: brush engine stuff
BrushChannels are now stored in linked lists
instead of simple arrays.  This helps to
avoid memory corruption.

I had originally wanted to be able to pass
BrushChannels by value, but that doesn't really
work since they heap allocd data (the input
mapping curves).
2021-09-19 15:35:10 -07:00
b3ed969b86 commit prior to small refactor 2021-09-19 13:30:43 -07:00
87feba04dd Sculpt: more brush engine stuff; do not test.
Pushing this commit early due to computer
weirdness
2021-09-19 01:11:35 -07:00
1ca57bc5f4 Sculpt: flushed out brush channel RNA and made basic UI 2021-09-18 12:10:14 -07:00
7749b89d74 Sculpt: Added some icons and commit icon_geom.blend into the branch
Help with icons would be appreciated.  The
scene project icon kind of came out looking
like a band-aid.
2021-09-18 02:43:03 -07:00