New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Save/Load nodes and links to json #141
Comments
Hi, did you looked at blueprint example? Callback are called after node state change and you can save it. To restore previous state you can call imgui-node-editor/examples/blueprints-example/blueprints-example.cpp Lines 498 to 520 in 687a72f
Save/Restore state is clunky, but is getting job done. Next version may improve on the API. |
Personally , I used a third party json serializer (nlohmann json). It allows me to save/process arbitrary data , including new fields for my specific application , and without touching to the node library . |
Hi, yes i did
Thank you for explanation, i tried to save and restore in blueprint example using the buttons, but it save and store only the location of the node. But I need saving the whole state of all nodes,links,pins to json, then i close the program and after i start the program i want to restore all this nodes, links, pins and so on to it's state before i close the program!!! Could you please explain me how to achieve this approach? or maybe there is a code example? Thank you |
Hi, thank you for reply! is it possible to achieve the goal i posted above with nlohmann? If so could you share the example please ? Actually i strongly want to be able to make the save/restore option using the original NodeEditor without third parties libs... |
Dear, @thedmd please help me to make File-> save/ File-> Load. I want to be able to save/load the whole node-editor project (with all nodes, links,pins). It is very important to me and i couldn't release it without this feature. Thank you very much!!!! |
Node Editor does not hold more that than returned by callbacks. Saving and loading state of your data is not in the scope of this project, rather something you need to have on your side. Blueprint example show how one can build an editor and provide mock data that is generated on the fly. On To save/load data internally, I'm using Save data format is considered implementation detail and may change one day. Data was never guaranteed to be in json format. At this point however it is very unlikely this will ever change due to backward compatibility. |
@thedmd And hope to see the official implementation of save/load feature P.S. |
Wow, it's completly different technic in compare with the first blueprints example.
Thank you one more time for an excellent tool you made for public!!!! |
Original blueprint example hold answers to both of your question. Code drawing custom looking nodes is there. |
Hi, dear community! Could anybody please help me to find out how to make a save/load logic for all nodes and links to/from json., It would be great to see a code sample and any advices would be appreciated!!! Thank you very much
The text was updated successfully, but these errors were encountered: