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-09-25Cleanup: follow C++ type cast style guide in some filesJacques Lucke
https://wiki.blender.org/wiki/Style_Guide/C_Cpp#C.2B.2B_Type_Cast This was discussed in https://devtalk.blender.org/t/rfc-style-guide-for-type-casts-in-c-code/25907.
2022-06-01Cleanup: use 'e' prefix for enum typesCampbell Barton
- CustomDataType -> eCustomDataType - CustomDataMask -> eCustomDataMask - AttributeDomain -> eAttrDomain - NamedAttributeUsage -> eNamedAttrUsage
2022-03-16Geometry Nodes: Remove legacy node codeHans Goudey
This commit removes the implementations of legacy nodes, their type definitions, and related code that becomes unused. Now that we have two releases that included the legacy nodes, there is not much reason to include them still. Removing the code means refactoring will be easier, and old code doesn't have to be tested and maintained. After this commit, the legacy nodes will be undefined in the UI, so 3.0 or 3.1 should be used to convert files to the fields system. The net change is 12184 lines removed! The tooltip for legacy nodes mentioned that we would remove them before 4.0, which was purposefully a bit vague to allow us this flexibility. In a poll in a devtalk post showed that the majority of people were okay with removing the nodes. https://devtalk.blender.org/t/geometry-nodes-backward-compatibility-poll/20199 Differential Revision: https://developer.blender.org/D14353
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
2022-01-04Cleanup: Remove bNodeType flag from base registration functionsAaron Carlisle
This flag is only used a few small cases, so instead of setting the flag for every node only set the required flag for the nodes that require it. Mostly the flag is used to set `ntype.flag = NODE_PREVIEW` For nodes that should have previews by default which is only some compositor nodes and some texture nodes. The frame node also sets the `NODE_BACKGROUND` flag. All other nodes were setting a flag of 0 which has no purpose. Reviewed By: JacquesLucke Differential Revision: https://developer.blender.org/D13699
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-09Cleanup: move public doc-strings into headers for 'nodes/geometry'Campbell Barton
Ref T92709
2021-12-02Fix: Add tooltip translation marker to disabled hintsHans Goudey
This was overlooked, as it seems there's no way for these strings to be translated currently. Generally it's not that clear whether `N_` or `TIP_` should be used in this case, but `TIP_` seems more consistent. To avoid the cost of the translation lookup when the UI text isn't necessary, we could allow the disabled hint argument to be optional. Differential Revision: https://developer.blender.org/D13141
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-06-16Geometry Nodes: Allow int attribute input fields with single valueHans Goudey
Just like the way we often have a choice between an attribute input and a single float, this adds the ability to choose between attribute and integer input sockets, useful for D11421.
2021-04-12UI/Nodes: Improve feedback when adding node fails (e.g. on drag & drop)Julian Eisel
This is especially useful when trying to add a node group instance, e.g. via drag & drop from the Outliner or Asset Browser. Previously this would just silently fail, with no information why. This is a source of confusion, e.g. earlier, it took me a moment to realize I was dragging a node group into itself, which failed of course. Blender should always try to help the user with useful error messages. Adds error messages like: "Nesting a node group inside of itself is not allowed", "Not a compositor node tree", etc. Adds a disabled hint return argument to node and node tree polling functions. On error the hint is reported, or could even be shown in advance (e.g. if checked via an operator poll option). Differential Revision: https://developer.blender.org/D10422 Reviewed by: Jacques Lucke
2021-02-16Geometry Nodes: move realize-instances code to blenkernelJacques Lucke
I need to access this functionality from modifier code. Therefore it should not be in the nodes module.
2021-02-16Geometry Nodes: move geometry set instance handling to separate fileJacques Lucke
In an upcoming commit I'll also move the make-instances-real functionality to this file. This code is not essential to working with geometry sets in general, so it makes sense to move it to a separate header.
2021-02-16Geometry Nodes: move some attribute utilities to blenkernelJacques Lucke
I need to access these utilities from modifier code as well. Therefore, they should not live in the nodes module.
2021-02-13Cleanup: Fix clang compile warningStephan Seitz
Use a reference instead of copying the string. Differential Revision: https://developer.blender.org/D10411
2021-02-12Geometry Nodes: Allow attribute nodes to use different domainsHans Goudey
Currently every attribute node assumes that the attribute exists on the "points" domain, so it generally isn't possible to work with attributes on other domains like edges, polygons, and corners. This commit adds a heuristic to each attribute node to determine the correct domain for the result attribute. In general, it works like this: - If the output attribute already exists, use that domain. - Otherwise, use the highest priority domain of the input attributes. - If none of the inputs are attributes, use the default domain (points). For the implementation I abstracted the check a bit, but in each node has a slightly different situation, so we end up with slightly different `get_result_domain` functions in each node. I think this makes sense, it keeps the code flexible and more easily understandable. Note that we might eventually want to expose a domain drop-down to some of the nodes. But that will be a separate discussion; this commit focuses on making a more useful choice automatically. Differential Revision: https://developer.blender.org/D10389
2021-02-12Geometry Nodes: Make instances real on-demandHans Goudey
This commit makes the geometry output of the collection info usable. The output is the geometry of a collection instance, but this commit adds a utility to convert the instances to real geometry, used in the background whenever it is needed, like copy on write. The recursive nature of the "realize instances" code is essential, because collection instances in the `InstancesComponent`, might have no geometry sets of their own containing even more collection instances, which might then contain object instances, etc. Another consideration is that currently, every single instance contains a reference to its data. This is inefficient since most of the time there are many locations and only a few sets of unique data. So this commit adds a `GeometryInstanceGroup` to support this future optimization. The API for instances returns a vector of `GeometryInstanceGroup`. This may be less efficient when there are many instances, but it makes more complicated operations like point distribution that need to iterate over input geometry multiple times much simpler. Any code that needs to change data, like most of the attribute nodes, can simply call `geometry_set_realize_instances(geometry_set)`, which will move any geometry in the `InstancesComponent` to new "real" geometry components. Many nodes can support read-only access to instances in order to avoid making them real, this will be addressed where needed in the near future. Instances from the existing "dupli" system are not supported yet. Differential Revision: https://developer.blender.org/D10327
2021-01-26Geometry Nodes: Add float2 to attribute complexity mapHans Goudey
2021-01-12Cleanup: Fix incorrect function nameHans Goudey
The function used "domain" incorrectly where it meant "data type".
2020-12-23Geometry Nodes: new Rotate Points nodeJacques Lucke
This node updates the "rotation" attribute on points. Multiple ways to specify the rotation are supported. Differential Revision: https://developer.blender.org/D9883 Ref T83668.
2020-12-17Geometry Nodes: Point separate and attribute compare nodesHans Goudey
This patch adds two related nodes, a node for separating points and mesh vertices based on a boolean attribute input, and a node for creating boolean attributes with comparisons. See the differential for an example file and video. Point Separate (T83059) The output in both geometries is just point data, contained in the mesh and point cloud components, depending which components had data in the input geometry. Any points with the mask attribute set to true will be moved from the first geometry output to the second. This means that for meshes, all edge and face data will be removed. Any point domain attributes are moved to the correct output geometry as well. Attribute Compare (T83057) The attribute compare does the "Equal" and "Not Equal" operations by comparing vectors and colors based on their distance from each other. For other operations, the comparison is between the lengths of the vector inputs. In general, the highest complexity data type is used for the operation, and a new function to determine that is added. Differential Revision: https://developer.blender.org/D9876
2020-12-09Geometry Nodes: simplify supporting different input socket types for attributesJacques Lucke
This is a non-functional change. The functionality introduced in this commit is not used in master yet. It is used by nodes that are being developed in other branches though.
2020-12-02Geometry Nodes: automatically reconnect when swapping inputsJacques Lucke
This makes it easier to swap the inputs to the Join Geometry node. The behavior is the same as in the Math node.
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