Add support for exposing node parameter inputs (#866)

* Add exposing inputs to graph

* Use uuids and better node positioning

* Fix accidentally refering to the wrong grid spacing

* Secondary input without primary input

* Cleanup document node types

* Rename to input and addend
This commit is contained in:
0HyperCube 2022-11-22 19:57:08 +00:00 committed by Keavon Chambers
parent 0a78ebda25
commit 3dd9e88655
8 changed files with 174 additions and 109 deletions

View file

@ -553,18 +553,7 @@ impl JsEditorHandle {
/// Creates a new document node in the node graph
#[wasm_bindgen(js_name = createNode)]
pub fn create_node(&self, node_type: String) {
fn generate_node_id() -> u64 {
static mut NODE_ID: u64 = 10;
unsafe {
NODE_ID += 1;
NODE_ID
}
}
let message = NodeGraphMessage::CreateNode {
node_id: generate_node_id(),
node_type,
};
let message = NodeGraphMessage::CreateNode { node_id: None, node_type };
self.dispatch(message);
}