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-25Cleanup: replace static_casts with functional casts for numeric typesCampbell Barton
2022-07-06Curves: Port subdivide node to the new data-blockHans Goudey
This commit moves the subdivide curve node implementation to the geometry module, changes it to work on the new curves data-block, and adds support for Catmull Rom curves. Internally I also added support for a curve domain selection. That isn't used, but it's nice to have the option anyway. Users should notice better performance as well, since we can avoid many small allocations, and there is no conversion to and from the old curve type. The code uses a similar structure to the resample node (60a6fbf5b599) and the set type node (9e393fc2f125). The resample curves node can be restructured to be more similar to this soon though. Differential Revision: https://developer.blender.org/D15334
2022-07-04Curves: Expose function to calculate vector handlesHans Goudey
2022-05-30Cleanup: make formatDalai Felinto
2022-05-30Cleanup: Fix typoHans Goudey
Contributed by @luzpaz Differential Revision: https://developer.blender.org/D15058
2022-04-14Fix: Assert evaluating single point Bezier curveHans Goudey
Just return early in that case to keep the rest of the function simpler.
2022-04-05Fix: Assert fails when evaluating single point Bezier curveHans Goudey
Return early when there is only one point, since that means there are no segments.
2022-04-01Geometry Nodes: Port set handle nodes to new data-blockHans Goudey
This commit ports the "Set Handle Positions" and "Set Hanle Type" nodes to use the new curves data-block. The nodes become simpler and likely much faster too, though they're usually not the bottleneck anyway. Most of the code is ported from `BezierSpline` directly. The majority of the complexity comes from the interaction between different automatically calculated handle types. In comparison `BezierSpline`, the calculation of auto handles is done eagerly-- mostly because it's simpler. Eventually lazy calculation might be good to add. Differential Revision: https://developer.blender.org/D14464
2022-03-30Cleanup: unbalanced doxy sectionsCampbell Barton
2022-03-29Fix: incorrect assert in new codeHans Goudey
2022-03-25Cleanup: Add asserts, remove default caseHans Goudey
2022-03-25Curves: Bezier and general interpolate to evaluated utilityHans Goudey
This commit implements generic evaluation for Bezier curves (which is really just linear interpolation, since attributes are not stored on Bezier handles). For complete parity with the old curve type, we would have to add options for this (RNA: `Spline.radius_interpolation`), but it's not clear that we want to do that. This also adds a generic `interpolate_to_evaluate` utility on curves that hides the implementation details. Though there is theoretically a performance cost to that, without some abstraction calling code would usually be too complex. Differential Revision: https://developer.blender.org/D14447
2022-03-25Cleanup: Use more specific variable nameHans Goudey
2022-03-18Fix: Curves last evaluated segment is emptyHans Goudey
A mistake in 8538c69921662164. The offsets include the segment at the corresponding index, but the evaluated offset calculation was adjusting the offset for the second to last segment.
2022-03-17Fix: Compiler error on windows and macHans Goudey
The previous fix including `<algorithm>` was an improvement but not the actual error, which appears to be that `int64_t` is long long int on one platform but just long int on another. The fix includes the template argument directly.
2022-03-17Fix: Build error after curve evaluation commitHans Goudey
2022-03-16Curves: Initial evaluation for curves data-blockHans Goudey
This patch adds evaluation for NURBS, Bezier, and Catmull Rom curves for the new `Curves` data-block. The main difference from the code in `BKE_spline.hh` is that the functionality is not encapsulated in classes. Instead, each function has arguments for all of the information it needs. This makes the code more reusable and removes a bunch of unnecessary complications for keeping track of state. NURBS and Bezier evaluation works the same way as existing code. The Catmull Rom implementation is new, with the basis function based on Cycles code. All three types have some basic tests. For NURBS and Catmull Rom curves, evaluating positions is the same as any generic attribute, so it's implemented by the generic interpolation to evaluated points. Bezier curves are a bit special, because the "handle" control points are stored in a separate attribute. This patch doesn't include generic interpolation to evaluated points for Bezier curves. Ref T95942 Differential Revision: https://developer.blender.org/D14284