Age | Commit message (Collapse) | Author |
|
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
|
|
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.
|
|
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
|
|
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.
|
|
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
|
|
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
|
|
|
|
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
|
|
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.
|
|
|
|
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
|
|
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
|
|
Previously the nodes were sorted wven when there was no change.
This is a fixed version of e3ef6a6660032ca18, which was reverted by
dc937c5aee4532.
|
|
Caused by 4a71765f9a41 which used an operator that didn't have the
properties it expected.
|
|
Also replace strncpy+strcat with BLI_string_join
|
|
This "cleanup" commit broke Auto-offset for nodes.
This reverts commit e3ef6a6660032ca18af53dd24cd19bf36e56a85c.
|
|
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
|
|
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.
|
|
|
|
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.
|
|
This more specific high level functionality isn't needed
elsewhere. Move it to the operator and clean it up a bit.
|
|
|
|
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.
|
|
Changing node colors shouldn't change the output of `node_sort`.
|
|
|
|
3D shaders work in both 2D and 3D viewports.
This shader is a good candidate to be exposed in Python.
|
|
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
|
|
|
|
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
|
|
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).
|
|
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.
|
|
|
|
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.
|
|
|
|
|
|
This will help if the locations are moved out of DNA
and require slightly more complicated access.
|
|
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.
|
|
|
|
Assuming the cost of building the cache is ammortized, this
may be be helpful because it removes some quadratic behavior.
|
|
|
|
|
|
See explanation in comment.
Differential Revision: https://developer.blender.org/D15864
|
|
|
|
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.
|
|
This was missed in 58c650a44c251a41c89375d697efdf07153016e0.
|
|
This was only really used in one place, so better to just do it there
rather than requiring another argument for the handle calculation.
|
|
|
|
|
|
Unused after 217d0a15243d12da070e8a68c2603bab73be2164
|
|
|