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-24BLF: Refactor of DPIHarley Acheson
Correction of U.dpi to hold actual monitor DPI. Simplify font sizing by omitting DPI as API argument, always using 72 internally. See D15961 for more details. Differential Revision: https://developer.blender.org/D15961 Reviewed by Campbell Barton
2022-09-23Fix T101249: Node groups don't show in node searchHans Goudey
bdb57541475f20ccc neglected to add search items for node groups. Luckily adding them is quite simple. However, if the node group is also an asset, it will show up duplicated in the list. To resolve this we avoid adding node groups to the list if they have already been added as assets.
2022-09-23Node Editor: Adjust node link curvingLeon Schittek
Clamp node link curving when the link is close to horizontal to prevent overshooting at the ends. Reviewed By: Pablo Vazquez, Hans Goudey Differential Revision: http://developer.blender.org/D16041
2022-09-22Fix: Use correct node group for add node searchHans Goudey
Similar to e5a7470638803fd, the tree currently being edited should be used for polling and other tests, rather than the node tree at the root of the node editor's path.
2022-09-20Fix T101001: crash setting texture node active in certain casesPhilipp Oeser
Code from {rBb0cb0a785475} assumed a texture node `node->id` would always be an image. That is not true though: - could be an object (as reported here with the Point Density node) - could be a textblock (as in the IES Texture node) Acting on these would crash when doing `BKE_image_signal` on them. Now check node id is an image and do nothing otherwise. Also check if an image is actually set in these nodes (if none is, the Image Editor is now also untouched, previously the image in the Image Editor was "cleared" here [set to NULL] -- which does not seems very beneficial) Maniphest Tasks: T101001 Differential Revision: https://developer.blender.org/D15943
2022-09-19Nodes: Add node group assets to search menusHans Goudey
Currently node group assets are supported, but using them by dragging from the asset browser is cumbersome. This patch adds all node group assets from user asset libraries and the current file libraries to the add node search menu and the link drag search menu. Node groups added through the search will have their "options" hidden, meaning the data-block selector is displayed. This helps keep the UI clean, and the selector shouldn't be necessary anyway. To make that possible, metadata like the node tree type and its inputs and outputs has to be saved in the file. This requires re-saving the files that contain the assets with the patch applied. The node add search operator is moved from Python to C++ to ease development and allow more flexibility. It supports a tooltip that gives the description of assets. Currently the node groups are added with the asset system's existing "Append & Reuse" behavior. It's likely that linking should be possible in the future too, but for now the idea is to use the more foolproof option that doesn't create dependencies between files. Because loading assets can potentially take a long time, the search menu refreshes its items as new assets are loaded. However, changing the search field is necessary to see the update. Differential Revision: https://developer.blender.org/D15568
2022-09-19Cleanup: spellingCampbell Barton
2022-09-18Fix: Make node position consistent when added through link drag searchLeon Schittek
The node position is specified in the coordinate space of the node editor. The cursor position has to be divided by `UI_DPI_FAC` since it's in view space but the offset is independent of any ui scaling. Reviewed By: Hans Goudey Differential Revision: http://developer.blender.org/D16006
2022-09-17Geometry Nodes: use stringref instead of string in loggerJacques Lucke
This reduces logging overhead. The performance difference is only significant when there are many fast nodes. In my test file with many math nodes, the performance improved from 720ms to 630ms.
2022-09-16Cleanup: spelling in commentsCampbell Barton
2022-09-14Fix T100959: Memory leak when moving node with AltGermano Cavalcante
The memory leak happens because `ED_node_link_insert` (called after the transform operation) overwrites the pre-existing `snode->runtime->iofsd`, losing the reference without freeing the memory. So to "move" the reference from `snode->runtime->iofsd` to `op->customdata`, so that each operator works with its own data. Reviewed By: Severin Differential Revision: https://developer.blender.org/D15948
2022-09-13Geometry Nodes: new evaluation systemJacques Lucke
This refactors the geometry nodes evaluation system. No changes for the user are expected. At a high level the goals are: * Support using geometry nodes outside of the geometry nodes modifier. * Support using the evaluator infrastructure for other purposes like field evaluation. * Support more nodes, especially when many of them are disabled behind switch nodes. * Support doing preprocessing on node groups. For more details see T98492. There are fairly detailed comments in the code, but here is a high level overview for how it works now: * There is a new "lazy-function" system. It is similar in spirit to the multi-function system but with different goals. Instead of optimizing throughput for highly parallelizable work, this system is designed to compute only the data that is actually necessary. What data is necessary can be determined dynamically during evaluation. Many lazy-functions can be composed in a graph to form a new lazy-function, which can again be used in a graph etc. * Each geometry node group is converted into a lazy-function graph prior to evaluation. To evaluate geometry nodes, one then just has to evaluate that graph. Node groups are no longer inlined into their parents. Next steps for the evaluation system is to reduce the use of threads in some situations to avoid overhead. Many small node groups don't benefit from multi-threading at all. This is much easier to do now because not everything has to be inlined in one huge node tree anymore. Differential Revision: https://developer.blender.org/D15914
2022-09-13Nodes: Avoid unnecessary sorting when selecting or moving nodesHans Goudey
Previously the nodes were sorted wven when there was no change. This is a fixed version of e3ef6a6660032ca18, which was reverted by dc937c5aee4532.
2022-09-13Fix: Node edge pan and remove on cancel doesn't workHans Goudey
Caused by 4a71765f9a41 which used an operator that didn't have the properties it expected.
2022-09-10Cleanup: replace strncpy with BLI_strncpyCampbell Barton
Also replace strncpy+strcat with BLI_string_join
2022-09-09Fix Auto-offset for nodes: Revert "Cleanup: Return early"Dalai Felinto
This "cleanup" commit broke Auto-offset for nodes. This reverts commit e3ef6a6660032ca18af53dd24cd19bf36e56a85c.
2022-09-09Fix T100521: Nodes added with link drag search not added to frameDominik Fill
Use macro NODE_OT_translate_attach for attaching node created through link-drag-search to frame, as suggested by Leon Schittek (@lone_noel) in D15888. Differential Revision: https://developer.blender.org/D15920
2022-09-08Fix: link drag search feature only works forgeometry nodes groupsHans Goudey
The node tree used to detect if the tree was a node group wasn't the last in the node editor's path like it should be, so the search thought that all shader node groups weren't node groups.
2022-09-06Cleanup: Return earlyHans Goudey
2022-09-06Cleanup: Avoid using runtime node flag, use topology cacheHans Goudey
It's easier to keep track of state in these algorithms if it's stored in a central place like a set. Plus, using flags requires clearing them beforehand. For the selected linked operators, using the topology cache means we don't have to iterate over all links.
2022-09-06Cleanup: Move select all nodes code to operatorHans Goudey
This more specific high level functionality isn't needed elsewhere. Move it to the operator and clean it up a bit.
2022-09-06Cleanup: Use more specific function for deselecting all nodesHans Goudey
2022-09-06Fix T100841: Creating a frame node with shortcut doesn't sort nodesHans Goudey
Before 58c650a44c25, the nodes span was rebuilt on every redraw. Now that it's only rebuilt as necessary, we need to tag it dirty when nodes are reordered. Relying on the order of the nodes at all isn't ideal, but it's fairly fundamental in many areas at the moment.
2022-09-06Cleanup: Remove unnecessary node sorting, rename variablesHans Goudey
Changing node colors shouldn't change the output of `node_sort`.
2022-09-06Cleanup: spelling in comments, formatting, move comments into headersCampbell Barton
2022-09-05GPU: convert 'GPU_SHADER_2D_IMAGE_COLOR' to 3DGermano Cavalcante
3D shaders work in both 2D and 3D viewports. This shader is a good candidate to be exposed in Python.
2022-09-05GPU: remove 'GPU_SHADER_2D_UNIFORM_COLOR'Germano Cavalcante
The only real difference between `GPU_SHADER_2D_UNIFORM_COLOR` and `GPU_SHADER_3D_UNIFORM_COLOR` is that in the vertex shader the 2D version uses `vec4(pos, 0.0, 1.0)` and the 3D version uses `vec4(pos, 1.0)`. But VBOs with 2D attributes work perfectly in shaders that use 3D attributes. Components not specified are filled with components from `vec4(0.0, 0.0, 0.0, 1.0)`. So there is no real benefit to having two different shader versions. This will simplify porting shaders to python as it will not be necessary to use a 3D and a 2D version of the shaders. In python the new name for '2D_UNIFORM_COLOR'' and '3D_UNIFORM_COLOR' is 'UNIFORM_COLOR', but the old names still work for backward compatibility. Differential Revision: https://developer.blender.org/D15836
2022-09-05Cleanup: make formatBrecht Van Lommel
2022-09-05IDMAnagement: Add owner ID pointer to embedded ones.Bastien Montagne
Add a dedicated `owner_id` pointer to ID types that can be embedded (Collections and NodeTrees), and modify slightly come code to make handling those more safe and consistent. This implements first part of T69169. Reviewed By: brecht Differential Revision: https://developer.blender.org/D15838
2022-09-04Cleanup: Clarify multi-socket input sortingHans Goudey
The multi-socket input sorting was used for two purposes: moving links to the proper positions when dragging a new link, and resetting the multi-input indices on the links when removing a link. They are now separated into two functions, and the sorting when making a group node that didn't accomplish anything is removed (in that case a proper implementation would copy the indices from the original exterior sockets).
2022-09-04Cleanup: Replace recursive quadratic node link mute operationHans Goudey
The previous implementation iterated over all links multiple times recursively. Instead, use the node tree topology cache, only iterate over all links once, and use a stack to propagate the mute upsteam and downstream.
2022-09-03Cleanup: Deduplicate node link intersection testHans Goudey
2022-09-03Cleanup: Refactor node add reroute operatorHans Goudey
Use C++ Map that supports the duplication natively. Use vectors instead of linked lists, and adjust naming. Also remove combination of reroutes for input sockets, which doesn't make sense since a reroute isn't allowed to combine multiple input links into one output.
2022-09-03Cleanup: Return earlyHans Goudey
2022-09-03Cleanup: use more standard variable name for node socketsHans Goudey
2022-09-03Cleanup: Use separate variables for node socket locationsHans Goudey
This will help if the locations are moved out of DNA and require slightly more complicated access.
2022-09-03Cleanup: Avoid using node socket locationHans Goudey
The location of a reroute node and its sockets should be the same, only stored in different coordinate spaces. Because the node's location is the ground truth, use that for finding whether the mouse is hovering.
2022-09-03Cleanup: Use references and const in node editorHans Goudey
2022-09-03Cleanup: Use new node topology cache for sorting multi input socketsHans Goudey
Assuming the cost of building the cache is ammortized, this may be be helpful because it removes some quadratic behavior.
2022-09-03Cleanup: Return earlyHans Goudey
2022-09-02Merge branch 'blender-v3.3-release'Hans Goudey
2022-09-02Fix T100767: Geometry nodes viewer node placed incorrectlyHans Goudey
See explanation in comment. Differential Revision: https://developer.blender.org/D15864
2022-09-02Cleanup: Deduplicate node link points evaluation functionsHans Goudey
2022-09-02Cleanup: Further split of node link Bezier calculation functionHans Goudey
Now dragged handles are handled separately, and the function returns a statically sized array by value. The functions are also renamed to be more consistent with curve naming elsewhere in Blender.
2022-09-02Fix: Ensure topology cache exists when drawing nodesHans Goudey
This was missed in 58c650a44c251a41c89375d697efdf07153016e0.
2022-09-02Cleanup: Split node link draw culling to separate functionHans Goudey
This was only really used in one place, so better to just do it there rather than requiring another argument for the handle calculation.
2022-09-02Cleanup: Return earlyHans Goudey
2022-09-02Cleanup: Remove unnecessary struct keyword usage in node editorHans Goudey
2022-09-02Cleanup: Remove unused structHans Goudey
Unused after 217d0a15243d12da070e8a68c2603bab73be2164
2022-09-02Cleanup: Use C++ vector types in node editorHans Goudey