Open lfnoise opened 3 years ago
Also creating a cycle in the graph causes an infinite loop in dfs_traverse. I made a cycle of two 'sine' blocks feeding back with one of them also connected to the output node. sine1 -> sine2 -> both sine1 and output r I assume it should be up to user code (or in this case, the example code) to prevent fan-in and cycle connections if they will crash the evaluator?
Just added https://github.com/sonoro1234/LuaJIT-ImGui/blob/master/examples/imnodes_graph_sample.lua to LuaJIT-ImGui
Avoids more than one input for input pin and allows cycles (detected as graph node already visited in dfs but still without calculated output) taking the value produced in previous dfs for that node. Also takes care of saving and reloading.
Thanks for reporting this @lfnoise . The examples should handle these situations a bit better.
assert(value_stack.size() == 3ull);
fails if you connect two wires to one input. It leaves an extra value on the stack.One possible recreation is to create 3 boxes: sine, sine and output. and connect both sine outputs to the 'r' input of 'output'. But any other connection of two outputs to an input failed for me as well.