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-01-11Cleanup: Remove unused "active ID" node flagHans Goudey
The value of this flag was only retrieved in `nodeGetActiveID`, which wasn't used anywhere. Other than that, the `NODE_ACTIVE_ID` and related functions seem to come from the Blender internal renderer. Differential Revision: https://developer.blender.org/D13770
2022-01-10Fix out of bounds memory access displaying the compositor crop gizmoCampbell Barton
Regression from typo in cbca71a7cff394b0c5d670f87f2b480f526ba6dd.
2022-01-09UI: Make uiTemplateNodeLink work for all socket typesAaron Carlisle
Currently the node link ui template only works with a few socket types. This commit addes support for the rest of the socket type declarations. As pointed out in D13776 currently after recent refactors Shader nodes no longer display in the menu. In the future more socket types will be used in the shader nodes and makes the UI template work better for other node trees. Differential Revision: https://developer.blender.org/D13778
2022-01-09Cleanup: Nodes: Begin splitting shader 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 shader nodes into their respected source/blender/nodes/shader/nodes file. In the future, these functions will be simplified to node_layout. Some nodes were left in `drawnode.cc` as this would require duplicating code while this is likely fine it is best to leave that to a seperate commit.
2022-01-08Fix Cycles compile error after last own commitJulian Eisel
We can't include `BLI_utildefines.h` in `RNA_types.h` since Cycles includes that, but duplicates some of the util defines. So you'd have duplicated definitions.
2022-01-08Fix Adjust Last Operation panel showing session UUID number buttonJulian Eisel
This is implementation specific data that should never be exposed to regular users. Also make sure this data is not saved to presets.
2022-01-07Cleanup: remove redundant const qualifiers for POD typesCampbell Barton
MSVC used to warn about const mismatch for arguments passed by value. Remove these as newer versions of MSVC no longer show this warning.
2022-01-06Cleanup: spelling in commentsCampbell Barton
2022-01-06Cleanup: Clang-tidy: modernize-redundant-void-argAaron Carlisle
2021-12-29Nodes: Composite: UI fixes to time nodeAaron Carlisle
- Use default size consistent with other curve nodes - Use column instead of row for properties
2021-12-29Cleanup: Remove dead codeAaron Carlisle
2021-12-28Fix T94408: missing sockets after adding node groupJacques Lucke
2021-12-27Nodes: Support linking to existing group input from link drag search.Jacques Lucke
Before one could only create a new group input using the link drag search. With this patch it becomes possible to create a Group Input node for an existing input. Differential Revision: https://developer.blender.org/D13674
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-24Cleanup: Use vector instead of linked listHans Goudey
2021-12-24Fix T94322: add missing updates after recent refactorJacques Lucke
This was a regression in rB7e712b2d6a0d257d272ed35622b41d06274af8df.
2021-12-24Fix T94357: Node Ungroup operator copies current node treeHans Goudey
This was a mistake in rBfdc4a1a590d8befb1ff which copied the parent node tree into itself rather than accessing the node group's nodes.
2021-12-22Fix: Missing update when toggling node muteHans Goudey
Toggling node mute doesn't cause node trees to reevaluate after rB7e712b2d6a0d257. Toggling a link mute still works though. To fix this, the operator tags the node and node with a new update tag function (that uses an existing tag internally). Differential Revision: https://developer.blender.org/D13653
2021-12-22Nodes: Remove unnecessary node tree socket taggingHans Goudey
`SOCK_IN_USE` is now set in `update_socket_used_tags` in `node_tree_update.cc` when a node tree is changed. It doesn't need to run every single redraw. Removing this results in a small speedup of 0.4 ms when drawing a tree with about 4000 nodes (from about 70 ms total). Differential Revision: https://developer.blender.org/D13645
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-18Fix T94173: Missing update for frame node sizeHans Goudey
Before d56bbfea7b420d7, nodes were updated (size calculated and buttons added) in reverse order. Instead, now calculate the size of frame nodes after all other nodes. Separating the drawing further may be a good step to removing the O(n^2) loop later on.
2021-12-17Allocator: simplify using guarded allocator in C++ codeJacques Lucke
Using the `MEM_*` API from C++ code was a bit annoying: * When converting C to C++ code, one often has to add a type cast on returned `void *`. That leads to having the same type name three times in the same line. This patch reduces the amount to two and removes the `sizeof(...)` from the line. * The existing alternative of using `OBJECT_GUARDED_NEW` looks a out of place compared to other allocation methods. Sometimes `MEM_CXX_CLASS_ALLOC_FUNCS` can be used when structs are defined in C++ code. It doesn't look great but it's definitely better. The downside is that it makes the name of the allocation less useful. That's because the same name is used for all allocations of a type, independend of where it is allocated. This patch introduces three new functions: `MEM_new`, `MEM_cnew` and `MEM_delete`. These cover the majority of use cases (array allocation is not covered). The `OBJECT_GUARDED_*` macros are removed because they are not needed anymore. Differential Revision: https://developer.blender.org/D13502
2021-12-17UI: Fix node socket alignment in some casesAlessio Monti di Sopra
The patch fixes some misalignments in the nodes' sockets/options recently introduced in 26d2caee3ba0, while maintaining the original fix for T92268. The original fix made the top padding always of the same size; while that works when the first row of the other node is `Socket | Socket`, it doesn't for other more common cases, `like Socket | Node Option`, where the text results misaligned. Differential Revision: https://developer.blender.org/D13451
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-15Cleanup: Remove no-op node preview function callsHans Goudey
This patch removes no-op node editor preview code (`PR_NODE_RENDER`) and most calls to `BKE_node_preview_init_tree`. The only remaining call is in the compositor. - Shader nodes previews don't seem to do anything. - In-node previews for the texture node system doesn't work either. This is a first step to refactoring to remove `preview_xsize`, `preview_ysize`, and `prvr` from nodes in DNA, aligned with the general goal of removing runtime/derived data from data structs. Differential Revision: https://developer.blender.org/D13578
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-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: Remove unused argumentsHans Goudey
2021-12-14Cleanup: Remove runtime uiBlock pointer from nodesHans Goudey
Code is simpler when the uiBlocks used during drawing are simply stored in an array. Additionally, looping can be simpler when we use an vector to hold a temporary copy of the tree's linked list of nodes. This patch also slightly changes how uiBlocks are "named" in `node_uiblocks_init`. Now it uses the node name instead of the pointer, which is helpful so we rely less on the node's address. Differential Revision: https://developer.blender.org/D13540
2021-12-13UI: String Search: Add an optional weight parameterHans Goudey
This builds off of rBf951aa063f7, adding a weight parameter which can be used to change the order of items when they have the same match score. In the future, if string searching gets a C++ API, we could use an optional parameter for the weight, since it is not used yet. This will be used for the node link drag search menu (D8286). Differential Revision: https://developer.blender.org/D13559
2021-12-13Cleanup: clang-formatCampbell Barton
2021-12-13Cleanup: Remove includes in node_util.h headerHans Goudey
This ends up including the removed headers in many unnecessary places. Also, remove unnecessary extern from function definitions.
2021-12-11Cleanup: Use const argumentsHans Goudey
Also remove unnecessary function to set a node type's label function that duplicated its definition, and make another function static.
2021-12-10Cleanup: Remove unnecessary runtime rectangle from nodes in DNAHans Goudey
I assume this `butr` rectangle was used more in the past, but currently its value is set and used less than 10 lines apart, so it's trivial to remove 16 bytes from every node. The other rectangles are also runtime data and could be removed, but they are more difficult.
2021-12-09Cleanup: Remove empty node button layout functionAaron Carlisle
Was unused since the first commit: rB658b4c0d56dffbcf1476c2a2a019fa0ecfb79376
2021-12-08Cleanup: Use float2 for node view functionsHans Goudey
Though the interfacing with `rctf` becomes slightly more complicated, this should be more helpful as more of this code usese `float2` instead of two separate floats.
2021-12-08Cleanup: move public doc-strings into headers for 'editors'Campbell Barton
Ref T92709
2021-12-08Cleanup: Clang-Tidy modernize-redundant-void-argAaron Carlisle
2021-12-07Cleanup: Use C++ types for multi input socket sortingHans Goudey
The algorithm used is still quite inefficient, but at least the code is easier to read and a little bit simpler now.
2021-12-07Cleanup: Remove unused includesHans Goudey
2021-12-07Cleanup: Remove unnecessary generic includes from headersHans Goudey
2021-12-06Cleanup: Remove unnecesary node type draw callbackHans Goudey
As a followup to 338c1060d5d7, apply the same change to the node drawing callback. This helps to simplify code when the complexity of a callback isn't necessary right now.
2021-12-06Cleanup: Remove unnecessary node type callbacks for drawingHans Goudey
Currently there are a few callbacks on `bNodeType` that do the same thing for every node type except reroutes and frame nodes. Having a callback for basic things complicates code and makes it harder to understand, and reroutes and frames are special cases in larger way. Arguably frame nodes shouldn't even be drawn like regular nodes, given that it adds a case of O(N^2) looping through all nodes. "Unrolling" the callbacks makes it easier to see what's happening, and therefore easier to optimize. Differential Revision: https://developer.blender.org/D13463
2021-12-04Cleanup: Use LISTBASE_FOREACH macroHans Goudey
2021-12-04Cleanup: Use references in node editor, other improvementsHans Goudey
This helps to tell when a pointer is expected to be null, and avoid overly verbose code when dereferencing. This commit also includes a few other cleanups in this area: - Use const in a few places - Use `float2` instead of `float[2]` - Remove some unnecessary includes and old code The change can be continued further in the future.
2021-12-03Cleanup: Const, use references, C++ typesHans Goudey
Also remove some unnecessary includes
2021-12-03Cleanup: Comments and ordering in node editor headerHans Goudey