parent
258748ec51
commit
da278e0264
|
|
@ -2043,7 +2043,7 @@ fn document_node_definitions() -> HashMap<DefinitionIdentifier, DocumentNodeDefi
|
|||
input_metadata: vec![
|
||||
("Content", "TODO").into(),
|
||||
InputMetadata::with_name_description_override(
|
||||
"Separation Disk Diameter",
|
||||
"Separation",
|
||||
"TODO",
|
||||
WidgetOverride::Number(NumberInputSettings {
|
||||
min: Some(0.01),
|
||||
|
|
|
|||
|
|
@ -1350,6 +1350,23 @@ async fn instance_map(ctx: impl Ctx + CloneVarArgs + ExtractAll, content: Table<
|
|||
rows.into_iter().collect()
|
||||
}
|
||||
|
||||
#[node_macro::node(category("Vector"), path(graphene_core::vector))]
|
||||
async fn map_points(ctx: impl Ctx + CloneVarArgs + ExtractAll, content: Table<Vector>, mapped: impl Node<Context<'static>, Output = DVec2>) -> Table<Vector> {
|
||||
let mut content = content;
|
||||
let mut index = 0;
|
||||
|
||||
for row in content.iter_mut() {
|
||||
for (_, position) in row.element.point_domain.positions_mut() {
|
||||
let owned_ctx = OwnedContextImpl::from(ctx.clone()).with_index(index).with_position(*position);
|
||||
index += 1;
|
||||
|
||||
*position = mapped.eval(owned_ctx.into_context()).await;
|
||||
}
|
||||
}
|
||||
|
||||
content
|
||||
}
|
||||
|
||||
#[node_macro::node(category("Vector"), path(graphene_core::vector))]
|
||||
async fn flatten_path<T: 'n + Send>(
|
||||
_: impl Ctx,
|
||||
|
|
|
|||
Loading…
Reference in New Issue