Commit Graph

111528 Commits

Author SHA1 Message Date
e4b6180c4e Sculpt-dev: fix elastic deform brush
* Volume preservation had wrong bounds in
  elastic deform brush leading to wrong
  behavior.
* Fixed unprojected_radius channel not
  being shown in header when scene radius
  unit is on.
* Draw face sets now only fully rebuild draw buffers
  in indexed draw modes that require it.
2021-12-02 16:37:31 -08:00
61e2d15bfe Sculpt-dev: fix memory corruption 2021-11-28 18:50:42 -08:00
62f68639e0 Sculpt-dev: Fix color filter not auto
creating a color layer.

* This is probably something I broke.
  There was a SCULPT_has_colors() call that
  wasn't needed.
2021-11-28 18:36:03 -08:00
777168cc00 Sculpt-dev: fix memory corruption 2021-11-28 02:37:01 -08:00
7ad9afd08a Sculpt-dev: fix broken color filter, alpha
was being set to garbage value.
2021-11-28 02:30:28 -08:00
628925a5c6 Sculpt-dev: fix thread contention
in weighted smooth
* Cached face areas are now updated
  in a double buffered fashion;
  all threads read from one side of
  the buffer while the other is written
  to by the threads that own a given
  face; the buffers are swapped on
  each iteration of a tool that uses
  face areas.
* Fixes smooth flickering.
2021-11-28 02:23:06 -08:00
e21c21bbf9 Sculpt-dev: support area weighted smooth for PBVH_FACES
* This was actually kind of annoying; the
  vertex->face-area-list code is in pbvh and
  relies on edge ordering
  around verts, but that order is non-trivial for
  PBVH_FACES (relying as it does on a vertex->poly
  map).  This ordering was calculated entirely in
  editors/sculpt_paint/sculpt.c, not callable from
  pbvh.
* The solution was to add a helper function to pbvh
  for building vertex->edge lists from vertex->poly
  maps.  This is then used by both sculpt.c and the
  vertex->face-area-list code.

* Also improved boundary bevel smooth a bit.  I'm
  thinking of extracting it from SCULPT_neighbor_coords_average_interior
  into its own function and possibly its own brush.
2021-11-28 01:19:23 -08:00
e5804dc607 Sculpt-dev: fix corruption in dyntopo
fast pbvh leaf builder callback.
2021-11-27 09:17:53 -08:00
66d362b464 Sculpt-dev: don't show input mapping
settings in sculpt context menu
2021-11-27 09:02:49 -08:00
1e4b49d3c1 Sculpt-dev: Add brush_eval field to Paint
* Paint now has a brush_eval field which
  is used in leu of ->brush if non-null.
* This lets us get rid of all the annoying:
  `brush = ss->cache ? ss->cache->brush : BKE_paint_brush`
  code.  Now it's just BKE_paint_brush.
* Used by SCULPT_run_command.
* Also fixed nasty scene spacing bug.
2021-11-26 21:10:14 -08:00
a662f81822 Sculpt-dev: fix multires crash in last commit 2021-11-26 16:27:19 -08:00
8de1899c33 Sculpt-dev: bugfixes
* Fixed PBVH_FACES vcol draw bug.
* Fixed boundary smooth being turned on
  if its temp customdata layer exists.
* Fixed unnesting of brush panels from
  last commit improperly showing up
  in the workspace tab for sculpt
  instead of the brush tab.
2021-11-26 15:39:44 -08:00
f13bedd649 Sculpt-dev: sculpt_init_tool_override_channels
related fixes

Various fixes so sculpt_init_tool_override_channels
for shift-smooth can replicate the prior behavior:

* Brush spacing will now look up brush channel
  spacing directly for sculpt, instead of relying
  on copying the channel data into Brush.
* Brush spacing code will now use brush channel
  pressure for sculpt.  Fixes broken shift-smooth
  pen pressure.
* The falloff_curve channel is now automatically
  added (before it was only used internally by
  command lists, the code was defaulting to
  the Brush field otherwise).
* BrushCurve now has an option for custom curve
  presets to have negative slopes.
* The Falloff panel now puts the type dropbox
  inside the panel header.
* Falloff panel also now uses brush channel data in
  sculpt mode.
* falloff_shape is now a brush channel

