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

Default Value for Optional Node Inputs #11275

Open
nickboyts opened this issue Nov 23, 2020 · 7 comments
Open

Default Value for Optional Node Inputs #11275

nickboyts opened this issue Nov 23, 2020 · 7 comments
Labels

Comments

@nickboyts
Copy link

Dynamo version

1.3 and 2.3

Operating system

Windows 10

What did you do?

New nodes default to having Use Default Value turned on for all optional inputs. However, when packages are updated and existing nodes get additional optional inputs, graphs with these existing nodes do not update with Use Default Value turned on. This causes those nodes not to run and graphs to fail.

What did you expect to see?

Existing instances of nodes should also default to Use Default Value when package updates introduce additional optional inputs.

What did you see instead?

Nodes get updated without turning on Use Default Value and end up not executing.

@github-actions
Copy link

Thank you for submitting the issue to us. We are sorry to see you get stuck with your workflow. While waiting for our team member to respond, please feel free to browse our forum at https://forum.dynamobim.com/ for more Dynamo related information.

@aparajit-pratap
Copy link
Contributor

@nickboyts are you modifying existing nodes and changing their method signatures by adding new default parameters? I don't think we support migration of old nodes created in older graphs and do not guarantee that they automatically migrate to the new ones. At least this isn't supported for the new JSON file format. I think we had migration with the old XML file format. @mjkkirschner?

@nickboyts
Copy link
Author

I'm not modifying nodes or migrating graphs. The issue is with the optional input state of existing nodes when updating a package. There's more discussion about it here on the forum. I'm more just looking for a better way to handle these situations that inevitably come up.

@aparajit-pratap
Copy link
Contributor

aparajit-pratap commented Nov 24, 2020

However, when packages are updated and existing nodes get additional optional inputs, graphs with these existing nodes do not update with Use Default Value turned on.

When you say existing nodes get additional inputs I thought you meant that either you or the package authors whose nodes you're using had modified these nodes by adding additional inputs. If the nodes haven't been modified and their "use default value" automatically updates from true to false, then we'll need to investigate why that's happening.

@nickboyts
Copy link
Author

I see. Yes, the package author has updated the node with new optional inputs. When placing new instances of these nodes, the Use Default Value option is turned on; but existing instances update with the Use Default Value option turned off. I'm looking for a better way to update these nodes without manually changing the input state in all of my graphs.

@aparajit-pratap
Copy link
Contributor

aparajit-pratap commented Nov 24, 2020

I didn't try this with a package but a C# dll:

public static bool Foobar(int arg0, int arg1, bool arg2 = true)
{
            return true;
}

When I use the node above in a graph, connect inputs to it, run and save it, then add an arg3 parameter with a default value, and reopen the graph, I do see that the node reloads and runs again with the arg3 input and with use default option still turned on. Are you describing a similar scenario? If so, then maybe something different is going on with package loading.

@nickboyts
Copy link
Author

Yes, that's essentially what I'm doing. However, I'm seeing this with a custom node, not a dll. Not sure if I've ran into it with a dll before.

@Amoursol Amoursol added the bug label Nov 30, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants