feat(node): initial leaf / shape nodes
All checks were successful
🚀 Lint & Test & Deploy / release (pull_request) Successful in 4m1s
All checks were successful
🚀 Lint & Test & Deploy / release (pull_request) Successful in 4m1s
This commit is contained in:
6
nodes/max/plantarium/leaf/.gitignore
vendored
Normal file
6
nodes/max/plantarium/leaf/.gitignore
vendored
Normal file
@@ -0,0 +1,6 @@
|
||||
/target
|
||||
**/*.rs.bk
|
||||
Cargo.lock
|
||||
bin/
|
||||
pkg/
|
||||
wasm-pack.log
|
||||
12
nodes/max/plantarium/leaf/Cargo.toml
Normal file
12
nodes/max/plantarium/leaf/Cargo.toml
Normal file
@@ -0,0 +1,12 @@
|
||||
[package]
|
||||
name = "leaf"
|
||||
version = "0.1.0"
|
||||
authors = ["Max Richter <jim-x@web.de>"]
|
||||
edition = "2018"
|
||||
|
||||
[lib]
|
||||
crate-type = ["cdylib", "rlib"]
|
||||
|
||||
[dependencies]
|
||||
nodarium_macros = { version = "0.1.0", path = "../../../../packages/macros" }
|
||||
nodarium_utils = { version = "0.1.0", path = "../../../../packages/utils" }
|
||||
16
nodes/max/plantarium/leaf/src/input.json
Normal file
16
nodes/max/plantarium/leaf/src/input.json
Normal file
@@ -0,0 +1,16 @@
|
||||
{
|
||||
"id": "max/plantarium/leaf",
|
||||
"outputs": [
|
||||
"geometry"
|
||||
],
|
||||
"inputs": {
|
||||
"shape": {
|
||||
"type": "shape",
|
||||
"external": true
|
||||
},
|
||||
"size": {
|
||||
"type": "float",
|
||||
"value": 1
|
||||
}
|
||||
}
|
||||
}
|
||||
13
nodes/max/plantarium/leaf/src/lib.rs
Normal file
13
nodes/max/plantarium/leaf/src/lib.rs
Normal file
@@ -0,0 +1,13 @@
|
||||
use nodarium_macros::nodarium_definition_file;
|
||||
use nodarium_macros::nodarium_execute;
|
||||
use nodarium_utils::{concat_args, log, split_args};
|
||||
|
||||
nodarium_definition_file!("src/input.json");
|
||||
|
||||
#[nodarium_execute]
|
||||
pub fn execute(input: &[i32]) -> Vec<i32> {
|
||||
let args = split_args(input);
|
||||
log!("leaf input: {:?}", input);
|
||||
log!("leaf args: {:?}", args);
|
||||
concat_args(args)
|
||||
}
|
||||
@@ -1,13 +1,10 @@
|
||||
use nodarium_macros::nodarium_definition_file;
|
||||
use nodarium_macros::nodarium_execute;
|
||||
use nodarium_utils::{concat_args, log, split_args};
|
||||
use nodarium_utils::{concat_args, split_args};
|
||||
|
||||
nodarium_definition_file!("src/input.json");
|
||||
|
||||
#[nodarium_execute]
|
||||
pub fn execute(input: &[i32]) -> Vec<i32> {
|
||||
let args = split_args(input);
|
||||
log!("vec3 input: {:?}", input);
|
||||
log!("vec3 args: {:?}", args);
|
||||
concat_args(args)
|
||||
concat_args(split_args(input))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user