Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2022-09-14Curves: Improve sculpting performance by reducing allocationsHans Goudey
The snake hook and grow/shrink brushes need some arrays for input to the length paramterization code. These were allocated and freed for every curve. Instead, use a local buffer for each task execution. Differential Revision: https://developer.blender.org/D15964
2022-07-22Curves: support sculpting on deformed curvesJacques Lucke
Previously, curves sculpt tools only worked on original data. This was very limiting, because one could effectively only sculpt the curves when all procedural effects were turned off. This patch adds support for curves sculpting while looking the result of procedural effects (like deformation based on the surface mesh). This functionality is also known as "crazy space" support in Blender. For more details see D15407. Differential Revision: https://developer.blender.org/D15407
2022-07-05Curves: move curves surface transforms to blenkernelJacques Lucke
This utility struct is useful outside of sculpting code as well.
2022-06-17Cleanup: deduplicate generating transform matrices in curves brushesJacques Lucke
2022-06-05Cleanup: Remove unused BKE_spline.hh includesHans Goudey
2022-06-03Cleanup: deduplicate resampling curve after moving last pointJacques Lucke
2022-06-03Cleanup: deduplicate retrieving data from context in curves brushesJacques Lucke
2022-05-31Curves: Add soft selection in sculpt modeHans Goudey
This commit adds a float selection to curve control points or curves, a sculpt tool to paint the selection, and uses the selection influence in the existing sculpt brushes. The selection is the inverse of the "mask" from mesh sculpt mode currently. That change is described in more detail here: T97903 Since some sculpt tools are really "per curve" tools, they use the average point selection of all of their points. The delete brush considers a curve selected if any of its points have a non-zero selection. There is a new option to choose the selection domain, which affects how painting the selection works. You can also turn the selection off by clicking on the active domain. Sculpt brushes can be faster when the selection is small, because finding selected curves or points is generally faster than the existing brush intersection and distance checks. The main limitation currently is that we can't see the selection in the viewport by default. For now, to see the selection one has to add a simple material to the curves object as shown in the differential revision. And one has to switch to Material Preview in the 3d view. Differential Revision: https://developer.blender.org/D14934
2022-05-23Fix: Sample pressure properly for 3D curves sculpt brushesHans Goudey
For the "Sphere" 3D brushes, the depth and radius are only sampled at the beginning of the stroke. This didn't work when tablet pressure is used as a factor for the brush radius. Now the 3D brush depth is found with the max radius (as if the pressure was 1.0), but the pressure factor is used afterwards. Restructuring the way the brush executors stored the radius made the change a bit clearer, which is where most of the diff comes from. Differential Revision: https://developer.blender.org/D15002
2022-05-20Curves: Support pressure in sculpt brushesHans Goudey
Multiply the radius and strength of sculpt brushes by the pressure when "use pressure" is turned on. The brush system isn't responsible for this, so the pressure needs to be stored in `StrokeExtension`. Differential Revision: https://developer.blender.org/D14996
2022-05-17Cleanup: Use const in curves sculpt codeHans Goudey
This makes it much clearer what data is supposed to be modified and what data is just used to influence the operation. The new `BKE_paint_brush_for_read` function isn't great design, but it can be removed or renamed if similar changes are applied to more places. Also pass pointers explicitly to `sample_curves_3d_brush` rather than reusing the `bContext`. This makes it clearer what data the function actually needs. Differential Revision: https://developer.blender.org/D14967
2022-05-12Curves: Add notifier to update spreadsheet when sculptingDalai Felinto
2022-05-04Curves: support symmetry in curves sculpting brushesJacques Lucke
This adds support for X/Y/Z symmetry for all brushes in curves sculpt mode. In theory this can be extended to support radial symmetry, but that's not part of this patch. It works by essentially applying a brush stroke multiple with different transforms. This is similiar to how symmetry works in mesh sculpt mode, but is quite different from how it worked in the old hair system (there it tried to find matching hair strands on both sides of the surface; if none was found, symmetry did not work). Differential Revision: https://developer.blender.org/D14795
2022-04-19Fix: Assert when sculpting empty curvesHans Goudey
2022-04-08Add a utility for sampling segment indices and factors from arbitraryHans Goudey
lengths along a set of points. This can be used for the sample curves node, or finding new points along a curve when extending or shrinking it. This commit uses it in the snake hook brush as an example. The logic is similar to the uniform length sampling, but the next sample length is retrieved from the input instead of multiplication. For the sample node in the future, though this sort of sampling can be potentially done more efficiently for specific curve types besides poly curves, it's simpler, at least as a start, to work on a set of evaluated points that can be treated like a poly curve. Differential Revision: https://developer.blender.org/D14571
2022-04-07Curves: Name mutable data retrieval functions explicitlyHans Goudey
Add "for_write" on function names that retrieve mutable data arrays. Though this makes function names longer, it's likely worth it because it allows more easily using the const functions in a non-const context, and reduces cases of mistakenly retrieving with edit access. In the long term, this situation might change more if we implement attributes storage that is accessible directly on `CurvesGeometry` without duplicating the attribute API on geometry components, which is currently the rough plan. Differential Revision: https://developer.blender.org/D14562
2022-03-30Cleanup: spelling in commentsCampbell Barton
2022-03-29Curves: improve Snake Hook brushJacques Lucke
This implements the spherical brush and different falloff modes for the Snake Hook brush. Differential Revision: https://developer.blender.org/D14408
2022-03-24Cleanup: Adjust naming in new curves codeHans Goudey
Rename "size" variables and functions to use "num" instead, based on T85728 (though this doesn't apply to simple C++ containers, it applies here). Rename "range" to "points" in some functions, so be more specific. Differential Revision: https://developer.blender.org/D14431
2022-03-17Curves: separate sculpt brushes into separate filesJacques Lucke
This makes it easier to work on these brushes in parallel.