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

Graph Editor: Improve Add Node Workflow #2157

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

beersandrew
Copy link
Contributor

Addressing #1542 . This PR is a draft as I have some open questions remaining, listed below

- Allow for creating a node from dragging off of a pin
- Filter nodes based on the pinFilterType and the type of the node
- Display a label to let the user know a node will be created on mouse release
- used consistent parenthesis
@@ -3718,7 +3720,8 @@ void Graph::addNodePopup(bool cursor)
// Allow spaces to be used to search for node names
std::replace(subs.begin(), subs.end(), ' ', '_');

if (str.find(subs) != std::string::npos)
if ((subs.size() == 0 || str.find(subs) != std::string::npos) &&
(_menuFilterType == mx::EMPTY_STRING || node.getType() == _menuFilterType))
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Is this the correct filtering logic? It does filter properly however I'm not sure this is the right way to filter. Given I'm pulling a pin from a color3 this would:

  1. Get the color3 type from the _pinFilterType
  2. Assign that type to _menuFilterType
  3. Filter nodes by that type

This doesn't feel quite right to me since these types seem to be output types rather than input types.

It's unclear to me how to address this as I can imagine, using the same example, you could have many nodes that would have color3 inputs, but what would be the desired behavior in how to link them up, I imagine the first input of the pin type could be matched.

I'll continue down this path to try to filter based on input pin types rather than output types

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