Skip to content

Allow input nodes inside groups to be randomised#47

Merged
ruaridhg merged 7 commits intomainfrom
smg/node-groups
May 11, 2023
Merged

Allow input nodes inside groups to be randomised#47
ruaridhg merged 7 commits intomainfrom
smg/node-groups

Conversation

@sfmig
Copy link
Copy Markdown
Collaborator

@sfmig sfmig commented May 2, 2023

Input nodes are defined as nodes in the graph with no input sockets. The input nodes to randomise are identified because their name is prefixed with a prefix (typically 'random', case insensitive).

With this PR both independent nodes, and nodes inside a group are searched. The 'artificial' nodes that show up inside a node group, usually named 'Group input' or 'Group output' are excluded from the search.

Will close #8

@sfmig sfmig requested a review from ruaridhg May 10, 2023 14:27
@sfmig sfmig marked this pull request as ready for review May 10, 2023 14:33
@sfmig
Copy link
Copy Markdown
Collaborator Author

sfmig commented May 10, 2023

One potential problem with this PR as it is (probably good to discuss tomorrow with @tdowrick):

  • when a node is copied, in practice we are creating a new pointer to the original node.
  • If you copy a node and paste it in a new material, the values to randomise will point to the ones in the original node, but the min/max values to randomise between will be independent of the original node....
  • I understand that this is actually a likely scenario right? If so, I'd suggest to fix it in a new PR

@sfmig sfmig requested a review from tdowrick May 10, 2023 14:38
Comment thread randomiser/material/operators.py
Copy link
Copy Markdown
Collaborator

@ruaridhg ruaridhg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, there may be a repeated for loop in operators that is redundant but looks sensible apart from that

@sfmig sfmig requested a review from ruaridhg May 11, 2023 09:16
Copy link
Copy Markdown
Collaborator

@ruaridhg ruaridhg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@ruaridhg ruaridhg merged commit 3a86d93 into main May 11, 2023
@ruaridhg ruaridhg deleted the smg/node-groups branch September 20, 2023 15:28
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.

Add functionality for node groups

2 participants