Add the first field-based nodes: 'Instance on Points', 'Instance Position', 'Instance Index', as well as 'Grid' (#2574)

* Basic fields

* Add 'Extract XY' and 'Split Vector2' nodes

* Add 'Instance Index' node

* Fix test again

* Improve grid generator to support rectangular as well

* Avoid crashing

---------

Co-authored-by: Keavon Chambers <keavon@keavon.com>
This commit is contained in:
James Lindsay
2025-04-16 12:58:59 +01:00
committed by GitHub
parent 184c009f17
commit 435a6daf25
12 changed files with 515 additions and 26 deletions

View File

@@ -328,6 +328,15 @@ impl OwnedContextImpl {
self.animation_time = Some(animation_time);
self
}
pub fn with_vararg(mut self, value: Box<dyn Any + Send + Sync>) -> Self {
assert!(self.varargs.is_none_or(|value| value.is_empty()));
self.varargs = Some(Arc::new([value]));
self
}
pub fn with_index(mut self, index: usize) -> Self {
self.index = Some(index);
self
}
pub fn into_context(self) -> Option<Arc<Self>> {
Some(Arc::new(self))
}