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-28Nodes: Enable unity build for function nodesAaron Carlisle
Unity build saves 5 seconds off the total build time when compiling `bf_nodes_function`. Total build times went from 25s to 20s (20% reduction), tested with ninja on linux running i5 8250U.
2021-12-28Nodes: Add bf_nodes_function moduleAaron Carlisle
In the future this will be used to support unity builds for function nodes Differential Revision: https://developer.blender.org/D13682
2021-12-28Nodes: Split shader color ramp into its own fileAaron Carlisle
2021-12-28Nodes: Declare function nodes in individual file namespaceAaron Carlisle
To be used in the future to support unity builds
2021-12-28Fix: Duplicate link search entries for attribute statistic nodeHans Goudey
Using the output declarations is incorrect because there is a declaration for each type. Instead loop over the names directly, since it will make it easier to add an integer mode that only supports some of the outputs.
2021-12-28Nodes: Add bf_nodes_composite moduleAaron Carlisle
In the future this will be used to support unity builds for composite nodes Differential Revision: https://developer.blender.org/D13678
2021-12-28Nodes: Declare shader nodes in individual file namespaceAaron Carlisle
To be used in the future to support unity builds
2021-12-27Fix T93941: geometry proximity breaks with high resolution meshJacques Lucke
The calls to `.fill` were overwriting indices that are processed by other threads.
2021-12-27BLI: add utility to check if type is any specific typeJacques Lucke
This adds `blender::is_same_any_v` which is the almost the same as `std::is_same_v`. The difference is that it allows for checking multiple types at the same time. Differential Revision: https://developer.blender.org/D13673
2021-12-25Shader Nodes: Convert bump node to use new socket builderAaron Carlisle
This node is a bit special in that it uses two internal sockets for a hack for Eevee; see rBffd5e1e6acd296a187e7af016f9d7f8a9f209f87 As a result, the `SOCK_UNAVAIL` flag is exposed to socket builder API. Reviewed By: JacquesLucke, fclem Differential Revision: https://developer.blender.org/D13496
2021-12-25Cleanup: use new c++ guarded allocator API in nodesAaron Carlisle
Also simplify the allocation name to `__func__` Reviewed By: JacquesLucke Differential Revision: https://developer.blender.org/D13665
2021-12-25Cleanup: Define node tree icon in register functionAaron Carlisle
I suppose this was done to reduce then dependencies. However, most nodes already depend on UI code so this isnt too useful.
2021-12-25Cleanup: use new c++ guarded allocator APIAaron Carlisle
API added in rBa3ad5abf2fe85d623f9e78fefc34e27bdc14632e
2021-12-24Nodes: Migrate bump shader node to cppAaron Carlisle
Needed for D13496
2021-12-24Fix T94162: incorrect handling when there are multiple group outputsJacques Lucke
Typically a node group should only have a single Group Output node. However, currently Blender already supports having multiple group outputs, one of which is active. This wasn't handled correctly by geometry nodes. Differential Revision: https://developer.blender.org/D13611
2021-12-24Fix T94344: Incorrect size for edge vertices node outputHans Goudey
This looks like a copy and paste error from the original commit. The virtual array output used the number of mesh polygons instead of the number of edges.
2021-12-23Fix T94232: No selection with set material node empty material listHans Goudey
If the input mesh had no materials already, the new material would become the only material on the mesh, meaning the material was added to all of the faces, instead of just the selected faces. The mesh primitive nodes in geometry nodes already add an empty slot by default, so this only affects outside geometry. The fix is just adding an empty slot before the new slot, so the non-selected material indices can still point to an empty slot. Differential Revision: https://developer.blender.org/D13654
2021-12-23Nodes: Add link drag search support for map range nodeHans Goudey
Previously only the float version of the node was connected to. This adds connection operations for vector sockets, and exposes the "Steps" socket properly when it's selected.
2021-12-23Cleanup: Return earlyHans Goudey
2021-12-23Fix: Extra space at the front of "Sample Curve" node nameHans Goudey
2021-12-23Fix: Wrong node link drag search menu items for attribute statisticHans Goudey
Caused by capturing local variables by reference in a function that outlives the scope it was created in. Also use a more generic function for the first two inputs.
2021-12-22Cleanup: Avoid adding points to splines sequentiallyHans Goudey
This should be faster because it avoids reallocating the internal vectors when the size is known beforehand, but it may also help a potential refactor to a different data structure (see T94193).
2021-12-22Nodes: Refactor to remove node and socket "new" pointersHans Goudey
These pointers point to the new nodes when duplicating, and their even used to point to "original" nodes for "localized" trees. They're just a bad design decision that make code confusing and buggy. Instead, node copy functions now optionally add to a map of old to new socket pointers. The case where the compositor abused these pointers as "original" pointers are handled by looking up the string node names. Differential Revision: https://developer.blender.org/D13518
2021-12-21Cleanup: Clang tidy, restore alphabetical sortingHans Goudey
2021-12-21Nodes: refactor node tree update handlingJacques Lucke
Goals of this refactor: * More unified approach to updating everything that needs to be updated after a change in a node tree. * The updates should happen in the correct order and quadratic or worse algorithms should be avoided. * Improve detection of changes to the output to avoid tagging the depsgraph when it's not necessary. * Move towards a more declarative style of defining nodes by having a more centralized update procedure. The refactor consists of two main parts: * Node tree tagging and update refactor. * Generally, when changes are done to a node tree, it is tagged dirty until a global update function is called that updates everything in the correct order. * The tagging is more fine-grained compared to before, to allow for more precise depsgraph update tagging. * Depsgraph changes. * The shading specific depsgraph node for node trees as been removed. * Instead, there is a new `NTREE_OUTPUT` depsgrap node, which is only tagged when the output of the node tree changed (e.g. the Group Output or Material Output node). * The copy-on-write relation from node trees to the data block they are embedded in is now non-flushing. This avoids e.g. triggering a material update after the shader node tree changed in unrelated ways. Instead the material has a flushing relation to the new `NTREE_OUTPUT` node now. * The depsgraph no longer reports data block changes through to cycles through `Depsgraph.updates` when only the node tree changed in ways that do not affect the output. Avoiding unnecessary updates seems to work well for geometry nodes and cycles. The situation is a bit worse when there are drivers on the node tree, but that could potentially be improved separately in the future. Avoiding updates in eevee and the compositor is more tricky, but also less urgent. * Eevee updates are triggered by calling `DRW_notify_view_update` in `ED_render_view3d_update` indirectly from `DEG_editors_update`. * Compositor updates are triggered by `ED_node_composite_job` in `node_area_refresh`. This is triggered by calling `ED_area_tag_refresh` in `node_area_listener`. Removing updates always has the risk of breaking some dependency that no one was aware of. It's not unlikely that this will happen here as well. Adding back missing updates should be quite a bit easier than getting rid of unnecessary updates though. Differential Revision: https://developer.blender.org/D13246
2021-12-20Fix T94144: Duplicate edges in dual mesh nodeWannes Malfait
The duplicated edges were caused by 'oversubdivided' edges, i.e. edges where some of the vertices on them are only connected to two polygons. The fix finds these vertices and 'dissolves' them so that only one edge is created. For most 'normal' meshes this shouldn't occurr, or only very little, so the performance impact of this change should be neglegible. In practice this is also avoidable by triangulating the mesh first. Differential Revision: https://developer.blender.org/D13445
2021-12-20Cleanup: Remove mesh valid assertions in debug buildsHans Goudey
These are useful for development, but when the primitive nodes aren't actively changing, the performance cost is not worth it.
2021-12-20Geometry Nodes: Parallelize mesh grid primitiveHans Goudey
On a Ryzen 3700x, this ended up 2.5x faster than before. More benchmarking details are included in the differential revision. For smaller grids, all this should do is increase the code size a bit, and add a few more if statements. Differential Revision: https://developer.blender.org/D13617
2021-12-20Cleanup: Remove more texture nodes preview handlingHans Goudey
Similar to the previous commit, this allowed removing a function to set a single pixel of a node preview.
2021-12-20Cleanup: Remove more no-op node preview codeHans Goudey
This is a follow-up to rB43875e8dd1d76ee, removing some processing of non-existent node previews in the shader and texture nodes systems.
2021-12-18Fix: Build error from missing includeHans Goudey
2021-12-18Fix: Link drag search missing field nodes from function nodesHans Goudey
When dragging from the inputs of function nodes, other function nodes wouldn't connect, because their socket declaration field types weren't set correctly. Instead, they relied on code properly checking the *node* declaration's `is_function_node()` method. However, that increases complexity and requires passing the node instead of just the socket in more places. Instead, set the proper field types in the socket declaration during building. Differential Revision: https://developer.blender.org/D13600
2021-12-18Cleanup: compiler warnings with clangBrecht Van Lommel
Includes use of memcpy to avoid warnings about deprecated members.
2021-12-18Fix T94215: compositer denoise node UI wrongly shows as disabledBrecht Van Lommel
After recent refactoring in 4e98d974b596.
2021-12-17Cleanup: use new c++ guarded allocator api in some filesJacques Lucke
2021-12-17Fix T94166: set handle position node crashed after refactorJacques Lucke
This was an oversight in rB8e2c9f2dd3118bfdb69ccf0ab2b9f968a854aae4.
2021-12-17Cleanup: Simplify logic in set material nodeHans Goudey
2021-12-17Geometry Nodes: Support point clouds in the set material nodeHans Goudey
Now that point clouds can be rendered with cycles, it makes sense to allow assigning a material to them. Note that like volumes, they only support a single material though.
2021-12-16Nodes: Begin splitting composite node buttons into individual filesAaron Carlisle
Currently, most node buttons are defined in `drawnode.cc` however, this is inconvenient because it requires editing many files when adding new nodes. The goal is to minimize the number of files needed to add or update a node. This commit moves most of the node layout functions for composite nodes into their respected `source/blender/nodes/composite/nodes` file. In the future, these functions will be simplified to `node_layout` once files have their own namespace. See {D13466} for more information. Reviewed By: HooglyBoogly Differential Revision: https://developer.blender.org/D13523
2021-12-16Cleanup: spellingCampbell Barton
2021-12-16Cleanup: clang-formatCampbell Barton
2021-12-16Fix various cases of incorrect filtering in node link drag searchHans Goudey
Some nodes didn't check the type of the link's socket for filtering. Do this with a combination of manually calling the node tree's validate links function and using the helper function for declarations. Also clean up a few cases that added geometry sockets manually when they can use the simpler helper function.
2021-12-16Fix: Compare node missing from link drag searchHans Goudey
This was missing from rB11be151d58ec0ca955f. It uses the same approach as the quadrilateral node.
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-15Geometry Nodes: Add Selection to Attribute StatisticsJohnny Matthews
This adds a bool field selection input to the Attribute Statistics node. This is useful for running calculations on a subset of the input field data rather that then whole set. Differential Revision: https://developer.blender.org/D13520
2021-12-15Cleanup: unused variable warningCampbell Barton
2021-12-15Fix T94082: Curve to point empty evaluated NURBS crashHans Goudey
This is basically the same as rBee4ed99866fbb7ab04, the fix is simply to check if the spline has evaluated points when deciding the offsets into the result points array.
2021-12-14Nodes: Add vector support to Map Range nodeCharlie Jolly
This replaces lost functionality from the old GN Attribute Map Range node. This also adds vector support to the shader version of the node. Notes: This breaks forward compatibility as this node now uses data storage. Reviewed By: HooglyBoogly, brecht Differential Revision: https://developer.blender.org/D12760
2021-12-14Cleanup: Simplify node group input and output socket verificationHans Goudey
This commit refactors the way the socket lists for group nodes, and group input/output nodes are verified to match the group's interface. Previously the `bNodeSocket.new_sock` pointer was used to temporarily mark the new sockets. This made the code confusing and more complicated than necessary. Now the old socket list is saved, and sockets are moved directly from the old list to a new list if they match, or a new socket is created directly in the new list. This change is split from D13518, which aims to remove the `new_node` and `new_sock` pointers. In the future this code might be removed entirely in favor of using node socket declarations. Differential Revision: https://developer.blender.org/D13543
2021-12-14Geometry Nodes: support instance attributes when realizing instancesJacques Lucke
This patch refactors the instance-realization code and adds new functionality. * Named and anonymous attributes are propagated from instances to the realized geometry. If the same attribute exists on the geometry and on an instance, the attribute on the geometry has precedence. * The id attribute has special handling to avoid creating the same id on many output points. This is necessary to make e.g. the Random Value node work as expected afterwards. Realizing instance attributes has an effect on existing files, especially due to the id attribute. To avoid breaking existing files, the Realize Instances node now has a legacy option that is enabled for all already existing Realize Instances nodes. Removing this legacy behavior does affect some existing files (although not many). We can decide whether it's worth to remove the old behavior as a separate step. This refactor also improves performance when realizing instances. That is mainly due to multi-threading. See D13446 to get the file used for benchmarking. The curve code is not as optimized as it could be yet. That's mainly because the storage for these attributes might change soonish and it wasn't worth optimizing for the current storage format right now. ``` 1,000,000 x mesh vertex: 530 ms -> 130 ms 1,000,000 x simple cube: 1290 ms -> 190 ms 1,000,000 x point: 1000 ms -> 150 ms 1,000,000 x curve spiral: 1740 ms -> 330 ms 1,000,000 x curve line: 1110 ms -> 210 ms 10,000 x subdivided cylinder: 170 ms -> 40 ms 10 x subdivided spiral: 180 ms -> 180 ms ``` Differential Revision: https://developer.blender.org/D13446