Add the "Type Assertion" node catalog category (#4452)

This commit is contained in:
Keavon Chambers
2026-08-17 23:39:02 -07:00
committed by GitHub
parent 656daa26bc
commit 2df0bd25c3
3 changed files with 5 additions and 5 deletions

View File

@@ -714,21 +714,21 @@ fn random(
// TODO: Test that these are no longer needed in all circumstances, then remove them and add a migration to convert these into Passthrough nodes. Note: these act more as type annotations than as identity functions.
/// Convert a number to an integer of the type u32, which may be the required type for certain node inputs.
#[node_macro::node(name("As u32"), category("Debug"))]
#[node_macro::node(name("As u32"), category("Type Assertion"))]
fn as_u32(_: impl Ctx, value: Item<u32>) -> Item<u32> {
value
}
// TODO: Test that these are no longer needed in all circumstances, then remove them and add a migration to convert these into Passthrough nodes. Note: these act more as type annotations than as identity functions.
/// Convert a number to an integer of the type u64, which may be the required type for certain node inputs.
#[node_macro::node(name("As u64"), category("Debug"))]
#[node_macro::node(name("As u64"), category("Type Assertion"))]
fn as_u64(_: impl Ctx, value: Item<u64>) -> Item<u64> {
value
}
// TODO: Test that these are no longer needed in all circumstances, then remove them and add a migration to convert these into Passthrough nodes. Note: these act more as type annotations than as identity functions.
/// Convert an integer to a decimal number of the type f64, which may be the required type for certain node inputs.
#[node_macro::node(name("As f64"), category("Debug"))]
#[node_macro::node(name("As f64"), category("Type Assertion"))]
fn as_f64(_: impl Ctx, value: Item<f64>) -> Item<f64> {
value
}

View File

@@ -189,7 +189,7 @@ fn string_value(_: impl Ctx, _primary: (), string: Item<TextArea>) -> Item<Strin
}
/// Type-asserts a value to be a string.
#[node_macro::node(category("Debug"))]
#[node_macro::node(category("Type Assertion"))]
fn as_string(_: impl Ctx, value: Item<String>) -> Item<String> {
value
}

View File

@@ -1284,7 +1284,7 @@ async fn dimensions(_: impl Ctx, content: Item<Vector>) -> Item<DVec2> {
}
/// Type-asserts a value to be vector data.
#[node_macro::node(category("Vector"), name("As Vector"), path(core_types::vector))]
#[node_macro::node(category("Type Assertion"), path(core_types::vector))]
fn as_vector(_: impl Ctx, value: Item<Vector>) -> Item<Vector> {
value
}