Fix for T100521: When creating a node through link drag search, inside a frame node, the created node did not become attached to the frame node.
| before (3.2.2) | after |
Not sure if
ntree.ensure_topology_cache();
is necessary.
Differential D15888
Fix T100521: Node doesn't belong to frame when added through link drag search Authored by Dominik Fill (dominikfill) on Sep 5 2022, 10:29 PM.
Details
Fix for T100521: When creating a node through link drag search, inside a frame node, the created node did not become attached to the frame node.
Not sure if ntree.ensure_topology_cache(); is necessary.
Diff Detail
Event TimelineComment Actions Thanks for the patch! ensure_topology_cache is necessary, since nodes_by_type uses the cache. Comment Actions One thing I noticed about this patch is, that it bases the attachment to the frame node on the position the new node is originally created. I'm not sure that's always the desired behavior since you can still move the node after adding it. Instead of redoing the attachment logic here, we could maybe just call the NODE_OT_translate_attach operator that already handles the frame attachment?
Comment Actions @Leon Schittek (lone_noel) 's approach does work, I'm not yet familiar enough with the intricacies of the nodes code to decide which approach is more desirable... Comment Actions Oh, nice! I'd say @Leon Schittek (lone_noel)'s approach is preferrable since it reuses existing generic behavior. Comment Actions I'm not sure if the frame nodes are sorted, is this taken into account in any way, or can the binding occur not to the top or bottom frame, but to a random one?
Comment Actions Created a new diff with @Leon Schittek (lone_noel) 's suggestion, as I somehow broke git/arcanist/etc and it wouldn't let me update this diff. D15920 | |||||||||||||||||||||||||||