Skip to content

Conversation

@Looooong
Copy link
Contributor

@Looooong Looooong commented Sep 26, 2022

Behaviour:

  • The subgraph can be processed without affecting the original graph.
  • Both the subgraph and the original graph are processed correctly with their own given parameters.
  • Both graphs' internal states, inputs and outputs are separated from each other.

Solution:

  • The subgraph is cloned using Instantiate.
  • The subgraph's exposed parameters are cloned using Clone.
  • The subgraph's output render textures are cloned using Instantiate.
  • The subgraph's output render textures are named exactly like the original textures. This ensures that output textures can be looked up by name.
  • Every CustomRenderTexture output ports in all nodes are marked as System.NonSerializable. This ensures the the cloned subgraph doesn't hold CustomRenderTexture references of the original graph.
  • Material in ShaderNode and OutputTextureSettings is cloned using Instantiate for the same reason.

@Looooong Looooong marked this pull request as draft September 28, 2022 17:52
@Looooong Looooong force-pushed the feature/subgraph-node branch from b424e75 to 36fe65a Compare September 28, 2022 18:27
@Looooong Looooong marked this pull request as ready for review September 28, 2022 18:28
@Looooong Looooong marked this pull request as draft September 28, 2022 19:54
@Looooong Looooong force-pushed the feature/subgraph-node branch 2 times, most recently from 9f55916 to 1160873 Compare October 7, 2022 18:14
@Looooong Looooong marked this pull request as ready for review October 7, 2022 18:24
@Looooong Looooong marked this pull request as draft November 22, 2022 19:03
@Looooong Looooong force-pushed the feature/subgraph-node branch from 1160873 to 501c00c Compare November 23, 2022 11:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant