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
2022-08-31Nodes: move NodeTreeRef functionality into node runtime dataJacques Lucke
The purpose of `NodeTreeRef` was to speed up various queries on a read-only `bNodeTree`. Not that we have runtime data in nodes and sockets, we can also store the result of some queries there. This has some benefits: * No need for a read-only separate node tree data structure which increased complexity. * Makes it easier to reuse cached queries in more parts of Blender that can benefit from it. A downside is that we loose some type safety that we got by having different types for input and output sockets, as well as internal and non-internal links. This patch also refactors `DerivedNodeTree` so that it does not use `NodeTreeRef` anymore, but uses `bNodeTree` directly instead. To provide a convenient API (that is also close to what `NodeTreeRef` has), a new approach is implemented: `bNodeTree`, `bNode`, `bNodeSocket` and `bNodeLink` now have C++ methods declared in `DNA_node_types.h` which are implemented in `BKE_node_runtime.hh`. To make this work, `makesdna` now skips c++ sections when parsing dna header files. No user visible changes are expected. Differential Revision: https://developer.blender.org/D15491
2022-02-11File headers: SPDX License migrationCampbell Barton
Use a shorter/simpler license convention, stops the header taking so much space. Follow the SPDX license specification: https://spdx.org/licenses - C/C++/objc/objc++ - Python - Shell Scripts - CMake, GNUmakefile While most of the source tree has been included - `./extern/` was left out. - `./intern/cycles` & `./intern/atomic` are also excluded because they use different header conventions. doc/license/SPDX-license-identifiers.txt has been added to list SPDX all used identifiers. See P2788 for the script that automated these edits. Reviewed By: brecht, mont29, sergey Ref D14069
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-10Cleanup: move public doc-strings into headers for 'nodes'Campbell Barton
Ref T92709
2021-12-02Fix T93555: crash when muting nodes with multiple internal linksJacques Lucke
The crash happened because I was incorrectly and inconsistently assuming that a socket is part of at most one internal link. However, this is not the case. In geometry nodes, an input socket can be internally linked to multiple output sockets. In the general case, an output could also be linked to multiple input sockets, even though we don't have that in Blender yet.
2021-11-30Cleanup: spelling in comments & stringsCampbell Barton
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-03Fix: muted nodes not handled correctlyJacques Lucke
This was an error in rBb55bddde40db3eda3531d98caa99be9a8e88a8ee.
2021-11-03Fix T91862: do type conversion when data enters or exists node groupJacques Lucke
The geometry node evaluator now has access to the entire socket path from the node that produces a value to the node that uses it. This allows the evaluator to make decisions about at which points in the path the value should be converted. Multiple conversions may be necessary under some circumstances with nested node groups. Differential Revision: https://developer.blender.org/D13034
2021-07-21Fix T89881: ignore unavailable sockets when searching for link cyclesJacques Lucke
2021-06-24Cleanup: comment blocks, trailing space in commentsCampbell Barton
2021-06-11Nodes: add utilities to check if there are undefined nodes/socketsJacques Lucke
2021-04-01Geometry Nodes: add socket value logging capabilityJacques Lucke
The node tree evaluator now calls a callback for every used socket with its corresponding value(s). Right now the callback does nothing. However, we can use it to collect attribute name hints, socket values for debugging or data that will be displayed in the spreadsheet. The main difficulty here was to also call the callback for sockets in nodes that are not directly executed (such as group nodes, muted nodes and reroutes). No functional changes are expected.
2021-03-20Cleanup: quiet warningJacques Lucke
2021-03-20Nodes: implement dot graph exporter for derived node treeJacques Lucke
This visualization of nested node groups makes it easier to debug some issues. Muted nodes, muted links, reroute nodes and unavailable sockets are removed from the visualization to keep it clean. Nested node groups are visualized using colored clusters.
2021-03-19Nodes: make distinction between directly and logically linked sockets more clearJacques Lucke
This also moves the handling of muted nodes from derived node tree to node tree ref.
2021-03-09Fix: only follow first input of multi-input-socket when mutedJacques Lucke
Otherwise muting a Join Geometry node has no effect, when there are multiple Join Geometry nodes in a row.
2021-03-07Cleanup: fix compiler warningJacques Lucke
2021-03-06Nodes: refactor derived node treeJacques Lucke
This is a complete rewrite of the derived node tree data structure. It is a much thinner abstraction about `NodeTreeRef` than before. This gives the user of the derived node tree more control and allows for greater introspection capabilities (e.g. before muted nodes were completely abstracted away; this was convenient, but came with limitations). Another nice benefit of the new structure is that it is much cheaper to build, because it does not inline all nodes and sockets in nested node groups. Differential Revision: https://developer.blender.org/D10620
2021-03-04Nodes: improve NodeTreeRefJacques Lucke
This adds a couple more utility methods to various node tree ref types. Also `InternalLinkRef` has been added to get simpler access to internal links.
2021-03-04Fix T86204: support multiple group inputs in node groupJacques Lucke
Note that this still does not work when in the node group directly referenced by the modifier, only in sub-node-groups. This limitation will be removed at some point.
2021-02-03Geometry Nodes: Multi-Input SocketsFabian Schempp
Normally sockets only have one input link. This commit adds the back-end changes needed to use multiple input links per socket. Multi-input sockets can be defined with a new flag in `bNodeSocketType`. The changes necessary to make the sockets work in the geometry nodes evaluator are generalizing input socket values as a vector of values, and supporting this in the derived node tree structure. This patch should contain no functional changes. Two upcoming patches will use this system for the "Join Geometry" node and expose link picking and updated display in the UI: D10069 and D10181. Reviewed By: Jacques Lucke, Hans Goudey Differential Revision: https://developer.blender.org/D10067
2020-12-02Geometry Nodes: support muted nodesJacques Lucke
The handling of muted nodes is handled at the derived node tree level now. This is also where expanding node groups is handled. Muted nodes are relinked and removed from the derived tree during construction. The geometry node evaluation code does not have to know about muted nodes this way.
2020-12-02Geometry Nodes: initial scattering and geometry nodesJacques Lucke
This is the initial merge from the geometry-nodes branch. Nodes: * Attribute Math * Boolean * Edge Split * Float Compare * Object Info * Point Distribute * Point Instance * Random Attribute * Random Float * Subdivision Surface * Transform * Triangulate It includes the initial evaluation of geometry node groups in the Geometry Nodes modifier. Notes on the Generic attribute access API The API adds an indirection for attribute access. That has the following benefits: * Most code does not have to care about how an attribute is stored internally. This is mainly necessary, because we have to deal with "legacy" attributes such as vertex weights and attributes that are embedded into other structs such as vertex positions. * When reading from an attribute, we generally don't care what domain the attribute is stored on. So we want to abstract away the interpolation that that adapts attributes from one domain to another domain (this is not actually implemented yet). Other possible improvements for later iterations include: * Actually implement interpolation between domains. * Don't use inheritance for the different attribute types. A single class for read access and one for write access might be enough, because we know all the ways in which attributes are stored internally. We don't want more different internal structures in the future. On the contrary, ideally we can consolidate the different storage formats in the future to reduce the need for this indirection. * Remove the need for heap allocations when creating attribute accessors. It includes commits from: * Dalai Felinto * Hans Goudey * Jacques Lucke * Léo Depoix
2020-08-07Cleanup: use C++ style casts in various placesJacques Lucke
2020-08-05Cleanup: remove some private fields that are currently unusedJacques Lucke
2020-07-24BLI: add MultiValueMapJacques Lucke
This is a convenience wrapper for `Map<Key, Vector<Value>>`. It does not provide any performance benefits (yet). I need this kind of map in a couple of places and before I was duplicating the lookup logic in many places.
2020-07-20Refactor: Update integer type usageJacques Lucke
This updates the usage of integer types in code I wrote according to our new style guides. Major changes: * Use signed instead of unsigned integers in many places. * C++ containers in blenlib use `int64_t` for size and indices now (instead of `uint`). * Hash values for C++ containers are 64 bit wide now (instead of 32 bit). I do hope that I broke no builds, but it is quite likely that some compiler reports slightly different errors. Please let me know when there are any errors. If the fix is small, feel free to commit it yourself. I compiled successfully on linux with gcc and on windows.
2020-07-17Nodes: move some code from blenkernel directory to nodesJacques Lucke
This also introduces the `blender::nodes` namespace. Eventually, we want to move most/all of the node implementation files into this namespace. The reason for this file-move is that the code fits much better into the `nodes` directory than in the `blenkernel` directory.