In a somewhat unrelated change, I also unnested the
Brush Settings subpanels.  It's been driving me
insane for a very, very long time.  Much more
usable this way.
2021-11-25 11:34:24 -08:00
9f45edd430 Sculpt-dev: fix smooth_strength_factor bug
* Fixed bug where BRUSH_MAPPING_INHERIT was
  being or'd to BrushMapping->flag instead
  of assigned to ->inherit_mode.
* Fixed smooth_strength_factor
  and smooth_strength_projection.
* Also added yet more asan poisoning to mempool
* Added a function to build final inherited brush
  channel, BKE_brush_channel_copy_final_data.  Takes
  BrushMapping->inherit_mode into account.
2021-11-23 19:46:18 -08:00
7f933459a8 Sculpt-dev: undo debug disabling of threads for
color filter.
2021-11-20 08:52:40 -08:00
2255892f5b Sculpt-dev: add random_[hue/sat/value]
color filter options from
	    sculpt-mode-features

* Follows comment in mesh filter's randomize and
  uses BLI_hash_int_3d.
* Added a seed parameter.
* Also renamed SCULPT_get_mdyntopo to SCULPT_get_sculptvert.
2021-11-20 08:49:14 -08:00
7753fda1b5 Sculpt-dev: fix broken vcol attr
auto-creation

* Fixed BKE_sculpt_color_layer_create_if_needed
* Also fixed BKE_id_attribute_active_color_set,
  accidentally pasted the getter's precondition.
2021-11-20 07:49:40 -08:00
39292be4cf Sculpt-dev: fix another crash 2021-11-19 07:08:03 -08:00
605a06975c Sculpt-dev: fix gcc compile error 2021-11-19 07:01:17 -08:00
bcf91617b3 Sculpt-dev: fix crash
* Tool slots weren't initializes sculpt
  brushes properly.
2021-11-19 06:58:54 -08:00
26a82fd5cc Sculpt-dev: improve uv smooth brush a bit 2021-11-19 04:50:20 -08:00
9c9be5599b Sculpt-dev: SCULPT_reproject_cdata fixes
* SCULPT_reproject_cdata now forcibly re-snaps
  for non-boundary loops.
* Also fixed a wrong radial loop iterator.
2021-11-19 03:28:58 -08:00
e5394e962a Sculpt-dev: dyntopo now detects uv island
boundaries, independently of
	    edge seams.
2021-11-17 16:42:56 -08:00
7d870c75fb sculpt-dev: remove debug ATTR_NO_OPTS 2021-11-17 15:32:44 -08:00
5ce01b8ce8 * Sculpt-dev: pbvh draw cleanup
* PBVH drawing for eevee is now used for
  PBVH_FACES as well as PBVH_BMESH.
* PBVH_FACES now uses pbvh draw for eevee rendering
* Refactored gpu_pbvh_gpu_make_vcol_offs into a
  more general gpu_pbvh_gpu_make_attr_offs.
  This should be a usable alternative to using a generic
  attribute gpu system (whether the one that's #ifdef'd out
  in gpu_buffers.c, or the new one that hit master
  recently).
* Textured workbench draw mode now works for pbvh drawing.
* Fixed nasty stack overflow in dyntopo edge collapse.
2021-11-17 15:27:47 -08:00
51f1a359a1 Sculpt-dev: run clang-format on a few files 2021-11-17 13:16:09 -08:00
a4ce7b6741 Sculpt-dev: fix pbvh draw getting gpu format
out of sync.

GPU_pbvh_update_attribute_names now returns a bool
if the format has changed.
2021-11-17 13:14:10 -08:00
4144366bc1 Sculpt-dev: fix bug in last commit 2021-11-17 04:18:09 -08:00
c4781c7243 Sculpt-dev: cross-module ref cleanup
* Removed a bunch of nasty editors->blenkernel
  dependencies (2 still remain).
* Fixed a few bugs in last commit.
2021-11-17 04:08:41 -08:00
e724479ca6 Sculpt-dev: sculpt colors stuff
* Mask by color now works for dyntopo.
* Attribute and vertex color lists in the UI
  now hide temporary CD layers.
* Added a specific op for removing vertex color
  attributes.
* Fixed various bugs.
2021-11-17 03:09:37 -08:00
7a55066b18 Sculpt-dev: Add support for attribute triplets
It simply wasn't maintainable to store active/render
vertex color layer as integer indices into the
global attribute list.  Making that work would've
required a great deal of boilerplate that would
have to be inserted in lots of places.  There
is simply no justification for doing that.

