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-12Cleanup: repeated words in commentsCampbell Barton
2022-08-11Cleanup: clang-tidy uv_parametrizer.ccCampbell Barton
2022-08-11Cleanup: remove redundant MEM_SAFE_FREECampbell Barton
MEM_SAFE_FREE isn't necessary when the memory is known to be allocated and clearing the value afterwards isn't necessary.
2022-08-11Cleanup: reduce asan lint and clang-tidy warnings on uv_parametrizerChris Blackbourn
2022-08-10Cleanup: fix attr_nonnull error found by asanChris Blackbourn
2022-08-07Cleanup: make formatChris Blackbourn
2022-08-06Cleanup: Move uv_parametrizer.c to C++Chris Blackbourn
Differential Review: https://developer.blender.org/D15618
2022-08-04Cleanup: simplify uv parametrizer in preparation for C++Chris Blackbourn
No functional changes. Add casts required by C++. Simplify types.
2022-08-03Cleanup: Use generic utility to retrieve attributes to transferHans Goudey
2022-08-03Attribute Math: Improve performance of mixer in some casesIliay Katueshenock
The `DefaultMixer` for mixing generic data types has some issues: 1. The full buffer is always zeroed, even if only some is used. 2. Finalizing also works on all values, even if only some are used. 3. "mixing" doesn't allow setting the first value, requiring that everything is cleared beforehand. This commit adds the following functionality: 1. Constructor with the specified `IndexMask` for preliminary zeroing. 2. `set` method to overwrite the value. 3. `finalize` with the specified mask to process a subset of values. This is useful in situations where you want to use the DefaultMixer without having to overwrite all the values many times. A performance improvement was observed for NURBS curve evaluation and attribute interpolation from the point to curve domain of about 15% and 35% respectively (100,000 curves). Differential Revision: https://developer.blender.org/D15434
2022-08-02Cleanup: simplify uv parametrizer in preparation for C++Chris Blackbourn
No functional changes. Add casts required by C++. Simplify destructors. Simplify types.
2022-08-01Cleanup: simplify uv parametrizer in preparation for C++Chris Blackbourn
Replace `PChart` allocation with simpler calloc/free
2022-07-31Cleanup: simplify uv parametrizer in preparation for C++Chris Blackbourn
Replaces PCHART_HAS_PINS with `bool has_pins`.
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