File tree Expand file tree Collapse file tree 1 file changed +8
-2
lines changed
node-graph/gcore/src/vector/vector_data Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change 11use super :: * ;
22use crate :: Ctx ;
3+ use crate :: instances:: Instance ;
34use crate :: uuid:: generate_uuid;
45use bezier_rs:: BezierHandles ;
56use core:: hash:: BuildHasher ;
@@ -424,8 +425,13 @@ impl core::hash::Hash for VectorModification {
424425/// A node that applies a procedural modification to some [`VectorData`].
425426#[ node_macro:: node( category( "" ) ) ]
426427async fn path_modify ( _ctx : impl Ctx , mut vector_data : VectorDataTable , modification : Box < VectorModification > ) -> VectorDataTable {
427- for vector_data_instance in vector_data. instance_mut_iter ( ) {
428- modification. apply ( vector_data_instance. instance ) ;
428+ if vector_data. is_empty ( ) {
429+ vector_data. push ( Instance :: default ( ) ) ;
430+ }
431+ let vector_data_instance = vector_data. get_mut ( 0 ) . expect ( "push should give one item" ) ;
432+ modification. apply ( vector_data_instance. instance ) ;
433+ if vector_data. len ( ) > 1 {
434+ warn ! ( "The path modify ran on {} instances of vector data. Only the first can be modified." , vector_data. len( ) ) ;
429435 }
430436 vector_data
431437}
You can’t perform that action at this time.
0 commit comments