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-03-17Nodes: Add support to mute node wiresCharlie Jolly
This patch adds the ability to mute individual wires in the node editor. This is invoked like the cut links operator but with a new shortcut. Mute = Ctrl + Alt Cut = Ctrl Dragging over wires will toggle the mute state for that wire. The muted wires are drawn in red with a bar across the center. Red is used in the nodes context to indicate invalid links, muted links and internal links. When a wire is muted it exposes the original node buttons which are normally hidden when a wire is connected. Downstream and upstream links connected using reroute nodes are also muted. Outside scope of patch: - Add support for pynodes e.g. Animation Nodes - Requires minor change to check for muted links using the `is_muted` link property or the `is_linked` socket property. Maniphest Tasks: T52659 Differential Revision: https://developer.blender.org/D2807
2021-03-17Geometry Nodes: store domain and data type in attribute hintsJacques Lucke
The information is not exposed in the attribute search yet.
2021-03-16Compositor: Redesign Cryptomatte node for better usabilityJeroen Bakker
In the current implementation, cryptomatte passes are connected to the node and elements are picked by using the eyedropper tool on a special pick channel. This design has two disadvantages - both connecting all passes individually and always having to switch to the picker channel are tedious. With the new design, the user selects the RenderLayer or Image from which the Cryptomatte layers are directly loaded (the type of pass is determined by an enum). This allows the node to automatically detect all relevant passes. Then, when using the eyedropper tool, the operator looks up the selected coordinates from the picked Image, Node backdrop or Clip and reads the picked object directly from the Renderlayer/Image, therefore allowing to pick in any context (e.g. by clicking on the Combined pass in the Image Viewer). The sampled color is looked up in the metadata and the actual name is stored in the cryptomatte node. This also allows to remove a hash by just removing the name from the matte id. Technically there is some loss of flexibility because the Cryptomatte pass inputs can no longer be connected to other nodes, but since any compositing done on them is likely to break the Cryptomatte system anyways, this isn't really a concern in practise. In the future, this would also allow to automatically translate values to names by looking up the value in the associated metadata of the input, or to get a better visualization of overlapping areas in the Pick output since we could blend colors now that the output doesn't have to contain the exact value. Idea + Original patch: Lucas Stockner Reviewed By: Brecht van Lommel Differential Revision: https://developer.blender.org/D3959
2021-03-15Geometry Nodes: Support drag & drop object to create Object Info, Collection ↵Charlie Jolly
Info and Sample Texture nodes See: {T86296} Reviewed By: JacquesLucke Differential Revision: https://developer.blender.org/D10648
2021-03-15Nodes: fix crash after undo after recent multi-input-socket changesJacques Lucke
The issue is that the `last_node_hovered_while_dragging_a_link` pointer is invalidated on undo. The pointer does not have to be on the space runtime data, because it only needs to exist as long as the operator is running. Differential Revision: https://developer.blender.org/D10726
2021-03-11Nodes: Fix drag link from output to already linked Multi-Input SocketFabian Schempp
This patch fixes a visual bug related to connecting an output socket to a Multi-Input Socket, that already has a link to that same output. In this case, the drag link got a new index and snapped to a new position. This path makes the drag link snap to the same position as the first link between the two sockets. Differential Revision: https://developer.blender.org/D10689
2021-03-10Fix T86416: geometry nodes crash choosing a group node link menuPhilipp Oeser
Since rBb279fef85d1a, the nodes properties for geometry nodes using a texture are displayed in the Properties Editor. It was possible to create recursive nodetrees when choosing the 'root' nodegroup in the node link menu though leading to a crash. Now poll if a group node of a particular node could actually be added to the current tree. Also check if the tree types actually match. Maniphest Tasks: T86416 Differential Revision: https://developer.blender.org/D10671
2021-03-10Nodes: Sortable Multi Input SocketsFabian Schempp
This Patch removes the auto sorting from Multi-Input Sockets and allows the links to be sorted by drag and drop instead. As a minor related change, it fixes the drawing of the mute line to connect to the first input instead of the socket's center.
2021-03-10Fix (unreported) geometry node attribute search not working in thePhilipp Oeser
Properties Editor Since rBb279fef85d1a, the nodes properties for geometry nodes using a texture are displayed in the Properties Editor. rB85421c4fab02 added an attribute search button, but this was missing still (gave just the regular text button) if this was displayed in the Properties Editor. ref b279fef85d1a / T86416 / D10671 / D10673 Maniphest Tasks: T86416 Differential Revision: https://developer.blender.org/D10674
2021-03-08Fix T86373: crash picking colors in geometry nodesocketsPhilipp Oeser
Caused by {rB85421c4fab02}. Above commit treated `SOCK_RGBA` and `SOCK_STRING` the same in `std_node_socket_draw`. That would turn a RGBA button into a text button (for attribute search), leading to trouble. Note these were just treated the same prior to above commit because both were doing the layout split. Now just give RGBA sockets their own case. Maniphest Tasks: T86373 Differential Revision: https://developer.blender.org/D10646
2021-03-05Geometry Nodes: Sort attribute search items when menu opensHans Goudey
Because the search didn't run when the menu first opens, the attributes appeared in a different order than after you typed anything into the search field. This commit instead runs the search when the menu is first opened, but it only sorts items without filtering.
2021-03-04Fix T86172: tag relations update when pasting nodesJacques Lucke
Pasting nodes can create new id relations, because nodes can reference IDs. Therefore the depsgraph has to be updated when nodes are pasted. We could somehow check if the pasted nodes referenced IDs, but I'm not sure if this complexity is worth it.
2021-03-04Cleanup: redundant struct declarationsCampbell Barton
2021-03-03Geometry Nodes: Allow clearing an attribute text fieldHans Goudey
Because pressing enter will choose the current search item from the menu, and there was no search item with an empty string, it was impossible to clear the text of an attribute text field. This commit adds a simple "X" icon in the top row when you delete the string.
2021-03-03UI: Allow translation for node error messagesHans Goudey
This commit exposes the strings used in the node error messages for localization. It also changes the message tooltip creation to automatically add the period at the end, to be more consistent with the (arguably bad) design of other tooltips in Blender. Calling `TIP_` directly in the node implementation files allows us to continue using `std::string` concatenation instead of passing variadic arguments. It's also more explicit about which part of the message is translated and which isn't. The files already include the translation header anyway.
2021-03-03Fix crash when dragging nodesHans Goudey
The `bNodeLinkDrag` struct was NULL when dragging a node instead of a link. It is allocated with `calloc` anyway, so this field doesn't need to be explitely cleared.
2021-03-03Fix T85966: Wrong link picked when dragging multi-input socketFabian Schempp
The socket drag operator stored the index of the last picked socket into RNA in case the mouse cursor leaves the link while dragging. This id was not unique which is why sometimes a link from an other node with the same id is picked. This patch changes the way the last picked link is stored and stores a pointer to the link directly into bNodeLinkDrag struct instead. Differential Revision: https://developer.blender.org/D10590
2021-03-02Geometry Nodes: Attribute search drop-downHans Goudey
This commit adds a search for existing attributes when you click on an attribute field. This is useful because otherwise you have to remember which attributes should be available at each node in the tree. The fundamental complication is that this information is not accessible statically. So the search data is only a cache from the previous node tree evaluation. The information is added with `BKE_nodetree_attribute_hint_add`, currently for every input geometry socket for a single node. This is only an initial implementation, and later versions will expose the data type and domain of the attributes. Differential Revision: https://developer.blender.org/D10519
2021-03-02UI: Expose an "is first search" boolean to search button callbacksHans Goudey
Currently when you open an RNA collection search button, like a vertex group selector, the search filter isn't applied until you start typing, in order to display every option at the start. Otherwise they wouldn't be visible, since the search filter would run for the current text. Currently this check happens in one place, but it relies on the `changed` value of `uiBut`. This is fine in the interface directory, but anywhere else it would require exposing `uiBut.changed`, which is probably too low-level to expose. The solution is adding an `is_first` argument to the search callbacks, which is nice for a few reasons: - They work at a higher level of abstraction, meaning they don't have to worry about how exactly to tell if this is the first search. - It makes it easier to do special behavior when the search menu is first opened. - Then, obviously, it makes that state accessible without including `interface_intern.h`. Needed for attribute search: T85658 Differential Revision: https://developer.blender.org/D10528
2021-02-24Cleanup: Remove unused node editor button event definesHans Goudey
These defines seem to be left over from the initial implementation of the node editor. In a few places the values were used in button creation, but the callbacks never checked the value anyway. Node uiBlocks also had a callback what would never do anything since the value it checked for was never used.
2021-02-24UI: Cleanup and fix labels and descriptions in various placesYevgeny Makarov
Changes include using proper and consistent grammar, simplifying phrasing, using correct terminology, and not including python API identifiers in tooltips. Differential Revision: https://developer.blender.org/D9924
2021-02-24UI: Make node virtual sockets more visibleFabian Schempp
This commit tweaks how virtual sockets (unconnected node group input and output sockets) are drawn to make them more recognizable. The outline is changed to a gray color, and they get a dark inner color. Differential Revision: https://developer.blender.org/D10080
2021-02-24Geometry Nodes: Move node UI storage function to BKEHans Goudey
This function will be used in another file with attribute search, so it makes sense to share from the UI storage header.
2021-02-22Merge branch 'blender-v2.92-release'Philipp Oeser
2021-02-22Fix T85865: Crash when selecting Image texture nodePhilipp Oeser
Typo in rB7470c10601d0. Maniphest Tasks: T85865 Differential Revision: https://developer.blender.org/D10496
2021-02-19Cleanup: typoJacques Lucke
2021-02-19Nodes: only show warning icon if there are warningsJacques Lucke
2021-02-18Cleanup: sort structs, file-listsCampbell Barton
2021-02-18Cleanup: use doxy sectionsCampbell Barton
2021-02-18Cleanup: Use Vector instead of of raw arrayHans Goudey
2021-02-17Cleanup: Comment formatting in node_draw.ccHans Goudey
2021-02-17Cleanup: spellingCampbell Barton
2021-02-17Geometry Nodes: Node error messagesHans Goudey
This patch adds icons to the right side of nodes when they encounter a a problem. When hovered, a tooltip displays describing the encountered while evaluating the node. Some examples are: attribute doesn't exist, mesh has no faces, incorrect attribute type, etc. Exposing more messages to the system will be an ongoing process. Multiple warnings per node are supported. The system is implemented somewhat generically so that the basic structure can also be used to store more information from evaluation for the interface, like a list of available attributes. Currently the messages are just button tooltips. They could be styled differently in the future. Another limitation is that every instance of a node group in a parent node tree will have the same error messages, the "evaluation context" used to decide when to display the tooltips must be extended to support node tree paths. Differential Revision: https://developer.blender.org/D10290
2021-02-16Cleanup: Remove use of designated initializers in C++Hans Goudey
2021-02-16Cleanup: Compile node_draw.c with C++Hans Goudey
This will allow using C++ data structures to draw node error messages. This required removing a forward declared enum for grease pencil undo. Compiles with clang tidy.
2021-02-16Assets: Remove appended asset when dropping operation failsJulian Eisel
When dropping an asset somewhere, it is appended and then a drop operation is called to actually add it to the scene based on current context. If this drop operation fails, the appended data-block is now still in the .blend. The user may not notice and not expect this. Instead idea is to rollback any changes done by dropping code if the operation fails, namely removing the appended data-block again. Adds a new `cancel()` callback which is called if the drop operator returns `OPERATOR_CANCELLED` to drop-boxes and a generic function to deal with assets on drop failure. Also removes the `free_id_on_error` property of the `NODE_OT_add_group` operator, which was used as ad-hoc solution to get this same behavior.
2021-02-15UI/Nodes: Adding node groups via drag & drop (e.g. from Asset Browser)Julian Eisel
Adds `NODE_OT_add_group` operator to add a node group from a given name, and uses that to register a node editor drop-box. When dropping a node-group asset, the ID will be appended. This is what we do for other ID assets too. Should the node group insertion fail (e.g. the group is not compatible with the current tree, as checked by the poll), the appended data-block is removed. Differential Revision: https://developer.blender.org/D10405 Reviewed by: Jacques Lucke
2021-02-15Merge branch 'blender-v2.92-release'Jacques Lucke
2021-02-15Fix T84624: node group data-block has phantom userJacques Lucke
This is because the node editor added a "real user" to the node group that it displays. It was mainly added as a hack to solve issues with custom tree types (T36024). Since we can store id references in custom properties now, this "real user" is not really necessary anymore. Given that we are close to a release, I'll only disable line for geometry nodes, for which the bug has been reported. Discussed this solution with Hans Goudey.
2021-02-11Cleanup: clang-format, spellingCampbell Barton
2021-02-11Fix T85541: crash when replacing an existing node linkJacques Lucke
It's not necessary to check if the link has to be removed, if it was removed already. This regression was caused by rB8f707a72e81833bb835324ddc635b29dfbe87a9f.
2021-02-11UI: Multi-input node socket spacing and interactionFabian Schempp
This commit makes links connected to multi-input sockets spread verticaly along the socket. Sockets grow if more links are connected and the node layout updates accordingly. Links are sorted by their incoming angle to avoid crossing links. Also, link picking is updated to work with spread links and bezier links. Currently the multi-input sockets are used in the join geometry node. The mutli-input sockets look like a vertical rounded rectangle. Currently they do not support the other custom socket shapes. Reviewed By Hans Goudey, with cleanup and additional edits Differential Revision: https://developer.blender.org/D10181
2021-02-10Cleanup: remove redundant headers in source/blender/editors/Campbell Barton
Remove redundant headers using `./source/tools/utils_maintenance/code_clean.py` Reviewed By: jmonteath Ref D10364
2021-02-09Cleanup: Register node property layout callbacks in filesHans Goudey
This commit moves the property layout callbacks for node types to their implementation files from `drawnode.c`. This was proposed a while ago in T75724. **Benefits** - Fewer files need to be changed when adding a new node. - Makes it possible to reuse functions from the node's implementation in the layout code. - Except for RNA, all of the node "inputs" are in the same place. - Code gets shorter overall, avoids the large switch statements. **Downsides** - Requires including two UI headers. - Requires adding an editors dependency to the nodes folder. This commit only changes function nodes and geometry nodes, more can be moved later. Differential Revision: https://developer.blender.org/D10352
2021-02-05Geometry Nodes: add Volume to Mesh nodeJacques Lucke
This node takes a volume and generates a mesh on it's "surface". The surface is defined by a threshold value. Currently, the node only works on volumes generated by the Points to Volume node. This limitation will be resolved soonish. Ref T84605. Differential Revision: https://developer.blender.org/D10243
2021-02-05Geometry Nodes: support fixed pivot axis in Align Rotation to Vector nodeJacques Lucke
When the pivot axis is not set to auto, the node will try to align the rotation to vector as best as possible, given the selected rotation axis. Ref T85211. Differential Revision: https://developer.blender.org/D10292
2021-02-05Geometry Nodes: Add Attribute Proximity NodeVictor-Louis De Gusseme
This node calculates a distance from each point to the closest position on a target geometry, similar to the vertex weight proximity modifier. Mapping the output distance to a different range can be done with an attribute math node after this node. A drop-down changes whether to calculate distances from points, edges, or faces. In points mode, the node also calculates distances from point cloud points. Design task and use cases: T84842 Differential Revision: https://developer.blender.org/D10154
2021-02-05Cleanup: correct spelling in commentsCampbell Barton
2021-02-03Cleanup: don't end description with dotJacques Lucke
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