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-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-24Geometry Nodes: add utility to show debug messages in node editorJacques Lucke
This is only meant to be used for development purposes for now, not to show warnings to the user. Differential Revision: https://developer.blender.org/D13348
2021-11-24Geometry Nodes: decouple Delete Geometry node from Mask modifierJacques Lucke
This dependency was a bit ugly and the functions from the mask modifier did a few things that we don't need in the Delete Geometry node: * The mask modifier uses `CustomData_copy_data` which the node doesn't need. * The mask modifier checks for `-2` in some values, but this special value is not used by the node. Differential Revision: https://developer.blender.org/D13335
2021-11-24CMake: add WITH_UNITY_BUILD option to improve compile timesJacques Lucke
Unity builds are only used in the `bf_nodes_geometry` module for now. This module has been prepared to support unity builds already. Usually, there is a 2-4x speedup when building `bf_nodes_geometry` compared to without unity builds (e.g. 145s to 55s). For more information about how unity builds work and how they help with compile times, see D13341. Differential Revision: https://developer.blender.org/D13341
2021-11-23Merge branch 'blender-v3.0-release'Jacques Lucke
2021-11-23Geometry Nodes: fix attribute propagation in Delete Geometry nodeJacques Lucke
Previously, attribute propagation did not work correctly in when only deleting edges and faces (but not points). Face and face corner attributes were propagated wrongly or not at all respectively. In order to keep the patch relatively small for the release branch, it does not include some small optimizations. These can be done in 3.1: * Use a `Span<int>` instead of `IndexMask` to avoid creating an unnecessary `Vector<int64_t>`. * Only prepare index mappings when there are actually attributes to propagate. Differential Revision: https://developer.blender.org/D13338
2021-11-23Geometry Nodes: Node execution time overlayErik
Adds a new overlay called "Timings" to the Geometry Node editor. This shows the node execution time in milliseconds above the node. For group nodes and frames, the total time for all nodes inside (recursively) is shown. Group output node shows the node tree total. The code is prepared for easily adding new rows of information to the box above the node in the future. Differential Revision: https://developer.blender.org/D13256
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-23Geometry Nodes: reduce overhead when processing single valuesJacques Lucke
Currently the geometry nodes evaluator always stores a field for every type that supports it, even if it is just a single value. This results in a lot of overhead when there are many sockets that just contain a single value, which is often the case. This introduces a new `ValueOrField<T>` type that is used by the geometry nodes evaluator. Now a field will only be created when it is actually necessary. See D13307 for more details. In extrem cases this can speed up the evaluation 2-3x (those cases are probably never hit in practice though, but it's good to get rid of unnecessary overhead nevertheless). Differential Revision: https://developer.blender.org/D13307
2021-11-23Merge branch 'blender-v3.0-release'Jacques Lucke
2021-11-23Fix T93296: raycast node uses wrong domain for face corner attributesJacques Lucke
This changes what domain is used by the raycast mode. This should fix the behavior for face corner attributes (but may make it a bit slower for other attributes). I think for 3.0 this is an acceptable trade off. For 3.1 we can do what the comment suggests already. Differential Revision: https://developer.blender.org/D13333
2021-11-23Cleanup: remove unnecessary "extern"Jacques Lucke
2021-11-22Geometry Nodes: Rename legacy node filesHans Goudey
This will be useful to solve some issues with unity builds, which compiles different files together to improve build times.
2021-11-22Cleanup: use simple data member instead of callbackJacques Lucke
This really doesn't have to be a callback currently, since it is always the same `CPPType` for a socket type.
2021-11-21Fix T93256: Instances to points node broken after recent commitHans Goudey
When 97533eede444217 added the instance domain, it didn't change the domain that instance attributes are read from in this node.
2021-11-21Functions: use static names for multi-functionsJacques Lucke
Previously, the function names were stored in `std::string` and were often created dynamically (especially when the function just output a constant). This resulted in a lot of overhead. Now the function name is just a `const char *` that should be statically allocated. This is good enough for the majority of cases. If a multi-function needs a more dynamic name, it can override the `MultiFunction::debug_name` method. In my test file with >400,000 simple math nodes, the execution time improves from 3s to 1s.
2021-11-20Geometry Nodes: Instance attributes in Transfer/Capture nodesErik
Updates the Transfer Attributes and Capture Attributes nodes to support attributes from instances. Differential Revision: https://developer.blender.org/D13292
2021-11-19Fix: Use the instances domain in instance transform nodesHans Goudey
Instance attributes exist on the instance domain after rB97533eede44421, so these fields should be evaluated on that domain.
2021-11-19Geometry Nodes: Support custom instance attributesErik
Adds an attribute provider for instance attributes. A new domain `ATTR_DOMAIN_INSTANCE` is implemented. Instance attributes are not yet realized correctly. Differential Revision: D13149
2021-11-19Cleanup: fix typos in comments and docsBrecht Van Lommel
Contributed by luzpaz. Differential Revision: https://developer.blender.org/D13264
2021-11-19Merge branch 'blender-v3.0-release'Jacques Lucke
2021-11-19Fix T93054: crash when deleting a missed linked fileJacques Lucke
This is a bit similar to rBb7260ca4c9f4b7618c9c214f1270e31d6ed9886b. Sometimes a group node may not reference a node group because it was linked and can't be found.
2021-11-19Nodes: add bf_nodes_geometry libraryJacques Lucke
Separating geometry nodes into a new library will make it easier to improve compile times with features like unity builds and precompiled headers. Differential Revision: https://developer.blender.org/D13261
2021-11-17Cleanup: use same function for updating internal links for all nodesJacques Lucke
Previously, node types had a callback that creates internal links. Pretty much all nodes used the same callback though. The exceptions are the reroute node (which probably shouldn't be mutable anyway) and some input/output nodes that are not mutable. Removing the callback helps with D13246, because it makes it easier to reason about which internal links are created and when they change. In the future, the internal links should be part of the node declaration.
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-17Geometry Nodes: Small improvements to object info nodeHans Goudey
This commit contains a few mostly-related changes to this node: - Add a warning when retrieving the geometry from the modifier object. - Only create the output geometry when it is necessary. - Decompose transform matrices in a more friendly way. - Use default return callbacks like other newer nodes. Differential Revision: https://developer.blender.org/D13232
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-11-16Cleanup: Use C++ matrix identity constructorHans Goudey
2021-11-12Merge branch 'blender-v3.0-release'Johnny Matthews
2021-11-12Fix: Node Class Type for Select by Handle TypeJohnny Matthews
Change the node class type for Node Select by Handle Type to NODE_CLASS_INPUT
2021-11-12Merge branch 'blender-v3.0-release'Hans Goudey
2021-11-12Fix: Incorrect transfer attribute error message with curvesHans Goudey
The node does support curves, but only in index mode (see T88630) So add a specific error message for the nearest mode, and let the node support curves in the declaration. Differential Revision: https://developer.blender.org/D13205
2021-11-12Geometry Nodes: Add Outer Points Selection to StarJohnny Matthews
Adds a boolean field output containing a selection of the points of the star that are controlled by the outer radius of the star. Differential Revision: https://developer.blender.org/D13097
2021-11-11Geometry Nodes: change selection output order in Cylinder nodeJacques Lucke
This new order is a bit more intuitive.
2021-11-11Merge branch 'blender-v3.0-release'Jacques Lucke
2021-11-11Fix: Attribute Transfer node does not work with a single indexJacques Lucke
Differential Revision: https://developer.blender.org/D13194
2021-11-11Geometry Nodes: Add Offset to Handle Position NodeJohnny Matthews
Adds a vector offset field to the "Curve Handle Position Node". This vector is added to the incoming position (which is the implicit handle position if not connected) which will set the position of the handle. Default is (0,0,0) Differential Revision: https://developer.blender.org/D13035
2021-11-10Fix: Hide selection value in resample curve node, fix orderHans Goudey
Selection sockets are meant to come right after the geometry, this was missed in review of rBa7672caeb255e3. Also, the selection value was not hidden.
2021-11-09Merge branch 'blender-v3.0-release'Jacques Lucke
2021-11-09Fix: wrong attribute propagation in Distribute nodeJacques Lucke
Currently the Distribute Points on Faces node does not propagate non-point attributes correctly. That is because it first interpolates the attributes to the point domain on the input mesh, and then propagates them. Differential Revision: https://developer.blender.org/D13148
2021-11-09Cleanup: clang-formatCampbell Barton
2021-11-08Nodes: store socket declaration reference in socketJacques Lucke
Previously, to get the declaration of a socket, one had to go through `node->declaration`. Now this indirection is not necessary anymore. This makes it easier to add more per-socket information into the declaration and accessing it in various places. Currently, this system is used by socket descriptions and node warnings for unsupported geometry component types.
2021-11-08Cleanup: avoid error prone struct declarations in C++Campbell Barton
Reference struct members by name instead relying on their order. This also simplifies moving back to named members when all compilers we use support them.
2021-11-05Merge branch 'blender-v3.0-release'Hans Goudey
2021-11-05Fix T92848: Crash when joining curves with spline domain attributesHans Goudey
The point domain attributes (stored on splines) are sorted so they have a consistent order on all splines after the join. However, spline domain attributes were included in the new order, which didn't work because the length of the attribute lists didn't match. The simple fix is to only include point domain attributes in the new order vector.
2021-11-05Cleanup (UI): Add/use type for operator context enumJulian Eisel
Adds a `wmOperatorCallContext` typedef for the existing `WM_OP_XXX` operator context enum. This adds type safety, allows the compiler to produce better warnings and helps understanding what a variable is for. Differential Revision: https://developer.blender.org/D13113 Reviewed by: Campbell Barton
2021-11-04Merge remote-tracking branch 'origin/blender-v3.0-release'Julian Eisel
2021-11-04Fix T92814: improve automatic linking when inserting Float Curve nodeJacques Lucke
This solves the issue in a more general that can also be used to solve similar issues for other nodes in the future. Nodes can specify their "main" socket in their declaration so that we don't have to rely on heuristics. Differential Revision: https://developer.blender.org/D13108