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-08-31Fix: reverse uv lookup fails due to floating point accuracy issuesJacques Lucke
The case when the query uv is almost on an edge but outside of any triangle was handled before. Now the case where the query uv is almost on an edge but inside more than one triangle is handled as well.
2022-08-23Fix T100562: Realize Instances node crashes when there is an attribute name ↵Jacques Lucke
collision
2022-08-19Fix: nurbs basis cache not computed before it is usedJacques Lucke
2022-07-27Fix: missing evaluated offsets in Resample Curve nodeJacques Lucke
Differential Revision: https://developer.blender.org/D15556
2022-07-27Geometry Nodes: Shortest Paths nodesErik Abrahamsson
This adds three new nodes: * `Shortest Edge Paths`: Actually finds the shortest paths. * `Edge Paths to Curves`: Converts the paths to separate curves. This may generate a quadratic amount of data, making it slow for large meshes. * `Edge Paths to Selection`: Generates an edge selection that contains all edges that are part of a path. This can be used with the Separate Geometry node to only keep the edges that are part of a path. For large meshes, this approach can be much faster than the `Edge Paths to Curves` node, because less data is created. Differential Revision: https://developer.blender.org/D15274
2022-07-25Fix: Assert in resample curve node with single point curveHans Goudey
2022-07-25Fix T99851: Subdivide Curve node does not initialize attributes of end pointJacques Lucke
2022-07-25Fix T99889: Fillet Curve node uses wrong radiusJacques Lucke
2022-07-25Curves: add warning when invalid uv map is used when adding curvesJacques Lucke
UV maps that are used for surface attachment must not have overlapping uv islands, because then the same uv coordinate would correspond to multiple surface positions. Ref T99936.
2022-07-25Geometry: detect when the sample uv is in multiple trianglesJacques Lucke
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-21Cleanup: Rename length parameterization interpolation functionHans Goudey
The name makes more sense as an action, other interpolation methods besides linear probably don't make sense here anyway.
2022-07-20Curves: fix uninitialized curve type when adding new curvesJacques Lucke
2022-07-20Cleanup: Access attributes with new API instead of geometry componentsHans Goudey
Remove the boilerplate of using a local geometry component just to use the attribute API that was necessary before b876ce2a4a4638142439.
2022-07-20Curves: Remove use of CurveEval in sculpt brushesHans Goudey
This commit removes the use of PolySpline for resampling curves and replaces it with the length parameterization utility for that purpose. I didn't test performance, but I would expect the shrinking to be slightly faster because I reused some arrays to avoid allocating them for every curve. I noted some potential improvements in the "add curves" function. Differential Revision: https://developer.blender.org/D15342
2022-07-20Curves: Port fillet node to the new data-blockHans Goudey
This commit ports the fillet curves node to the new curves data-block, and moves the fillet node implementation to the geometry module to help separate the implementation from the node. The changes are similar to the subdivide node or resample node. I've resused common utilities where it makes sense, though some things like the iteration over attributes can be generalized further. The node is now multi-threaded per-curve and inside each curve, and some buffers are reused per curve to avoid many allocations. The code is more explicit now, and though there is more boilerplate to pass around many spans, the more complex logic should be more readable. Differential Revision: https://developer.blender.org/D15346
2022-07-20Point Cloud: Remove redundant custom data pointersHans Goudey
Similar to e9f82d3dc7eebadcc52, but for point clouds instead. Differential Revision: https://developer.blender.org/D15487
2022-07-20Curves: Remove redundant custom data pointersHans Goudey
These mutable pointers present problems with ownership in relation to proper copy-on-write for attributes. The simplest solution is to just remove them and retrieve the layers from `CustomData` when they are needed. This also removes the complexity and redundancy of having to update the pointers as the curves change. A similar change will apply to meshes and point clouds. One downside of this change is that it makes random access with RNA slower. However, it's simple to just use the RNA attribute API instead, which is unaffected. In this patch I updated Cycles to do that. With the future attribute CoW changes, this generic approach makes sense because Cycles can just request ownership of the existing arrays. Differential Revision: https://developer.blender.org/D15486
2022-07-19Geometry Nodes: Copy parameters when copying a curves data-blockHans Goudey
Previously, things like materials, symmetry, and selection options stored on `Curves` weren't copied to the result in nodes like the subdivide and resample nodes. Now they are, which fixes some unexpected behavior and allows visualization of the sculpt mode selection. In the realize instances and join nodes the behavior is the same as for meshes, the parameters are taken from the first (top) input. I also refactored some functions to return a `CurvesGeometry` by-value, which makes it the responsibility of the node to copy the parameters. That should make the algorithms more reusable in other situations. Differential Revision: https://developer.blender.org/D15408
2022-07-19Fix T99781: uv minimize stretch now unflips flipped facesChris Blackbourn
Add a small gradient to flipped faces proportional to length of edges. Differential Revision: https://developer.blender.org/D15475
2022-07-14Geometry Nodes: update curve type counts after realizing instancesJacques Lucke
The type counts have to be updated eagerly. This was missing from the realize-instances code before, leading to bugs further down the line.
2022-07-14Fix build and warnings from previous commit.Chris Blackbourn
2022-07-14Fix T99684: Upgrade Averages Island Scale with options Scale UV and ShearChris Blackbourn
Differential Revision: https://developer.blender.org/D15421
2022-07-08Geometry Nodes: new geometry attribute APIJacques Lucke
Currently, there are two attribute API. The first, defined in `BKE_attribute.h` is accessible from RNA and C code. The second is implemented with `GeometryComponent` and is only accessible in C++ code. The second is widely used, but only being accessible through the `GeometrySet` API makes it awkward to use, and even impossible for types that don't correspond directly to a geometry component like `CurvesGeometry`. This patch adds a new attribute API, designed to replace the `GeometryComponent` attribute API now, and to eventually replace or be the basis of the other one. The basic idea is that there is an `AttributeAccessor` class that allows code to interact with a set of attributes owned by some geometry. The accessor itself has no ownership. `AttributeAccessor` is a simple type that can be passed around by value. That makes it easy to return it from functions and to store it in containers. For const-correctness, there is also a `MutableAttributeAccessor` that allows changing individual and can add or remove attributes. Currently, `AttributeAccessor` is composed of two pointers. The first is a pointer to the owner of the attribute data. The second is a pointer to a struct with function pointers, that is similar to a virtual function table. The functions know how to access attributes on the owner. The actual attribute access for geometries is still implemented with the `AttributeProvider` pattern, which makes it easy to support different sources of attributes on a geometry and simplifies dealing with built-in attributes. There are different ways to get an attribute accessor for a geometry: * `GeometryComponent.attributes()` * `CurvesGeometry.attributes()` * `bke::mesh_attributes(const Mesh &)` * `bke::pointcloud_attributes(const PointCloud &)` All of these also have a `_for_write` variant that returns a `MutabelAttributeAccessor`. Differential Revision: https://developer.blender.org/D15280
2022-07-06BLI: improve reverse uv sample in edge casesJacques Lucke
Allow for a small epsilon to improve handling of uvs that are on edges. Generally, when using reverse uv sampling, we expect that the sampling is supposed to succeed.
2022-07-06Cleanup: Fix compiler warningsLoren Osborn
Use consistent class/struct declaration in forward declarations. Differential Revision: https://developer.blender.org/D15382
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-05Curves: Move type conversion to the geometry moduleHans Goudey
This helps to separate concerns, and makes the functionality available for edit mode.
2022-07-05BLI: use a slightly less trivial reverse uv samplerJacques Lucke
This approach is still far from ideal, but at least it has linear complexity in the common case instead of quadratic.
2022-07-02BLI: refactor length parameterizationJacques Lucke
This refactor had two main goals: * Simplify the sampling code by using an algorithm with fewer special cases. * Generalize the sampling to support non-sorted samples. The `SampleSegmentHint` optimization was inspired by `ValueAccessor` from OpenVDB and improves performance 2x in my test cases. Differential Revision: https://developer.blender.org/D15348
2022-07-02BLI: improve span access to virtual arraysJacques Lucke
* Make the class names more consistent. * Implement missing move-constructors and assignment-operators.
2022-07-01Fix: Correct attribute names in resample curves codeHans Goudey
2022-06-29Geometry Nodes: Only calculate mesh to volume bounds when necessaryHans Goudey
In "size" voxel resolution mode, calculating the bounds of the mesh to volume node's input mesh isn't necessary. For high poly this can take a few milliseconds, so this commit skips the calculation unless we need it for the "Amount" mode. Differential Revision: https://developer.blender.org/D15324
2022-06-29Geometry Nodes: Add Mesh To Volume NodeErik Abrahamsson
This adds a Mesh To Volume Node T86838 based on the existing modifier. The mesh to volume conversion is implemented in the geometry module, and shared between the node and the modifier. Currently the node outputs a grid with the name "density". This may change in the future depending on the decisions made in T91668. The original patch was by Kris (@Metricity), further implementation by Geramy Loveless (@GeramyLoveless), then finished by Erik Abrahamsson (@erik85). Differential Revision: https://developer.blender.org/D10895
2022-06-29Cleanup(UV): Store nboundaries on pchart (no functional changes)Chris Blackbourn
Prep for D15263
2022-06-27Cleanup (UV): Remove unused variable do_aspectChris Blackbourn
2022-06-21Cleanup (UV): Use blenlib math utilitiesChris Blackbourn
2022-06-18Fix: curves have incorrect resolution attribute after realizing instancesJacques Lucke
If the resolution attribute existed on some curves, but not on others, it was initialized to zero by default. However, zero is not a valid resolution.
2022-06-17Curves: refactor Add brushJacques Lucke
This splits out the code that samples points on a surface and the code that initializes new curves. This code will be reused by D15134. Differential Revision: https://developer.blender.org/D15216
2022-06-16Cleanup: quiet compiler warningsCampbell Barton
2022-06-16Fix T98239: During UV Unwrap, create unique indices for each pinned UVChris Blackbourn
Originally reported in T75007. Differential Revision: https://developer.blender.org/D15199
2022-06-08Curves: Port set type node to new data-blockHans Goudey
This commit ports the "Set Spline Type" node to the new curves type. Performance should be improved in similar ways to the other refactors from the conversion task (T95443). Converting to and from Catmull Rom curves is now supported. There are a few cases where a lot of work can be skipped: when the number of points doesn't change, and when the types already match the goal type. The refactor has a few other explicit goals as well: - Don't count on initialization of attribute arrays when they are first allocated. - Avoid copying the entire data-block when possible. - Make decisions about which attributes to copy when changing curves more obvious. - Use higher-level methods to copy data between curve points. - Optimize for the common cases of single types and full selections. - Process selected curves of the same types in the same loop. The Bezier to NURBS conversion is written by Piotr Makal (@pmakal). Differential Revision: https://developer.blender.org/D14769
2022-06-05Curves: use uv coordinates to attach curves to meshJacques Lucke
This implements the new way to attach curves to a mesh surface using a uv map (based on the recent discussion in T95776). The curves data block now not only stores a reference to the surface object but also a name of a uv map on that object. Having a uv map is optional for most operations, but it will be required later for animation (when the curves are supposed to be deformed based on deformation of the surface). The "Empty Hair" operator in the Add menu sets the uv map name automatically if possible. It's possible to start working without a uv map and to attach the curves to a uv map later on. It's also possible to reattach the curves to a new uv map using the "Curves > Snap to Nearest Surface" operator in curves sculpt mode. Note, the implementation to do the reverse lookup from uv to a position on the surface is trivial and inefficient now. A more efficient data structure will be implemented separately soon. Differential Revision: https://developer.blender.org/D15125
2022-06-02Cleanup: replace ParamBool and PBool with bool for GEO_uv APIChris Blackbourn
Also improve const correctness and type correctness. Reviewed By: brecht Ref D15075
2022-06-02Cleanup: remove unused area smoothing logic for UV unwrapChris Blackbourn
This used to run when holding Shift while unwrapping until 2006 when it was removed [0]. [0]: e66b5e5cd5758f1259ec5a22d47f58ec3e9e3536 Reviewed By: brecht Ref D15075
2022-06-01Cleanup: use 'e' prefix for enum typesCampbell Barton
- CustomDataType -> eCustomDataType - CustomDataMask -> eCustomDataMask - AttributeDomain -> eAttrDomain - NamedAttributeUsage -> eNamedAttrUsage
2022-05-26Cleanup: `struct PHandle` merged with alias `typedef void ParamHandle`Chris Blackbourn
Reviewed By: brecht Ref D15021
2022-05-19Fix assertion raised in Merge By DistanceGermano Cavalcante
Harmless assertion in `r_weld_mesh->wpoly_new[r_weld_mesh->wpoly_new_len++]` that checks the size even though it has enough space.
2022-05-19Cleanup: rename 'WeldPoly' member 'len' to 'loop_len'Germano Cavalcante
This avoids confusion.
2022-05-19Fix compilation errors with 'USE_WELD_DEBUG'Germano Cavalcante