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-09Geometry Nodes: fields and anonymous attributesJacques Lucke
This implements the initial core framework for fields and anonymous attributes (also see T91274). The new functionality is hidden behind the "Geometry Nodes Fields" feature flag. When enabled in the user preferences, the following new nodes become available: `Position`, `Index`, `Normal`, `Set Position` and `Attribute Capture`. Socket inspection has not been updated to work with fields yet. Besides these changes at the user level, this patch contains the ground work for: * building and evaluating fields at run-time (`FN_fields.hh`) and * creating and accessing anonymous attributes on geometry (`BKE_anonymous_attribute.h`). For evaluating fields we use a new so called multi-function procedure (`FN_multi_function_procedure.hh`). It allows composing multi-functions in arbitrary ways and supports efficient evaluation as is required by fields. See `FN_multi_function_procedure.hh` for more details on how this evaluation mechanism can be used. A new `AttributeIDRef` has been added which allows handling named and anonymous attributes in the same way in many places. Hans and I worked on this patch together. Differential Revision: https://developer.blender.org/D12414
2021-09-05Compositor: New Posterize NodeAaron Carlisle
The posterize node limits the number of colors per channel. This is useful to generate masks or to generate stylized images Both the tiled and full-frame implementation are included in this patch {F10314012} Reviewed By: manzanilla, jbakker Differential Revision: https://developer.blender.org/D12304
2021-08-30Nodes: add more flexible method to declare sockets of a nodeJacques Lucke
Previously, built-in nodes had to implement "socket templates" (`bNodeSocketTemplate`) to tell Blender which sockets they have. It was nice that this was declarative, but this approach was way too rigid and was cumbersome to use in many cases. This commit starts to move us away from this rigid structure by letting nodes implement a function that declares the sockets the node has. Right now this is used as a direct replacement of the "socket template" approach to keep the refactor smaller. It's just a bit easier to read and write. In the future we want to support more complex features like dynamic numbers of sockets and type inferencing. Those features will be easier to build on this new approach. This new approach can live side by side with `bNodeSocketTemplate` for a while. That makes it easier to update nodes one by one. Note: In `bNodeSocketTemplate` socket identifiers were made unique automatically. In this new approach, one has to specify unique identifiers manually (unless the name is unique already). Differential Revision: https://developer.blender.org/D12335
2021-08-30Geometry Nodes: Curve Fill NodeErik Abrahamsson
This node takes a curve geometry input and creates a filled mesh at Z=0 using a constrained Delaunay triangulation algorithm. Because of the choice of algorithm, the results should be higher quality than the filling for 2D curve objects. This commit adds an initial fairly simple version of the node, but more features may be added in the future, like transferring attributes when necessary, or an index attribute input to break up the calculations into smaller chunks to improve performance. Differential Revision: https://developer.blender.org/D11846
2021-08-20Functions: remove multi-function networkJacques Lucke
The multi-function network system was able to compose multiple multi-functions into a new one and to evaluate that efficiently. This functionality was heavily used by the particle nodes prototype a year ago. However, since then we only used multi-functions without the need to compose them in geometry nodes. The upcoming "fields" in geometry nodes will need a way to compose multi-functions again. Unfortunately, the code removed in this commit was not ideal for this different kind of function composition. I've been working on an alternative that will be added separately when it becomes needed. I've had to update all the function nodes, because their interface depended on the multi-function network data structure a bit. The actual multi-function implementations are still the same though.
2021-08-06Geometry Nodes: Select by Handle Type NodeHans Goudey
Just like the "Select by Material" node, this node outputs a boolean attribute for control points that have a matching handle type. By default left and right handles are considered, but it's possible to only check one side with the toggle in the node. Differential Revision: https://developer.blender.org/D12135
2021-08-04Geometry Nodes: Curve Set Spline TypeJohnny Matthews
This node sets the selected (or all) splines in curve to a chosen target spline type. Poly, Bezier, and NURB splines can be converted to any of the other types. This is meant to be a building block node, useful in many procedural situations. In the future the node could be optimized with multi-threading, or by avoiding copying in many cases, either by retrieving the curve for write access or by passing the raw vectors to the new splines where possible. With edits from Hans Goudey (@HooglyBoogly) Differential Revision: https://developer.blender.org/D12013
2021-07-22Geometry Nodes: Set Bezier Handle Type NodeJohnny Matthews
This node takes a curve and a point selection and allows you to set the specified (or all) points left/right or both handles to a given type. Differential Revision: https://developer.blender.org/D11992
2021-07-18Geometry Nodes: Curve Trim NodeAngus Stanton
This node implements shortening each spline in the curve based on either a length from the start of each spline, or a factor of the total length of each spline, similar to the "Start & End Mapping" panel of curve properties. For Bezier curves, the first and last control points are adjusted to maintain the shape of the curve, but NURB splines are currently implicitly converted to poly splines. The node is implemented to avoid copying where possible, so it outputs a changed version of the input curve rather than a new one. Differential Revision: https://developer.blender.org/D11901
2021-07-12Geometry Nodes: Curve Primitive QuadrilateralJohnny Matthews
This commit adds a curve primitive node for creating squares, rectangles, trapezoids, kites, and parallelograms. It also includes a mode where the four points are just vector inputs. Differential Revision: https://developer.blender.org/D11665
2021-07-07MSVC: Fix build issue with TBBRay Molenkamp
TBB includes in windows.h which will by default define min/max macro's by default, which collide with stl's min/mac functions. this change instructs windows.h not to add the offending macros
2021-07-07Geometry Nodes: refactor logging during geometry nodes evaluationJacques Lucke
Many ui features for geometry nodes need access to information generated during evaluation: * Node warnings. * Attribute search. * Viewer node. * Socket inspection (not in master yet). The way we logged the required information before had some disadvantages: * Viewer node used a completely separate system from node warnings and attribute search. * Most of the context of logged information is lost when e.g. the same node group is used multiple times. * A global lock was needed every time something is logged. This new implementation solves these problems: * All four mentioned ui features use the same underlying logging system. * All context information for logged values is kept intact. * Every thread has its own local logger. The logged informatiton is combined in the end. Differential Revision: https://developer.blender.org/D11785
2021-07-07Cleanup: Sort nodes alphabeticallyHans Goudey
2021-07-07Geometry Nodes: Rename nodes for clarity between mesh and curveHans Goudey
Rename the mesh circle to "Mesh Circle", mesh line to "Mesh Line", and mesh subdivide to "Mesh Subdivide". Previously they looked exactly the same in the search menu, and the nodes themselves had the same label. This is a "deep" rename that also renames internal defines and function names to match the UI.
2021-07-07Geometry Nodes: Curve Endpoints NodeAngus Stanton
This node is quite similar to the curve to points node, but creates points for only the start and end of each spline. This is a separate node because the sampling from the curve to points node don't apply, and just for ease of use. All attributes from the curves are copied, including the data for instancing: tangents, normals, and the derived rotations. One simple use case is to make round caps on curves by instancinghalves of a sphere on each end of the splines. Differential Revision: https://developer.blender.org/D11719
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-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-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-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-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-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-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: 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-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
2021-06-08Geometry Nodes: new Select by Material nodeJacques Lucke
This node creates a boolean face attribute that is "true" for every face that has the given material. Differential Revision: https://developer.blender.org/D11324
2021-06-04Geometry Nodes: Curve Length NodeJohnny Matthews
This commit adds a node that outputs the total length of all evalauted curve splines in a geometry set as a float value. Differential Revision: https://developer.blender.org/D11459
2021-06-02Geometry Nodes: Add Delete Geometry NodeWannes Malfait
This node is similar to the mask modifier, but it deletes the elements of the geometry corresponding to the selection, which is retrieved as a boolean attribute. The node currently supports both mesh and point cloud data. For meshes, which elements are deleted depends on the domain of the input selection attribute, just like how behavior depends on the selection mode in mesh edit mode. In the future this node will support curve data, and ideally volume data in some way. Differential Revision: https://developer.blender.org/D10748
2021-05-28Geometry Nodes: Add Mesh to Curve NodeHans Goudey
This node creates poly curve splines from mesh edges. A selection attribute input allows only using some of the edges from the mesh. The node builds cyclic splines from branchless groups of edges where possible, but when there is a three-way intersection, the spline stops. The node also transfers all attributes from the mesh to the resulting control points. In the future we could add a way to limit that to a subset of the attributes to improve performance. The algorithm is from Animation Nodes, written by @OmarSquircleArt. I added the ability to use a selection, attribute transferring, and used different variable names, etc, but other than that the algorithm is the same. Differential Revision: https://developer.blender.org/D11265
2021-05-24Nodes: move shader curves node to C++Charlie Jolly
Prepare node for conversion to Geometry Nodes. There should be no functional changes. Reviewed By: JacquesLucke, LazyDodo Differential Revision: https://developer.blender.org/D11226
2021-05-21Geometry Nodes: new Material Replace nodeJacques Lucke
This node can change all faces that use a specific material to use a different material. Using this node is significantly more efficient than creating a selection from all faces with a specific material index and then using the Material Assign node. Ref T88055. Differential Revision: https://developer.blender.org/D11325
2021-05-20Geometry Nodes: new Material input nodeJacques Lucke
This node is similar to the Value and Vector node. It just provides a way to use the same material in multiple nodes without exposing it outside of a node group. Differential Revision: https://developer.blender.org/D11305
2021-05-20Geometry Nodes: new Material Assign nodeJacques Lucke
This adds a new Material Assign node. It can be used to change the material used by an existing mesh or to assign a material to a mesh that has been generated from scratch. Differential Revision: https://developer.blender.org/D11155
2021-05-11Geometry Nodes: Add Attribute Vector Rotate nodeCharlie Jolly
Port vector rotate node to geo attributes. Request by @simonthommes Reviewed By: simonthommes, HooglyBoogly
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-07Geometry Nodes: Add Attribute Curve Map NodeCharlie Jolly
This node has the same functionality as the color and vector curve mapping nodes in the shader editor. Here is works on every value for the selected attribute, and it can also output a float value. Other than that, the implementation is quite straightforward-- almost completely boilerplate code. Differential Revision: https://developer.blender.org/D10921
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
2021-04-27Geometry Nodes: initial Attribute Transfer nodeJacques Lucke
This is a first version of an Attribute Transfer node. It only supports two modes for mapping attributes from one geometry to another for now. More options are planned for the future. Ref T87421. Differential Revision: https://developer.blender.org/D11037
2021-04-19Geometry Nodes: new Switch nodeEitan
This is a first iteration of a switch node. It can only switch between two inputs values based on a boolean. A more sophisticated switch node that has an integer selector will probably come later. Currently, the geometry nodes evaluator does not support lazy evaluation of individual inputs. Therefore, all inputs will be computed currently. An improvement to the evaluator will be worked on separately. Ref: T85374 Differential Revision: https://developer.blender.org/D10460
2021-04-15Cleanup: move type conversions to separate fileJacques Lucke
2021-04-13Fix compile error: Missing include pathsFalk David
rB8d9fd0427dd6 added the `WITH_GMP` definition but did not append the include paths.
2021-04-13Cleanup: Nodes: Use consistent errors for nodes built without featuresHans Goudey
2021-04-07Geometry Nodes: Bounding Box NodeHans Goudey
This commit adds a simple node to output the min and max of an axis-aligned bounding box for the input geometry, as well a rectangular prism mesh created from these values for convenience. The initial use case for this node is a "bounding box boolean", where doing the boolean with just a bounding box could be signigicantly faster, for cases like cutting a hole in a wall for a window. But it's easy to imagine other cases where it could be useful. This node supports mesh and point cloud data right now, volume support will come as a separate patch. Also note that there is plenty of room to improve the performance of this node through parallelization. Differential Revision: https://developer.blender.org/D10420
2021-04-01Cleanup: move node_exec.c to c++Jacques Lucke
Doing this, because it might make it easier to replace the implementation of `bNodeInstanceHash`.
2021-03-29Compositor: Add Anti-Aliasing nodeHabib Gahbiche
This is an implementation of Enhanced Subpixel Morphological Antialiasing (SMAA) The algorithm was proposed by: Jorge Jimenez, Jose I. Echevarria, Tiago Sousa, Diego Gutierrez This node provides only SMAA 1x mode, so the operation will be done with no spatial multisampling nor temporal supersampling. See Patch for comparisons. The existing AA operation seems to be used only for binary images by some other nodes. Using SMAA for binary images needs no important parameter such as "threshold", so we perhaps can switch the operation to SMAA, though that changes existing behavior. Notes: 1. The program code assumes the screen coordinates are DirectX style that the vertical direction is upside-down, so "top" and "bottom" actually represent bottom and top, respectively. Thanks for Habib Gahbiche (zazizizou) to polish and finalize this patch. Reviewed By: jbakker Differential Revision: https://developer.blender.org/D2411