Store Metadata as data flows through the graph #2054
Labels
Architecture
Involves architecture or engineering work or discussion
Graphene
Involves the node graph system/engine used by Graphite
The downstream transform to the document for layers (and other nodes) will have to be returned from the render output due to caching not working with monitor nodes (#1946). Monitor nodes cannot be used to get the downstream transforms, since a downstream transform node will not update an upstream cached monitor node. Currently this logic is done when rendering, but this will skip data upstream from destructive operations. This means the best solution is to store a recursive metadata structure for each row in a spread sheet that stores its downstream transforms, and the downstream transforms of all upstream nodes. This means all spreadsheets will need to contain a column for metadata, which will also need to include all upstream metadata (downstream transform to document).
The Path node and Merge node should add their NodeId and an identity matrix to the spreadsheet, and the transform node will continuously modify this transform as it flows through the graph. This means the Footprint is no longer used to calculate the downstream transforms
Monitor nodes can be used to access upstream data though, for example the vector data of a Path node, clip status for the artboard node, etc. This is somewhat blocked by (#2044), but an easy work around could be to insert them in the definition for now.
Transforms on vector data will be stored in a column of type Vec<(NodeId, DAffine)>. Each transform node right (left?) multiplies the last matrix in the vec, and each path node adds a new element to the vec. It is essentially the responsibility of the data type and nodes to provide the vector modify functionality for manipulating the various path nodes. The data cannot be returned from monitor nodes due to caching, as a downstream transform could change without the monitor node being updated. The two solutions to this could be to start execution from the path node, or return the data with the render output. Returning data from the render output means that the path node would store the its vector data in a column of type Vec<(NodeId, VectorData)>When displaying the overlay for vector data inpath_overlays
, the click targets from the first path node are used, but the transform is derived from the layer. The transform should be used as it flows through the monitor node in the path node, not the layer.For example, create a vector with a path, then repeat it. The graphic group has an identity transform, while the vector data stores the full transform. This means the vectorThe best solution is to not return the transform to viewport from the render output as is currently done. Instead, monitor nodes are used to return the transform to document space (downstream transforms * data transform). The downstream transforms are tracked by separating the document to viewport and downstream transforms in the footprint. Then the editor will use the document to viewport transform to calculate the full transform from that monitor node to viewport space (monitor transform * document to viewport). This solves the caching issue since the monitor nodes will only need to return their data when the data changes, not when the document to viewport in the footprint changes.In general, no metadata should be returned from the render output due to its destructive nature.The text was updated successfully, but these errors were encountered: