Commit Graph

21689 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
777168cc00 Sculpt-dev: fix memory corruption 2021-11-28 02:37:01 -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
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
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
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
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
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
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
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
c88701178b Sculpt-dev: fix missing NULL assignment 2021-11-13 16:17:16 -08: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
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
1143bf281a Cleanup: spelling in comments, comment block formatting 2021-11-13 13:07:13 +11:00
acc800d24d Cleanup: clang-format 2021-11-13 12:47:18 +11:00
d845ba481c Fix T91826: Inconsistent node socket name identifier separator
Previously both `.` and `_` were used as separators when finding
a unique name for a socket. This removes the use of `.`, since `_`
was more common. It also does versioning for all of a file's node
trees to make sure that they all use the `_` convention.

Differential Revision: https://developer.blender.org/D13181
2021-11-12 12:22:43 -06:00
ddf66cd060 Merge remote-tracking branch 'origin/blender-v3.0-release' 2021-11-12 14:36:55 +01:00
b4cfe80547 Assets: Store Action sub-type in asset metadata
Blender 3.0 will only support single-frame Actions in the pose library.
The goal of this patch is to lay the groundwork for making it possible
for the Asset Browser to reject/hide "animation snippet" Action assets.

Determining whether an Action has one or more frames (i.e. whether it
has a single pose or animation) requires inspecting the Action itself,
and thus loading the data-block itself. This would make it impossible to
quickly determine from the asset browser.

To solve this, the Action is inspected before saving, and a
`"is_single_frame"` boolean (well, 0/1 integer) IDProperty is added.

Reviewed by: Severin

Differential Revision: https://developer.blender.org/D13202
2021-11-12 14:36:22 +01:00
86ca206db8 Cleanup/document BKE_blender_copybuffer.
* Rename the 'copy' functions to make it clear they belong to the same
  'group' and are to be used together.
* Fix `flag` parameter of `BKE_copybuffer_paste` being a short instead
  of an int.
* Improve documentation.
2021-11-12 10:20:49 +01:00
aa1c44a113 Merge branch 'blender-v3.0-release' 2021-11-12 18:35:19 +11:00
02333544d1 Merge branch 'blender-v3.0-release' 2021-11-12 18:35:13 +11:00
1a7757b0bc Fix T91444: Edge Loop Preview fails with two Mirror Modifiers
The mirror modifiers merge option caused unnecessary re-ordering
to the vertex array with original vertices merging into their copies.

While this wasn't an error, it meant creating a 1:1 mapping from input
vertices to their final output wasn't reliable (when looping over
vertices first to last) as is done in
BKE_editmesh_vert_coords_when_deformed.

As merging in either direction is supported, keep the source meshes
vertices in-order since it allows the vertex coordinates to be extracted.
2021-11-12 18:27:47 +11:00
d612d92630 Cleanup: use term sequence_strip instead of vse_strip 2021-11-12 17:38:58 +11:00
50f32025ac Merge branch 'blender-v3.0-release' 2021-11-11 18:27:31 +01:00
393879f30c Fix: wrong field inferencing with unavailable sockets 2021-11-11 18:26:40 +01:00
52c617802f Merge branch 'blender-v3.0-release' 2021-11-11 09:27:42 -06:00
Martijn Versteegh
7aa39b40f4 Fix: Prevent use of uninitialized memory when creating Bezier spline
When Constructing bezier splines from dna, the positions of the
left/right handles were set directly in the internal vectors, by
requesting a reference to them. The problem is that
BezierSpline::handle_positions_left() calls ensure_auto_handles()
before returning the reference. That function does some calculations on
uninitialized memory if the positions array is not yet filled.

Differential Revision: https://developer.blender.org/D13107
2021-11-11 09:25:10 -06:00
d753ebd40a Cleanup: spelling in comments 2021-11-11 14:59:30 +11:00
a6e4cb092e Merge branch 'blender-v3.0-release' 2021-11-10 13:53:44 +01:00