@@ -8,16 +8,17 @@ use bezier_rs::Subpath;
88use graph_craft:: concrete;
99use graph_craft:: document:: value:: TaggedValue ;
1010use graph_craft:: document:: { NodeId , NodeInput } ;
11- use graphene_core:: raster:: { BlendMode , ImageFrame } ;
11+ use graphene_core:: raster:: image:: { ImageFrame , ImageFrameTable } ;
12+ use graphene_core:: raster:: BlendMode ;
1213use graphene_core:: text:: { Font , TypesettingConfig } ;
1314use graphene_core:: vector:: brush_stroke:: BrushStroke ;
1415use graphene_core:: vector:: style:: { Fill , Stroke } ;
1516use graphene_core:: vector:: { PointId , VectorModificationType } ;
1617use graphene_core:: { Artboard , Color } ;
18+ use graphene_std:: vector:: { VectorData , VectorDataTable } ;
19+ use graphene_std:: GraphicGroupTable ;
1720
1821use glam:: { DAffine2 , DVec2 , IVec2 } ;
19- use graphene_std:: vector:: VectorData ;
20- use graphene_std:: GraphicGroup ;
2122
2223#[ derive( PartialEq , Clone , Copy , Debug , serde:: Serialize , serde:: Deserialize ) ]
2324pub enum TransformIn {
@@ -125,8 +126,8 @@ impl<'a> ModifyInputsContext<'a> {
125126 /// Creates an artboard as the primary export for the document network
126127 pub fn create_artboard ( & mut self , new_id : NodeId , artboard : Artboard ) -> LayerNodeIdentifier {
127128 let artboard_node_template = resolve_document_node_type ( "Artboard" ) . expect ( "Node" ) . node_template_input_override ( [
128- Some ( NodeInput :: value ( TaggedValue :: ArtboardGroup ( graphene_std:: ArtboardGroup :: EMPTY ) , true ) ) ,
129- Some ( NodeInput :: value ( TaggedValue :: GraphicGroup ( graphene_core:: GraphicGroup :: EMPTY ) , true ) ) ,
129+ Some ( NodeInput :: value ( TaggedValue :: ArtboardGroup ( graphene_std:: ArtboardGroup :: default ( ) ) , true ) ) ,
130+ Some ( NodeInput :: value ( TaggedValue :: GraphicGroup ( graphene_core:: GraphicGroupTable :: default ( ) ) , true ) ) ,
130131 Some ( NodeInput :: value ( TaggedValue :: IVec2 ( artboard. location ) , false ) ) ,
131132 Some ( NodeInput :: value ( TaggedValue :: IVec2 ( artboard. dimensions ) , false ) ) ,
132133 Some ( NodeInput :: value ( TaggedValue :: Color ( artboard. background ) , false ) ) ,
@@ -138,7 +139,7 @@ impl<'a> ModifyInputsContext<'a> {
138139
139140 pub fn insert_boolean_data ( & mut self , operation : graphene_std:: vector:: misc:: BooleanOperation , layer : LayerNodeIdentifier ) {
140141 let boolean = resolve_document_node_type ( "Boolean Operation" ) . expect ( "Boolean node does not exist" ) . node_template_input_override ( [
141- Some ( NodeInput :: value ( TaggedValue :: GraphicGroup ( graphene_std:: GraphicGroup :: EMPTY ) , true ) ) ,
142+ Some ( NodeInput :: value ( TaggedValue :: GraphicGroup ( graphene_std:: GraphicGroupTable :: default ( ) ) , true ) ) ,
142143 Some ( NodeInput :: value ( TaggedValue :: BooleanOperation ( operation) , false ) ) ,
143144 ] ) ;
144145
@@ -148,7 +149,7 @@ impl<'a> ModifyInputsContext<'a> {
148149 }
149150
150151 pub fn insert_vector_data ( & mut self , subpaths : Vec < Subpath < PointId > > , layer : LayerNodeIdentifier , include_transform : bool , include_fill : bool , include_stroke : bool ) {
151- let vector_data = VectorData :: from_subpaths ( subpaths, true ) ;
152+ let vector_data = VectorDataTable :: new ( VectorData :: from_subpaths ( subpaths, true ) ) ;
152153
153154 let shape = resolve_document_node_type ( "Path" )
154155 . expect ( "Path node does not exist" )
@@ -213,9 +214,10 @@ impl<'a> ModifyInputsContext<'a> {
213214
214215 pub fn insert_image_data ( & mut self , image_frame : ImageFrame < Color > , layer : LayerNodeIdentifier ) {
215216 let transform = resolve_document_node_type ( "Transform" ) . expect ( "Transform node does not exist" ) . default_node_template ( ) ;
216- let image = resolve_document_node_type ( "Image" )
217- . expect ( "Image node does not exist" )
218- . node_template_input_override ( [ Some ( NodeInput :: value ( TaggedValue :: None , false ) ) , Some ( NodeInput :: value ( TaggedValue :: ImageFrame ( image_frame) , false ) ) ] ) ;
217+ let image = resolve_document_node_type ( "Image" ) . expect ( "Image node does not exist" ) . node_template_input_override ( [
218+ Some ( NodeInput :: value ( TaggedValue :: None , false ) ) ,
219+ Some ( NodeInput :: value ( TaggedValue :: ImageFrame ( ImageFrameTable :: new ( image_frame) ) , false ) ) ,
220+ ] ) ;
219221
220222 let image_id = NodeId :: new ( ) ;
221223 self . network_interface . insert_node ( image_id, image, & [ ] ) ;
@@ -289,7 +291,7 @@ impl<'a> ModifyInputsContext<'a> {
289291 // TODO: Allow the path node to operate on Graphic Group data by utilizing the reference for each vector data in a group.
290292 if node_definition. identifier == "Path" {
291293 let layer_input_type = self . network_interface . input_type ( & InputConnector :: node ( output_layer. to_node ( ) , 1 ) , & [ ] ) . 0 . nested_type ( ) ;
292- if layer_input_type == concrete ! ( GraphicGroup ) {
294+ if layer_input_type == concrete ! ( GraphicGroupTable ) {
293295 let Some ( flatten_vector_elements_definition) = resolve_document_node_type ( "Flatten Vector Elements" ) else {
294296 log:: error!( "Flatten Vector Elements does not exist in ModifyInputsContext::existing_node_id" ) ;
295297 return None ;
0 commit comments