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
2021-09-21Geometry Nodes: Curve Sample NodeHans Goudey
This node allows sampling positions, tangents, and normals at any arbitrary point along a curve. The curve can include multiple splines, all are taken into account. The node does not yet support transferring generic attributes like radius, because some more general tooling will make that much more feasible and useful in different scenarios. This is a field node, so it is evaluated in the context of a data-flow node like "Set Position". One nice thing about that is it can easily be used to move an entire geometry like the follow path constraint. The point along the curve is chosen either with a factor of the total length of the curve, or a length into the curve, the same choice used in the curve trim node. Differential Revision: https://developer.blender.org/D12565
2021-09-15Splines: Add a method for reversing a SplineJohnny Matthews
This moved the spline reversing logic out of the Curve Reverse geometry node and into the spline class. This allows a spline to reverse itself with a call to `my_spline.reverse()` The base class will reverse position, radii & tilt, while specialized versions are created for Bezier and Nurbs splines to reverse the additional data that these classes encapsulate. Differential Revision: https://developer.blender.org/D12501
2021-08-02Cleanup: Make spline settings copy function publicHans Goudey
It will be useful in the spline type conversion node. Theoretically it could become protected again if that conversion moves out of a node, which might be a nice improvement after an initial version.
2021-07-23Cleanup: Add function to check a curve's spline typesHans Goudey
The need for this has come up a few times.
2021-07-23Fix: "Bake" automatically calculated handles in set handle nodeHans Goudey
Because these handles are calculated lazily, we need to make sure they are calculated before switching to a manually positioned mode. I doubt it would ever be necessary, but theoretically this could happen on a per-point level, to avoid calculating handles not in the selection.
2021-07-14Bezier Spline: Add a more generalized insertion utilityHans Goudey
This logic is from the curve sundivide node, used to add points with proper handles in between two existing points. However, the same logic is used for trimming of Bezier splines, and possibly interactive point insertion in the future, so it's helpful as a general utility. The logic is converted to depend on a bezier spline instead of being static. A temporary segment spline can be used for the latter use case.
2021-06-28Cleanup: Add function to create a CurveEval from a nurbs listHans Goudey
Sometimes the current spline list isn't part of the original curve, like when using the deformed control points, etc. This will be helpful in the curve modifier stack.
2021-06-24Cleanup: compiler warnings with clangBrecht Van Lommel
* Mark either all or no class methods with override * Don't use zero sized array since it has a different size in C and C++. Using a little more memory here is not significant. * Don't use deprecated mechanism to mark private GSet members in clang just like we don't for MSVC, it warns even for simple zero initialization.
2021-06-22Cleanup: Refactor spline copying functionsHans Goudey
Make the virtual functions protected and simpler, so that the logic is better contained in the base class's implementation. Also introduce a `copy_without_attributes` method to be used for realizing instances.
2021-06-22Cleanup: Rename variables, use shorter namesHans Goudey
`src` and `dst` are perfectly clear, and avoid repeating unecessary characters when writing the variables many times, allowing more space for everything else.
2021-06-21Cleanup: Rename spline interpolation functionsHans Goudey
The names were slightly longer than they needed to be clear, and when they are shorter they tend to fit on one line better.
2021-06-20Fix T89302: Broken normals after mesh to curve nodeHans Goudey
The normals were broken because the normal calculation mode wasn't set. This patch adds a default normal mode so all code creating a spline does not necessarily have to set it manually. In the future there should be a way to change this value in the node tree.
2021-06-16Cleanup: Expose function publicly, renameHans Goudey
There is no particular reason these two functions shouldn't be used outside of the bezier spline implementation since they don't do anything particularly controversial.
2021-06-16Splines: Add resize method to CurveEvalHans Goudey
This helps when adding splines to a new curve in parallel.
2021-06-09Splines: Add API functions for interpolating dataHans Goudey
First, expand on the interpolation to evaluated points with a templated helper function, and a function that takes a GSPan. Next, add a set of functions to `Spline` for interpolating at arbitrary intervals between the evaluated points. The code for doing that isn't that complicated anyway, but it's nice to avoid repeating, and it might make it easier to unroll the special cases for the first and last points if we require the index factors to be sorted.
2021-06-02Splines: Function to copy spline settings without dataHans Goudey
Often you need to copy a spline to do an operation, but don't want to manually copy over all of the settings. I've already forgotten to do it once anyway. These functions copy a spline's "settings" into a new spline, but not the data. I tried to avoid duplicating any copying so this is easier to extend in the future. Differential Revision: https://developer.blender.org/D11463
2021-05-27Fix build error: Make CurveEval a structHans Goudey
We need a pointer to this in DNA, which means it cannot be a class.
2021-05-27Cleanup: Use consistent variable namesHans Goudey
2021-05-19Geometry Nodes: Support for dynamic attributes on curve splinesHans Goudey
With this patch you will be able to add and remove attributes from curve data inside of geometry nodes. The following is currently implemented: * Adding attributes with any data type to splines or spline points. * Support for working with multiple splines at the same time. * Interaction with the three builtin point attributes. * Resampling attributes in the resample node. The following is not implemented in this patch: * Joining attributes when joining splines with the join geometry node. * Domain interpolation between spline and point domains. * More efficient ways to call attribute operations once per spline. Differential Revision: https://developer.blender.org/D11251
2021-05-19Cleanup: Use copy constructor for CurveEvalHans Goudey
There is no need for a special "copy" method with a copy constructor, which will be necessary to explicitly copy attributes anyway.
2021-05-16Splines: Convenience methods for point offsets of multiple splinesHans Goudey
Since spline data is stored separately for each spline, the data often needs to be flattened into a separate array. It's helpful to have the necessarily-sequential part of that split off into a separate method. I've found myself using functions like these in quite a few places.
2021-05-15Cleanup: Update / improve commentsHans Goudey
2021-05-12Cleanup: Simplify public/private specifiersHans Goudey
By rearranging a few variables we can remove redundant specifiers
2021-05-12Cleanup: Splines: Add accessors to spline vectorHans Goudey
Not allowing external direct access to the vector of splines in the curve will help for things like reallocating custom data when a spline is added or removed.
2021-05-12Geometry Nodes Curves: Expose first builtin point attributesHans Goudey
This commit exposes the first spline control point attributes. The implementation incorporates the attributes into the virtual array system, providing efficient methods to flatten the data into a contiguous array and to apply changes from a flattened array. This is only part of the eventual goal, which includes changes to run attribute nodes separately for each spline to completely avoid copying. So far `tilt` and `radius`, the two generic attributes common to all spline types, are implemented. The more complex `position` attribute is also added. It requires some special handling for Bezier splines, where the control point handles need to be moved along with the control points. To make that work I also added automatic handle recalculation to the Bezier spline. Differential Revision: https://developer.blender.org/D11187
2021-05-11Cleanup: Reorder class variable declarationsHans Goudey
The order was arbitrary, and rearranging the declarations makes the class look less messy, and makes room for future comments.
2021-05-10Fix warning on Apple Clang, missing override specifierSeverin
Was giving a warning: ``` BKE_spline.hh:293:35: warning: 'interpolate_to_evaluated_points' overrides a member function but is not marked 'override' [-Winconsistent-missing-override] ```
2021-05-07Geometry Noes: Curve Resample NodeHans Goudey
This node generates a naturally parametarized (even length edge) poly spline version of every spline in the input. There are two modes, "Count", and "Length". These are similar to the same options for the line primitive node in end points mode. I implemented this instead of a "Sample Points" node, because for this operation it's trivial to keep the result as a curve, which is nice since it increases flexibility, and because it can make instancing simpler, i.e. using the transforms of each evaluated point rather than requiring the construction of a "rotation" attribute. Differential Revision: https://developer.blender.org/D11173
2021-05-04Fix: Incorrect type used for geometry nodes poly splinesHans Goudey
2021-05-03Geometry Nodes: Initial basic curve data supportHans Goudey
This patch adds initial curve support to geometry nodes. Currently there is only one node available, the "Curve to Mesh" node, T87428. However, the aim of the changes here is larger than just supporting curve data in nodes-- it also uses the opportunity to add better spline data structures, intended to replace the existing curve evaluation code. The curve code in Blender is quite old, and it's generally regarded as some of the messiest, hardest-to-understand code as well. The classes in `BKE_spline.hh` aim to be faster, more extensible, and much more easily understandable. Further explanation can be found in comments in that file. Initial builtin spline attributes are supported-- reading and writing from the `cyclic` and `resolution` attributes works with any of the attribute nodes. Also, only Z-up normal calculation is implemented at the moment, and tilts do not apply yet. **Limitations** - For now, you must bring curves into the node tree with an "Object Info" node. Changes to the curve modifier stack will come later. - Converting to a mesh is necessary to visualize the curve data. Further progress can be tracked in: T87245 Higher level design document: https://wiki.blender.org/wiki/Modules/Physics_Nodes/Projects/EverythingNodes/CurveNodes Differential Revision: https://developer.blender.org/D11091