mirror of
https://github.com/GraphiteEditor/Graphite.git
synced 2026-09-25 15:58:11 +08:00
Node network subgraph editing (#1750)
* Breadcrumb visualization, nested network consistency, create definitions for Merge internal nodes * Add index to network inputs, remove imports usage from flatten network * Replace NodeOutput with NodeInput::Node * Fully remove imports field, remove unnecessary identity nodes, move Output node to encapsulating network * Replace previous_outputs with root_node, fix adding artboard/layer to empty network * Import/Export UI nodes * Display input/output types dynamically from compiled network * Add LayerNodeIdentifer::ROOT_PARENT * Prevent .to_node() on ROOT_PARENT * Separate NodeGraphMessage and GraphOperationMessage * General bug fixes with nested networks * Change layer color, various bug fixes and improvements * Fix disconnect and set node input for proto nodes and UI export node * Dashed line to export for previewed node * Fix deleting proto nodes and nodes that feed into export * Allow modifications to nodes outside of nested network * Get network from Node Id parameter * Change root_node to previous_root_node * Get TaggedValue from proto node implementation type when disconnecting * Improve preview functionality and state * Artboard position and delete children fix * Name inputs/outputs based on DocumentNodeDefinition or type, fix new artboard/layer insertion * replace "Link" with "Wire", adjust previewing * Various bug fixes and improvements * Modify Sample and Poisson-Disk points, fix incorrect input index and deleting currently viewed node * Open demo artwork * Fix opening already upgraded documents and refactor FrontendGraphDataType usages * Fix deleting within network and other bugs * Get default node input from compiled network when copying, fix previews, tests, demo artwork * Code cleanup * Hide EditorApi and add a comment describing unresolved Import node input types * Code review * Replace placeholder ROOT_PARENT NodeId with std::u64::MAX * Breadcrumb padding --------- Co-authored-by: Keavon Chambers <keavon@keavon.com>
This commit is contained in:
co-authored by
Keavon Chambers
parent
e4d3faa52a
commit
6d74abb4de
@@ -29,8 +29,8 @@ export class UpdateNodeGraph extends JsMessage {
|
||||
@Type(() => FrontendNode)
|
||||
readonly nodes!: FrontendNode[];
|
||||
|
||||
@Type(() => FrontendNodeLink)
|
||||
readonly links!: FrontendNodeLink[];
|
||||
@Type(() => FrontendNodeWire)
|
||||
readonly wires!: FrontendNodeWire[];
|
||||
}
|
||||
|
||||
export class UpdateNodeTypes extends JsMessage {
|
||||
@@ -54,6 +54,10 @@ export class UpdateOpenDocumentsList extends JsMessage {
|
||||
readonly openDocuments!: FrontendDocumentDetails[];
|
||||
}
|
||||
|
||||
export class UpdateSubgraphPath extends JsMessage {
|
||||
readonly subgraphPath!: string[];
|
||||
}
|
||||
|
||||
export class UpdateZoomWithScroll extends JsMessage {
|
||||
readonly zoomWithScroll!: boolean;
|
||||
}
|
||||
@@ -80,7 +84,7 @@ export class FrontendDocumentDetails extends DocumentDetails {
|
||||
readonly id!: bigint;
|
||||
}
|
||||
|
||||
export type FrontendGraphDataType = "general" | "number" | "raster" | "vector" | "color" | "artboard";
|
||||
export type FrontendGraphDataType = "General" | "Raster" | "VectorData" | "Number" | "Graphic" | "Artboard";
|
||||
|
||||
export class FrontendGraphInput {
|
||||
readonly dataType!: FrontendGraphDataType;
|
||||
@@ -99,9 +103,9 @@ export class FrontendGraphOutput {
|
||||
|
||||
readonly resolvedType!: string | undefined;
|
||||
|
||||
readonly connected!: bigint | undefined;
|
||||
readonly connected!: bigint[];
|
||||
|
||||
readonly connectedIndex!: bigint | undefined;
|
||||
readonly connectedIndex!: bigint[];
|
||||
}
|
||||
|
||||
export class FrontendNode {
|
||||
@@ -133,16 +137,20 @@ export class FrontendNode {
|
||||
readonly unlocked!: boolean;
|
||||
|
||||
readonly errors!: string | undefined;
|
||||
|
||||
readonly uiOnly!: boolean;
|
||||
}
|
||||
|
||||
export class FrontendNodeLink {
|
||||
readonly linkStart!: bigint;
|
||||
export class FrontendNodeWire {
|
||||
readonly wireStart!: bigint;
|
||||
|
||||
readonly linkStartOutputIndex!: bigint;
|
||||
readonly wireStartOutputIndex!: bigint;
|
||||
|
||||
readonly linkEnd!: bigint;
|
||||
readonly wireEnd!: bigint;
|
||||
|
||||
readonly linkEndInputIndex!: bigint;
|
||||
readonly wireEndInputIndex!: bigint;
|
||||
|
||||
readonly dashed!: boolean;
|
||||
}
|
||||
|
||||
export class FrontendNodeType {
|
||||
@@ -935,7 +943,7 @@ export class TextAreaInput extends WidgetProps {
|
||||
export class ParameterExposeButton extends WidgetProps {
|
||||
exposed!: boolean;
|
||||
|
||||
dataType!: string;
|
||||
dataType!: FrontendGraphDataType;
|
||||
|
||||
@Transform(({ value }: { value: string }) => value || undefined)
|
||||
tooltip!: string | undefined;
|
||||
@@ -1335,6 +1343,7 @@ export const messageMakers: Record<string, MessageMaker> = {
|
||||
UpdateOpenDocumentsList,
|
||||
UpdatePropertyPanelOptionsLayout,
|
||||
UpdatePropertyPanelSectionsLayout,
|
||||
UpdateSubgraphPath,
|
||||
UpdateToolOptionsLayout,
|
||||
UpdateToolShelfLayout,
|
||||
UpdateWorkingColorsLayout,
|
||||
|
||||
Reference in New Issue
Block a user