Skip to content

Commit

Permalink
Implement initial support for *Graph Editor*.
Browse files Browse the repository at this point in the history
  • Loading branch information
KelSolaar committed Jan 3, 2025
1 parent dbda4a1 commit 6b536bd
Show file tree
Hide file tree
Showing 10 changed files with 39,345 additions and 1,114 deletions.
1,784 changes: 694 additions & 1,090 deletions colour_hdri/examples/examples_advanced_processing_with_the_nodegraph.ipynb

Large diffs are not rendered by default.

942 changes: 942 additions & 0 deletions colour_hdri/network/graph_editor.py

Large diffs are not rendered by default.

41 changes: 41 additions & 0 deletions colour_hdri/network/graphs.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
ExecutionNode,
ParallelForMultiprocess,
PortGraph,
notify_process_state,
)

from colour_hdri.generation import double_sigmoid_anchored_function
Expand Down Expand Up @@ -244,6 +245,11 @@ def __init__(self, *args: Any, **kwargs: Any) -> None:
output_port,
)

self.connect(
"execution_input",
self.nodes["ConvertRawFileToDNGFile"],
"execution_input",
)
self.connect(
"raw_file_path",
self.nodes["ConvertRawFileToDNGFile"],
Expand Down Expand Up @@ -330,6 +336,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None:
"path",
)

@notify_process_state
def process(self, **kwargs: Any) -> None:
"""
Process the node-graph.
Expand Down Expand Up @@ -536,6 +543,11 @@ def __init__(self, *args: Any, **kwargs: Any) -> None:
output_port,
)

self.connect(
"execution_input",
self.nodes["ConvertRawFileToDNGFile"],
"execution_input",
)
self.connect(
"raw_file_path",
self.nodes["ConvertRawFileToDNGFile"],
Expand Down Expand Up @@ -627,6 +639,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None:
"path",
)

@notify_process_state
def process(self, **kwargs: Any) -> None:
"""
Process the node-graph.
Expand Down Expand Up @@ -736,6 +749,11 @@ def __init__(self, *args: Any, **kwargs: Any) -> None:
output_port,
)

self.connect(
"execution_input",
self.nodes["CreateImageStack"],
"execution_input",
)
self.connect(
"exr_file_paths",
self.nodes["CreateImageStack"],
Expand Down Expand Up @@ -782,6 +800,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None:
"path",
)

@notify_process_state
def process(self, **kwargs: Any) -> None:
"""
Process the node-graph.
Expand Down Expand Up @@ -866,6 +885,10 @@ def __init__(self, *args: Any, **kwargs: Any) -> None:
self.add_node(node)

for connection in [
(
("NormaliseExposure", "execution_output"),
("ParallelForMultiprocess", "execution_input"),
),
(
("ParallelForMultiprocess", "loop_output"),
("WritePreviewImage", "execution_input"),
Expand All @@ -882,6 +905,11 @@ def __init__(self, *args: Any, **kwargs: Any) -> None:
output_port,
)

self.connect(
"execution_input",
self.nodes["NormaliseExposure"],
"execution_input",
)
self.connect(
"array",
self.nodes["NormaliseExposure"],
Expand Down Expand Up @@ -916,6 +944,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None:
"task", _task_multiprocess_post_merge_hdr
)

@notify_process_state
def process(self, **kwargs: Any) -> None:
"""
Process the node-graph.
Expand Down Expand Up @@ -991,6 +1020,11 @@ def __init__(self, *args: Any, **kwargs: Any) -> None:
output_port,
)

self.connect(
"execution_input",
self.nodes["CreateBatches"],
"execution_input",
)
self.connect(
"array",
self.nodes["CreateBatches"],
Expand Down Expand Up @@ -1043,6 +1077,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None:
"results", self.nodes["GraphPostMergeHDRI"], "array"
)

@notify_process_state
def process(self, **kwargs: Any) -> None:
"""
Process the node-graph.
Expand Down Expand Up @@ -1162,6 +1197,11 @@ def __init__(self, *args: Any, **kwargs: Any) -> None:
output_port,
)

self.connect(
"execution_input",
self.nodes["ParallelForMultiprocess"],
"execution_input",
)
self.connect(
"array",
self.nodes["ParallelForMultiprocess"],
Expand Down Expand Up @@ -1274,6 +1314,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None:
"Watermark"
].set_input("include_exposure_information", False)

@notify_process_state
def process(self, **kwargs: Any) -> None:
"""
Process the node-graph.
Expand Down
Loading

0 comments on commit 6b536bd

Please sign in to comment.