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-12-15Node Editor: Link Drag Search MenuHans Goudey
This commit adds a search menu when links are dragged above empty space. When releasing the drag, a menu displays all compatible sockets with the source link. The "main" sockets (usually the first) are weighted above other sockets in the search, so they appear first when you type the name of the node. A few special operators for creating a reroute or a group input node are also added to the search. Translation is started after choosing a node so it can be placed quickly, since users would likely adjust the position after anyway. A small "+" is displayed next to the cursor to give a hint about this. Further improvements are possible after this first iteration: - Support custom node trees. - Better drawing of items in the search menu. - Potential tweaks to filtering of items, depending on user feedback. Thanks to Juanfran Matheu for developing an initial patch. Differential Revision: https://developer.blender.org/D8286
2021-12-07Cleanup: Add macro and functions for node storageHans Goudey
The `node_storage` functions to retrieve const and mutable structs from a node are generated by a short macro that can be placed at the top of each relevant file. I use this in D8286 to make code snippets in the socket declarations much shorter, but I thought it would be good to use it consistently everywhere else too. The functions are also useful to avoid copy and paste errors, like the one corrected in the cylinder node in this commit. Differential Revision: https://developer.blender.org/D13491
2021-11-25Merge branch 'blender-v3.0-release'Jacques Lucke
2021-11-25Fix T93362: crash when capturing attribute after fillet curve nodeJacques Lucke
The issue was that the attribute propagation in the Fillet Curve node seems pretty broken. I couldn't really make sense of the old code. It changed the size of the point attribute domains on splines to 1 for some reason which led to a crash in the next node. Differential Revision: https://developer.blender.org/D13362
2021-11-23Cleanup: Simplify geometry node function namesHans Goudey
With this commit, we no longer use the prefixes for every node type function like `geo_node_translate_instances_`. They just added more places to change when adding a new node, for no real benefit. Differential Revision: https://developer.blender.org/D13337
2021-11-23Geometry Nodes: add namespace for every fileJacques Lucke
This puts all static functions in geometry node files into a new namespace. This allows using unity build which can improve compile times significantly (P2578). * The name space name is derived from the file name. That makes it possible to write some tooling that checks the names later on. The file name extension (`cc`) is added to the namespace name as well. This also possibly simplifies tooling but also makes it more obvious that this namespace is specific to a file. * In the register function of every node, I added a namespace alias `namespace file_ns = blender::nodes::node_geo_*_cc;`. This avoids some duplication of the file name and may also simplify tooling, because this line is easy to detect. The name `file_ns` stands for "file namespace" and also indicates that this namespace corresponds to the current file. In the beginning I used `node_ns` but `file_ns` is more generic which may make it more suitable when we want to use unity builds outside of the nodes modules in the future. * Some node files contain code that is actually shared between different nodes. For now I left that code in the `blender::nodes` namespace and moved it to the top of the file (couldn't move it to the bottom in all cases, so I just moved it to the top everywhere). As a separate cleanup step, this shared code should actually be moved to a separate file. Differential Revision: https://developer.blender.org/D13330
2021-11-17Cleanup: change node socket availability in a single placeJacques Lucke
This cleans up part of the code that still set the flag manually. Also, this change helps with D13246 because it makes it easier to tag the node tree as changed when the availability of a socket changed.
2021-11-16Geometry Nodes: refactor virtual array systemJacques Lucke
Goals of this refactor: * Simplify creating virtual arrays. * Simplify passing virtual arrays around. * Simplify converting between typed and generic virtual arrays. * Reduce memory allocations. As a quick reminder, a virtual arrays is a data structure that behaves like an array (i.e. it can be accessed using an index). However, it may not actually be stored as array internally. The two most important implementations of virtual arrays are those that correspond to an actual plain array and those that have the same value for every index. However, many more implementations exist for various reasons (interfacing with legacy attributes, unified iterator over all points in multiple splines, ...). With this refactor the core types (`VArray`, `GVArray`, `VMutableArray` and `GVMutableArray`) can be used like "normal values". They typically live on the stack. Before, they were usually inside a `std::unique_ptr`. This makes passing them around much easier. Creation of new virtual arrays is also much simpler now due to some constructors. Memory allocations are reduced by making use of small object optimization inside the core types. Previously, `VArray` was a class with virtual methods that had to be overridden to change the behavior of a the virtual array. Now,`VArray` has a fixed size and has no virtual methods. Instead it contains a `VArrayImpl` that is similar to the old `VArray`. `VArrayImpl` should rarely ever be used directly, unless a new virtual array implementation is added. To support the small object optimization for many `VArrayImpl` classes, a new `blender::Any` type is added. It is similar to `std::any` with two additional features. It has an adjustable inline buffer size and alignment. The inline buffer size of `std::any` can't be relied on and is usually too small for our use case here. Furthermore, `blender::Any` can store additional user-defined type information without increasing the stack size. Differential Revision: https://developer.blender.org/D12986
2021-10-29Nodes: Add translation markers to new socket names and descriptionsHans Goudey
As part of the refactor to the node declaration builders, we had hoped to add a regular expression specifically for these socket names, but recent discussions have revealed that using the translation marker macros is the preferred solution. If the names and descriptions were exposed to RNA, these would not be necessary. However, that may be quite complicated, since sockets are all instances of the same RNA types. Differential Revision: https://developer.blender.org/D13033
2021-10-26Geometry Nodes: geometry component type warning systemJacques Lucke
Previously, every node had to create warnings for unsupported input geometry manually. Now this is automated. Nodes just have to specify the geometry types they support in the node declaration. Differential Revision: https://developer.blender.org/D12899
2021-10-14Geometry Nodes: Rename Nodes ID Names + Menu OrgJohnny Matthews
Re-alphabetize the main add menu. Rename Node ID Names: FloatCompare => CompareFloats AttributeCapture => CaptureAttribute Boolean => MeshBoolean CurveFill => FillCurve CurveFillet => FilletCurve CurveReverse => ReverseCurve CurveSample => SampleCurve CurveResmaple => ResampleCurve CurveSubdivide => SubdivideCurve CurveTrim => TrimCurve MaterialReplace => ReplaceMaterial MeshSubdivide => SubdivideMesh EdgeSplit => SplitEdges Differential Revision: https://developer.blender.org/D12865
2021-10-11Geometry Nodes: Rename 12 Nodes to be "Verb First"Johnny Matthews
Attribute Capture => Capture Attribute Curve Fill => Fill Curve Curve Fillet => Fillet Curve Curve Reverse => Reverse Curve Curve Sample => Sample Curve Curve Subdivide => Subdivide Curve Curve Trim => Trim Curve Material Assign => Assign Material Material Replace => Replace Material Mesh Subdivide => Subdivide Mesh Float Compare => Compare Float Boolean => Mesh Boolean Differential Revision: https://developer.blender.org/D12798 Task: https://developer.blender.org/T91682
2021-10-07Fix: Missing field markers for curve fillet node inputsHans Goudey
2021-09-28Geometry Nodes: Run nodes once on unique instance dataHans Goudey
As described in T91672, often it can be much more efficient to run each node only on the unique geometry of the instances, rather than realizing all instances and potentially processing redundant data. Sometimes the performance difference can be completely smooth vs. completely unusable. Geometry nodes used to hide that choice from users by always realizing instances, but recently we have decided to expose it. So this commit makes nodes run once per unique reference in the entire tree of nested instances in their input geometries, continuing the work started in rB0559971ab377 and rBf94164d89629f0d2. For the old behavior, a realize instances node can be added before the nodes, which is done in the versioning code. Differential Revision: https://developer.blender.org/D12656
2021-09-22Geometry Nodes: Curve Fillet Nodedilithjay
This node can be used to fillet splines at control points to create a circular arc. The implementation roughly follows T89227's design. The node works in two main modes: Bezier and Poly * Bezier: Creates a circular arc at vertices by changing handle lengths (applicable only for Bezier splines). * Poly: Creates a circular arc by creating vertices (as many as defined by the Count fields input) along the arc (applicable for all spline types). In both modes, the radius of the created arc is defined by the Radius fields input. The Limit Radius attribute can be enabled to prevent overlapping when the defined radius exceeds the maximum possible radius for a given point. Reviewed By: Hans Goudey Differential Revision: https://developer.blender.org/D12115