Instead, I've coded an AttributeRef struct that
simply stores a (type, name, domain) triplet to
uniquely reference an attribute layer.

This will be submitted as a patch for master
too.
2021-11-16 21:58:50 -08:00
b2c64e2147 Sculpt-dev: fix compile error 2021-11-16 19:17:13 -08:00
ddd1af5901 Sculpt-dev: fix crash 2021-11-16 16:23:42 -08:00
581dc18c08 Remove debug ATTR_NO_OPT 2021-11-16 13:32:42 -08:00
cddcc54f32 Sculpt-dev: fix brush input mapping inheritance
* Brush input mappings now have three
  inheritance mode: "always", "never" and
  "channel" (use channel's inheritance mode).
* Note that the UI exposes a single inherit icon,
  which just toggles between "always" and
  "never," to lessen user confusion.
* Brush mappings default to "never" inheritance
  mode.
* Fixed wrong node update flag in bke_pbvh_insert_face_finalize
  leading to disappearing parts of the mesh.
2021-11-16 13:26:39 -08:00
b43119ad84 Sculpt-dev: add icons for twist and multires
displacement smear.
2021-11-14 03:34:26 -08:00
e68c7df94e Sculpt-dev: use standard UI idioms
Thanks to @TonatiuhdeSanJulián on chat
for helping me with this.
2021-11-14 02:37:51 -08:00
e1cf0657d8 Merge branch 'master' into sculpt-dev 2021-11-14 02:35:23 -08:00
9f7ebd9c39 Sculpt-dev: update pbvh_print_mem_size 2021-11-14 01:59:08 -08:00
daf03b6f56 Sculpt-dev: fix another freelist id bug 2021-11-14 01:28:18 -08:00
b633032711 Sculpt-dev: add corruption check
Stopgap measure to deal with rare
PBVH corruption until I have the
time to properly track it down.
2021-11-14 01:10:02 -08:00
2e782109fc Sculpt-dev: Replace usage of smallhash with ghash
SmallHash doesn't deal with repeated removals
and insertions very well.
2021-11-13 18:57:39 -08:00
7e82c840b7 Fix text editor auto-close with quotes
Back-spacing a quote from the beginning of a line
would delete the quote in-front instead of doing nothing.
2021-11-14 11:26:06 +11:00
c88701178b Sculpt-dev: fix missing NULL assignment 2021-11-13 16:17:16 -08:00
2549384baa Cleanup: minor tweaks to auto-close
Spelling and failure to reuse variable missed in review.
2021-11-14 11:11:20 +11:00
73047c69ea BLF: Use Floats for Font Point Sizes
Allow the use of floating-point values for font point sizes, which
allows greater precision and flexibility for text output.

See D8960 for more information, details, and justification.

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

Reviewed by Campbell Barton
2021-11-13 09:39:18 -08:00
a72721a2ae Sculpt-dev: Performance improvements
* PBVH_BMESH construction is now partially
  threaded.
* Fixed n**2 behavior in freelist-based
  bmesh id implementation.  I'd really
  rather get range-tree faster, but
  this works as a stopgap.
* Removed a bunch of debug ATTR_NO_OPTs.
2021-11-13 01:13:47 -08:00
e8a8bb67fc Cleanup: Correct order of guard and lock in moviecache_valfree
Fix own mistake in rB7061d1e39fe

In my attempt to quickly address T92838, along with the original bug, I
made a nonsensical choice to use the limiter lock to guard the check
against the cache item itself. While harmless, it is not necessary and
semantically wrong / potentially confusing to future readers of the code.

Differential Revision: https://developer.blender.org/D13122
2021-11-12 20:47:26 -08:00
ab9ec193c3 Fix splash screen showing on startup with files loaded by scripts
Suppressing the splash was only done when passing in an argument from
the command line.

Remove G.file_loaded, as it is misleading, only set once on startup,
replace with G.relbase_valid which is used everywhere else to check
if the file path should be used.
2021-11-13 14:05:27 +11:00
Matheus Santos
c4ea5cb1a3 Text Editor: Auto close relevant characters
Support the ability to close relevant characters like '(', '[' and '{'.

It will also delete the pair character if they're empty.

Ref D13119

Reviewed By: campbellbarton
2021-11-13 13:56:31 +11:00