Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Stable vector data IDs in the graph #1821

Open
Tracked by #1832
0HyperCube opened this issue Jul 13, 2024 · 1 comment
Open
Tracked by #1832

Stable vector data IDs in the graph #1821

0HyperCube opened this issue Jul 13, 2024 · 1 comment
Labels
Architecture Involves architecture or engineering work or discussion Graphene Involves the node graph system/engine used by Graphite Rust Involves Rust programming for the backend

Comments

@0HyperCube
Copy link
Member

In order to apply the vector modify node on a graphic group, it is necessary to be able to identify which graphic element within the graphic group.

We could do this by index (e.g. modification to graphic element 3 within the graphic group). However @Keavon wants to allow re-arranging the graphic elements without impacting the result.

In order to do this, each graphic element will get an id assigned when creating it. Nodes will be able to get their own id by having the input TaggedValue::MyNodeId (which would be populated during graph pre-processing). In order to avoid cutting and pasting changing the node id (as it does currently) some more logic to check if no such id exists will be added.

Each graphic group must contain unique ids. It is the job of the constructing node to enforce this (e.g. incrementing one of the ids to avoid collision).

@0HyperCube 0HyperCube added Architecture Involves architecture or engineering work or discussion Rust Involves Rust programming for the backend Graphene Involves the node graph system/engine used by Graphite labels Jul 13, 2024
@github-project-automation github-project-automation bot moved this to Short-Term in Task Board Jul 13, 2024
@Keavon Keavon changed the title Stable vector data ids in the graph Stable vector data IDs in the graph Jul 15, 2024
@adamgerhant
Copy link
Collaborator

This is implemented in impl crate::vector::ConcatElement for super::VectorData and pub fn vector_new_ids_from_hash. The Flatten Vector Elements node uses .concat, where the vector data ids are generated from the hash of the input vector id and layer NodeId which that vector passes through. vector_new_ids_from_hash is used by the repeat nodes and follows a similar concept. A better method could be created that does not rely on the layer ids, maybe the Path node id can be used instead.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Architecture Involves architecture or engineering work or discussion Graphene Involves the node graph system/engine used by Graphite Rust Involves Rust programming for the backend
Projects
Status: Short-Term
Development

No branches or pull requests

2 participants