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-07-05Geometry Nodes: Use same shape as mesh line in curve line nodeHans Goudey
The line starts at the origin and ends at (0,0,1m), just like the mesh node.
2021-07-05Geometry Nodes: Curve Primitive LineJohnny Matthews
This node creates a poly spline line in one of 2 modes: - Line between two points - Start Point, Direction, and Length Both modes create splines with only start and endpoints. A resample node can be used afterward to increase the point count. Differential Revision: https://developer.blender.org/D11769
2021-07-05Cleanup: Clang tidy, unused includeHans Goudey
Also a stupidly-included change I made when committing the patch.
2021-07-05Geometry Nodes: Add explicit Float to Int conversion nodeNikhil Shringarpurey
This patch adds a very simple node that explicitly converts a float to an int. While this may seem redundant, it would offer 2 benefits to the current requirement to use implicit float conversions: 1. It makes the node tree's intent more clear and self-documenting (especially if changes in the future require integer inputs). 2. It eliminates undefined behavior in current/future nodes from float inputs by guaranteeing that the input is an integer. The node offers a variety of rounding techniques to make it more flexible. Differential Revision: https://developer.blender.org/D11700
2021-07-05Cleanup: spelling, punctuationCampbell Barton
2021-07-05Geometry Nodes: new Viewer nodeJacques Lucke
This adds a viewer node similar to the one in the compositor. The icon in the headers of nodes is removed because it served the same purpose and is not necessary anymore. Node outputs can be connected to the active viewer using ctrl+shift+LMB, just like in the compositor. Right now this collides with the shortcut used in the node wrangler addon, which will be changed separately. As of now, the viewed geometry is only visible in the spreadsheet. Viewport visualization will be added separately. There are a couple of benefits of using a viewer node compared to the old approach with the icon in the node header: * Better support for nodes that have more than one geometry output. * It's more consistent with the compositor. * If attributes become decoupled from geometry in the future, the viewer can have a separate input for the attribute to visualize. * The viewer node could potentially have visualization settings. * Allows to keep "visualization points" around by having multiple viewer nodes. * Less visual clutter in node headers. Differential Revision: https://developer.blender.org/D11470
2021-07-05Cleanup: spelling in commentsCampbell Barton
2021-07-03Cleanup: consistent use of tags: NOTE/TODO/FIXME/XXXCampbell Barton
Also use doxy style function reference `#` prefix chars when referencing identifiers.
2021-07-03Cleanup: Use simpler method to retrieve attribute domainHans Goudey
2021-07-02Geometry Nodes: Add mesh input warning to curve to mesh nodeHans Goudey
A point of confusion about this node is that it doesn't work on the output of the mesh circle primitive node. This patch adds a warning to help with that. This avoids adding a warning when the geometry set input has no mesh. Differential Revision: https://developer.blender.org/D11771
2021-07-02Cleanup: Use const mesh to ensure BVH and triangulation cacheHans Goudey
As noted in a comment now, these functions only update a cache, so they don't change the logical state of the mesh, which is "it will have the data when necessary." Using a const argument will help const correctness when accessing an object's evaluated mesh.
2021-07-01Cleanup: spellingCampbell Barton
2021-07-01Geometry Nodes: Curve Primitive CircleJohnny Matthews
This node has two modes: the first mode computes a circle from three locations and a resolution. The second takes radius and resolution. The first mode also outputs the center of the computed circle as a vector. Differential Revision: https://developer.blender.org/D11650
2021-06-30Geometry Nodes: Curve Primitive Bezier SegmentJohnny Matthews
Creates a Curve with 1 Bezier Spline from four positions (start, start handle, end handle, end) and a resolution. The handles are aligned and mirrored automatically. An "Offset" mode is also included to allow specifying the handles relative to the control points. The default settings recreate the existing default Bezier Curve in the 3D viewport add menu. Differential Revision: https://developer.blender.org/D11648
2021-06-30Geometry Nodes: Curve Primitive Quadratic Bezier SegmentJohnny Matthews
This patch is for a node that creates a poly spline from a 3 point quadratic Bezier. Resolution is also specified. Curve primitives design task: T89220 Differential Revision: https://developer.blender.org/D11649
2021-06-30Geometry Nodes: Curve Primitive SpiralJohnny Matthews
This node creates a curve spline and gives control for the number of rotations, the number of points per rotation, start and end radius, height, and direction. The "Reverse" input produces a visual change, it doesn't just change the order of the control points. Differential Revision: https://developer.blender.org/D11609
2021-06-30Geometry Nodes: Curve Primitive SpiralJohnny Matthews
This patch adds a Curve Primitives menu in Geometry nodes with an initial entry of a star primitive. The node is a basic star pattern node that outputs a poly spline. Options control the inner and outer radius, the number of points, and the twist of the valleys. Differential Revision: https://developer.blender.org/D11653
2021-06-28Functions: improve CPPTypeJacques Lucke
* Reduce code duplication. * Give methods more standardized names (e.g. `move_to_initialized` -> `move_assign`). * Support wrapping arbitrary C++ types, even those that e.g. are not copyable.
2021-06-28Cleanup: repeated terms in code comments & error messagesCampbell Barton
2021-06-26Cleanup: full sentences in comments, improve comment formattingCampbell Barton
2021-06-24Fix T89390: crash when join geometry node has only muted inputsJacques Lucke
2021-06-24Cleanup: comment blocks, trailing space in commentsCampbell Barton
2021-06-22Fix T89327: Cube and ico sphere nodes do not create UVsHans Goudey
It turns out you have to add the UV custom data layer manually before calling the BMesh primitive operators, even if you pass `calc_uvs=true`.
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-22Geometry Nodes: Use multithreading for the curve to mesh nodeHans Goudey
This commit optimizes the node for the case where it works on many splines by allowing it to generate mesh data from their combinations in parallel. By itself, this made the node around twice as fast in my test file with a result of 20 million vertices, around 600ms instead of 1.2s before. That isn't actually a very good result; it reveals another bottleneck, a single threaded loop over all face corners in the mesh normal calculation code. As a simple change that might improve performance in some situations, this commit moves normal calculation out of this node, so at least the work isn't wasted if the mesh is changed later on in the node tree anyway.
2021-06-21Fix T89329: icosphere subdivisions can be set to 0Daniel Salazar
Differential Revision: https://developer.blender.org/D11658
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-21Geometry Nodes: Multithread curve resample nodeHans Goudey
Optimize the node for the case of many splines. In a test file with 14000 splines, the node is 3x faster (72ms to 24ms) on an 8 core CPU.
2021-06-18Cleanup: clang-tidyCampbell Barton
2021-06-17Raycast geometry node.Lukas Tönne
The //Raycast// node intersects rays from one geometry onto another. It computes hit points on the target mesh and returns normals, distances and any surface attribute specified by the user. A ray starts on each point of the input //Geometry//. Rays continue in the //Ray Direction// until they either hit the //Target Geometry// or reach the //Ray Length// limit. If the target is hit, the value of the //Is Hit// attribute in the output mesh will be true. //Hit Position//, //Hit Normal//, //Hit Distance// and //Hit Index// are the properties of the target mesh at the intersection point. In addition, a //Target Attribute// can be specified that is interpolated at the hit point and the result stored in //Hit Attribute//. Docs: D11620 Reviewed By: HooglyBoogly Differential Revision: https://developer.blender.org/D11619
2021-06-17Geometry Nodes: Add Curve Subdivision NodeHans Goudey
This node creates splines with more control points in between the existing control points. The point is to give the splines more definition for further tweaking like randomization with white noise, instead of deforming a resampled poly spline with a noise texture. For poly splines and NURBS, the node simply interpolates new values between the existing control points. However, for Bezier splines, the result follows the existing evaluated shape of the curve, changing the handle positions and handle types to make that possible. The number of "cuts" can be controlled by an integer input, or an attribute can be used. Both spline and point domain attributes are supported, so the number of cuts can vary using the value from the point at the start of each segment. Dynamic curve attributes are interpolated to the result with linear interpolation. Differential Revision: https://developer.blender.org/D11421
2021-06-17Cleanup: split BKE_mesh_copy_settings into two functionsCampbell Barton
- BKE_mesh_copy_parameters_for_eval to be used for evaluated meshes only as it doesn't handle ID user-counts. - BKE_mesh_copy_parameters is a general function for copying parameters between meshes.
2021-06-16BLI: add threading namespaceJacques Lucke
This namespace groups threading related functions/classes. This avoids adding more threading related stuff to the blender namespace. Also it makes naming a bit easier, e.g. the c++ version of BLI_task_isolate could become blender::threading::isolate_task or something similar. Differential Revision: https://developer.blender.org/D11624
2021-06-16Geometry Nodes: Separate Components NodeJohnny Matthews
Implementation of T86970. This node takes a geometry input with multiple components and outputs them by component type. Meshes, Curves, and Point Clouds support combining multiple input instances, while volumes will only output the first volume component input until suitable instance realization for multiple volumes is finished. When direct geometry instancing is implemented it will be possible to avoid realizing instances in this node. Differential Revision: https://developer.blender.org/D11577
2021-06-16Geometry Nodes: Allow int attribute input fields with single valueHans Goudey
Just like the way we often have a choice between an attribute input and a single float, this adds the ability to choose between attribute and integer input sockets, useful for D11421.
2021-06-14Geometry Nodes: Join dynamic curve attributes in the join geometry nodeHans Goudey
This commit lets the join geometry node transfer dynamic attributes to the result, the same way that point cloud and mesh attributes are joined. The implementation is different though, because of an optimization implemented for curves to avoid copying splines. The result attribute is added with the highest priority domain (points over splines), and the highest complexity data type. If one curve had the attribute on the spline domain but not others, the point domain values will be used. Generally this is a bit lower level than I would have liked this code to be, but should be efficient, and it's really not too complicated. Differential Revision: https://developer.blender.org/D11491
2021-06-14Geometry Nodes: Parallelize curve reverse nodeHans Goudey
Each spline can be handled separately here. This gives approximately a 2x speedup on my 8 core processor on an input of 80000 2 point splines.
2021-06-14Cleanup: Refactor join geometry node attribute gatheringHans Goudey
Instead of building a set and then determining the final domain and type for every attribute separately in the loop, construct a map with the necessary data in the first place. This is simpler and should be slightly more efficient. Split from D11491
2021-06-14Geometry Nodes: Curve Reverse NodeJohnny Matthews
This is an implementation of T88722. It accepts a curve object and for each spline, reverses the order of the points and all attributes. This is more of a foundational node to support other nodes in the future (like curve deform) Selection takes spline domain attributes to determine which splines are selected. If no selection is present all splines are reversed. Differential Revision: https://developer.blender.org/D11538
2021-06-14Geometry Nodes: Curve to Points Node for Evaluated DataHans Goudey
This node implements the second option of T87429, creating points along the input splines with the necessary evaluated information for instancing: `tangent`, `normal`, and `rotation` attributes. All generic curve point and spline attributes are copied to the result points as well. The "Count" and "Length" methods are just like the current options in the resample node, but the output is points instead of a curve. The "Evaluated" method uses the points you see on the curve directly, and therefore should be the fastest. The rotation data is retrieved from a transform matrix built with the same method that the curve to mesh node uses. The radius attribute is divided by 10 so the points don't look absurdly huge in the viewport. In the future that could be an option. For the implementation, one thing that could use an improvement is the amount of temporary allocations while resampling to evaluated points before the final points. I expect that reusing a buffer for each thread would give a nice improvement. Differential Revision: https://developer.blender.org/D11539
2021-06-11Nodes: cache socket identifier to index mappingJacques Lucke
While this preprocessing does take some time upfront, it avoids longer lookup later on, especially as nodes get more sockets. It's probably possible to make this more efficient in some cases but this is good enough for now.
2021-06-11Nodes: add utilities to check if there are undefined nodes/socketsJacques Lucke
2021-06-11Nodes: move mix rgb node to C++Charlie Jolly
Prepare node for conversion to Geometry Nodes. There should be no functional changes. Reviewed By: HooglyBoogly Differential Revision: https://developer.blender.org/D11506
2021-06-10Geometry Nodes: Add Texture and Material options to switch nodeEitan
These new socket types can be supported in the switch node along with the others. Differential Revision: https://developer.blender.org/D11560
2021-06-10Add unit for time stored in secondsSergey Sharybin
Allows to define properties which will have proper units displayed in the interface. The internal storage is expected to be seconds (which matches how other times are stored in Blender). Is not immediately used in Blender, but is required for the upcoming feature in Cycles X (D11526) The naming does not sound very exciting, but can't think of anything better either. For test it probably easiest to define FloatProperty with subdtype of TIME_ABSOLUTE. Differential Revision: https://developer.blender.org/D11532
2021-06-10Fix: Point translate and point scale don't execute on curve dataHans Goudey
2021-06-09Geometry Nodes: Copy spline attributes in the curve resample nodeHans Goudey
Previously only point domain attributes were copied to the result curve.
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-09Geometry Nodes: Add Convex Hull NodeHenrik Dick
This commit adds a node to output the convex hull of any input geometry as a mesh, which is an enclosing geometry around a set of points. All geometry types are supported, besides volumes. The code supports operating on instances to avoid copying all input geometry before the operation. The implementation uses the same backend as the operation in edit mode, but uses Mesh directly instead of BMesh. Attribute transfer is not supported currently, but would be a point of improvement for the future if it can work in a predictable way on different geometry input types. Differential Revision: https://developer.blender.org/D10925