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-05-14Nodes: fix connecting wrong sockets when inserting nodeJacques Lucke
Differential Revision: https://developer.blender.org/D11231
2021-05-14Geometry Nodes: remove some unnecessary updatesJacques Lucke
This fixes a few "obvious" places where we do unnecessary updates. Those special cases were added in the early days of geometry nodes when many updates were missing and we tried to get it to work at all. There is a fairly high risk that with this change some required updates will be missing again. Those can be fixed when we find thme. Some of the update issues might have been fixed by rB58818cba40794905f9323080e60884e090f2d388 and similar changes we added over time. Differential Revision: https://developer.blender.org/D11238
2021-04-16Cleanup: clang-formatCampbell Barton
2021-04-15Fix T87171: Update multi input socket indicesFabian Schempp
When inserting a node on top of a link, the multi input socket indices weren't updated. This fixes that and keeps the relative order of the links the same. Author: Wannes Malfait Reviewed By: Fabian Schempp Differential Revision: https://developer.blender.org/D10969
2021-04-15Fix T87356 & T87358: Small multi-input socket issuesFabian Schempp
T87356 occured because last_node_hovered_while_dragging_a_link was not set on node_link_init. The assert in T87358 failed because the sorting operation was called even if the drag link contained a link to another socket. A little one frame jump was caused because frame was refreshed after picking a link and before sorting happened. Reviewer: Hans Goudey Differential Revision: https://developer.blender.org/D10940
2021-04-07Cleanup: Various cleanup of node link handling functionsHans Goudey
Use LISTBASE_FOREACH macro, rename variables, comment formatting, simplification of logic, etc.
2021-03-26Nodes: match Multi-input socket activation distanceFabian Schempp
Activation distance for multi input sockets had different length dependend of dpi factor. That caused jumping when activation distance became shorter than snapping distance. Fixed by removing activation distance and using same function which is used to evaluate snapping. Reviewer: Dalai Felinto Differential Revision: https://developer.blender.org/D10809
2021-03-23FIX: Incorrect link drawing after link cutting toolFabian Schempp
Sorting of links on multi-input sockets where not recalculated after using the knife operator. Added call to resort function before cutting operator finishes. Reviewer: Jacques Lucke Differential Revision: https://developer.blender.org/D10783
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-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-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-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-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-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
2021-01-20Cleanup: Store runtime space node variables in a separate structHans Goudey
This commit moves runtime-only variables from the `SpaceNode` DNA struct to a private struct in `node_intern.h`. Before, it was hard to tell which data needed to be saved in files, this should make it more clear. Node that the `edittree` field is basically a runtime variable, since it's set from the `treepath` list on read, but moving it would require some more invasive changes that I don't think are worth it right now. Also, not all of the moved variables were explicitly cleared on read-- `aspect` is set at the start of a redraw, `cursor` is set in a region callback, and `recalc` was used as an update flag. Differential Revision: https://developer.blender.org/D10141
2021-01-15Cleanup: Add const in various places in node codeHans Goudey
Also includes some various other minor cleanups, like using bool instead of int in a couple places.
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-10-16Cleanup: reduce variable scopesJacques Lucke
2020-10-10Cleanup: use C comments for descriptive textCampbell Barton
Follow our code style guide by using C-comments for text descriptions.
2020-09-09Cleanup: reduce variable scopeJacques Lucke
2020-08-07Cleanup: pass arrays const where possibleCampbell Barton
2020-08-04Merge branch 'blender-v2.90-release' into masterNathan Craddock
2020-08-04Fix T78932: fix linking reroute nodes of different typeJacques Lucke
Reviewers: mano-wii Differential Revision: https://developer.blender.org/D8460
2020-07-22Nodes: add missing update tags in the case of simulation node treesJacques Lucke
2020-07-03Cleanup: Editors/Space/Node, Clang-Tidy else-after-return fixesSybren A. Stüvel
This addresses warnings from Clang-Tidy's `readability-else-after-return` rule in the `source/blender/editors/space_node` module. No functional changes.
2020-05-09Cleanup: spellingCampbell Barton
2020-04-14Cleanup: spellingCampbell Barton
2020-04-03Code Quality: Replace for loops with LISTBASE_FOREACHDalai Felinto
Note this only changes cases where the variable was declared inside the for loop. To handle it outside as well is a different challenge. Differential Revision: https://developer.blender.org/D7320
2020-04-03Cleanup: Animation, move AnimData API to `anim_data.c`/`BKE_anim_data.h`Sybren A. Stüvel
The `BKE_animsys.h` and `anim_sys.c` files already had a an "AnimData API" section. The code in that section has now been split off, and placed into `BKE_anim_data.h` and `anim_data.c`. All files that used to include `BKE_animsys.h` have been adjusted to only include the animation headers they need (sometimes none). No functional changes.
2020-04-03Cleanup: Rename ScrArea variables from sa to areaJulian Eisel
Follow up of b2ee1770d4c3 and 10c2254d412d, part of T74432. Now the area and region naming conventions should be less confusing. Mostly a careful batch rename but had to do few smaller fixes. Also ran clang-format on affected files.
2020-03-19Cleanup: `make format` after SortedIncludes changeDalai Felinto
2020-03-06Cleanup: Rename ARegion variables from ar to regionJulian Eisel
The old convention was easy to confuse with ScrArea. Part of https://developer.blender.org/T74432. This is mostly a batch rename with some manual fixing. Only single word variable names are changed, no prefixed/suffixed names. Brecht van Lommel and Campbell Barton both gave me a green light for this convention change. Also ran clan clang format on affected files.
2020-03-06Nodes: Support storing socket link limits in bNodeSocketTypeJacques Lucke
Currently the link limit of sockets is stored in bNodeSocket->limit. This allows for a lot of flexibility, but is also very redundant. In every case I've had to deal with so far, it would have "more correct" to set the link limit per socket type and not per socket. I did not enforce this constraint yet, because the link limit is exposed in the Python API, which I did not want to break here. In the future it might even make sense to only support only three kinds of link limits: a) no links, b) at most one link, c) an arbitrary number links links. The other link limits usually don't work well with tools (e.g. which link should be removed when a new one is connected?) and is not used in practice. However, that is for another day. Eventually, I would like to get rid of bNodeSocket->limit completely and replace it either with fixed link limits or a callback in bNodeSocketType. This patch consists of three parts: **1. Support defining link limit in socket type** This introduces a new `nodeSocketLinkLimit` function that serves as an indirection to hide where the link limit of a socket is defined. **2. Define link limits for builtin sockets on socket type** Data sockets: one input, many outputs Virtual sockets: one input, one output Undefined sockets: many inputs, many outputs (to avoid that links are removed when the type of the socket is not known) **3. Remove `bNodeSocketTemplate->limit`** This wasn't used anymore after the second commit. Removing it simplifies socket definitions in hundreds of places and removes a lot of redundancy. Differential Revision: https://developer.blender.org/D7038 Reviewers: brecht
2020-02-10Cleanup/refactor: Rename `BKE_library` files to `BKE_lib`.Bastien Montagne
Note that `BKE_library.h`/`library.c` were renamed to `BKE_lib_id.h`/`lib_id.c` to avoid having a too generic name here. Part of T72604.
2019-09-26WM: clean up cursors constants and codeBrecht Van Lommel
There was a mix of old and new constants. Now have one list of WM_CURSOR_* cursor types, using GHOST standard cursors when available and otherwise falling back to our custom cursors. Ref D5197
2019-09-07Cleanup: use post increment/decrementCampbell Barton
When the result isn't used, prefer post increment/decrement (already used nearly everywhere in Blender).
2019-06-11Fix/Cleanup: I18N: Bad usage of IFACE_ instead of TIP_.Bastien Montagne
Cheap tip: anything that is not "Camel Case" and/or that is more than a few words long should use `TIP_` translation, not `IFACE_` one. Also added several missing strings (including the one reported in D5056 by Jean First (@robbott), thanks).
2019-04-21Cleanup: comments (long lines) in editorsCampbell Barton
2019-04-17ClangFormat: apply to source, most of internCampbell Barton
Apply clang format as proposed in T53211. For details on usage and instructions for migrating branches without conflicts, see: https://wiki.blender.org/wiki/Tools/ClangFormat
2019-04-09Cleanup: spellingCampbell Barton
2019-03-26Cleanup: style, use braces for editor/spacesCampbell Barton
2019-03-22NodeEditor: Connect Viewer To Socket SelectionJeroen Bakker
Request from the Spring team. When compositing the CTRL-Shift Click on a node cycles the viewnode with an output socket. When you have many render layers you spend time cycling to the desired socket. This patch allows the user to CTRL-Shift Click on a socket to connect directly to that socket. Reviewed By: brecht Maniphest Tasks: T62785 Differential Revision: https://developer.blender.org/D4564
2019-03-16Python API: add Python-defined node groups for shaders and compositing.Miguel Porces
This was already supported for Cycles shader nodes, but now also works for Eevee and compositing nodes. Instead of a generic NodeCustomGroup, now there is ShaderNodeCustomGroup and CompositorNodeCustomGroup that can be subclassed and registered. Differential Revision: https://developer.blender.org/D4370
2019-03-08Cleanup: use plural names for Main listsCampbell Barton
Convention was not to but after discussion on 918941483f7e we agree its best to change the convention. Names now mostly follow RNA. Some exceptions: - Use 'nodetrees' instead of 'nodegroups' since the struct is called NodeTree. - Use 'gpencils' instead of 'grease_pencil' since 'gpencil' is a common abbreviation in the C code. Other exceptions: - Leave 'wm' as it's a list of one. - Leave 'ipo' as is for versioning.
2019-02-18doxygen: add newline after \fileCampbell Barton
While \file doesn't need an argument, it can't have another doxy command after it.