sverchok icon indicating copy to clipboard operation
sverchok copied to clipboard

Preset instantiation have incorrect layout and frame label size

Open DolphinDream opened this issue 3 years ago • 5 comments

When saving a node setup (with frames) as a preset and then instantiating them the layout is messed up. Some nodes do not get created in the proper location. Also the frame label sizes is not preserved. (kept at default value: 20).

Here’s the node tree saved to presets:

SV-NodeTree-Preset-saved

And here’s the instantiated version from the saved preset:

SV-NodeTree-Preset-instantiated

It looks like the nodes not included in the subframes are the ones with the wrong locations.

DolphinDream avatar Mar 27 '21 19:03 DolphinDream

Any ideas what can be done about this? I want to use presets but this bug kinda stands in the way.

DolphinDream avatar Apr 21 '21 17:04 DolphinDream

As far as I understand, you'll have the same problem if you just export such a tree to json and then import it. Correct?

portnov avatar Apr 21 '21 17:04 portnov

@portnov actually nope.. it works fine when exporting/importing json. Though it has a bit of a weird behavior. When importing first it has the frames messed up, but then when I move the mouse eventually they fix themselves. Spooky. Instantiating from presets does not have the same auto correction behavior though.

https://user-images.githubusercontent.com/2083719/115651146-a17f5d80-a2f8-11eb-8a58-2a29c80a5daf.mov

DolphinDream avatar Apr 22 '21 03:04 DolphinDream

if you guys don’t observe this behavior on your systems.. I wonder if it has anything to do with the mac dpi factor correction.. rebuilding the tree from json on import would also have to calculate the location of the nodes / frames taking the dpi factor into account maybe?

DolphinDream avatar Apr 22 '21 03:04 DolphinDream

I have the same behaviour in my computer. It also occurs during converting selected nodes, with frame 'nodes', into a node group. Probably we should call redraw function (if it's possible) of the tree editor after creating frames via Python.

Durman avatar Apr 22 '21 04:04 Durman