-
Notifications
You must be signed in to change notification settings - Fork 636
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
DYN-5369: variable number of input ports for Watch3D nodes #13896
Conversation
@mjkkirschner |
Hi @LongNguyenP, I tested your question - by creating a custom watch3d node inheriting from It did load correctly, and the UI was updated to include the new buttons. the docs do mention your question as well:
and indicate that it IS an API break... but given my test, I am not sure under what circumstances, maybe only if the type does not override these methods, I am not sure. @pinzart90 any thoughts on this? I am inclined to overlook it because I doubt watch3d is inherited frequently. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
1.A few questions and
2. I think this needs tests for the new methods / interactions.
@@ -171,34 +171,10 @@ public void SetWatchSize(double w, double h) | |||
|
|||
public override IEnumerable<AssociativeNode> BuildOutputAst(List<AssociativeNode> inputAstNodes) | |||
{ | |||
if (IsPartiallyApplied) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
interesting, this seems like it could break some graphs, what did watch3d do when partially applied? Did it actually work?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
kind of, partially applied is a functional programming term - it means that a function has been created with some input parameters set and others still free.
Can you please confirm what happened before and after your changes if you actually invoke the function on some input, you can use map
node - I don't think this is so important but honestly I have no idea what the behavior was, so let's see...
My feeling is that it used to just return the input object, lets see if it still does that?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
your screenshot is not what I mean -
we want the output of the Watch3D node to be a function - or rather, I am trying to understand if that used to work and now it is broken - which I am guessing is the case because of the code you have removed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mjkkirschner You are right, in the current master branch the Watch3D node will output a function (rather than "null) if the only-input port is free.
So looks like this PR will break any existing graph that relies on this function-output behavior, even thought I doubt if anyone would use Watch3D in such a way.
new DynamoNodeButton(nodeView.ViewModel.NodeModel, "AddInPort") | ||
{ | ||
Content = "+", | ||
Style = (Style)SharedDictionaryManager.DynamoModernDictionary["AddRemoveButton"] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is it possible to use nameof or some other method to have this fail at compile time if the key is changed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am not sure if nameof is possible here. This part of the code is based on the NodeViewCustomization of the VariableInputNode and there the name "AddInPort" etc.. were actually hardcoded
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
could you pull all of these out into consts?
looks like a bunch of failing tests in last build. |
Yep it seems that in this PR, Dyn files that contain Watch3D node saved in previous version did not open correctly. Looks like the deseiralization method of the VariableInputNode is not compatible with existing Watch3d implementation Investigating now. L |
I do not think there will be any binary compatibility breaking changes or source code breaking changes as long as the |
Great. Thanks for confirming |
@LongNguyenP please don't update these xml files unless you have a good reason - the fact that you need to illustrates that legacy user graphs that were saved in .xml will potentially be broken. Have you been able to find out why the failures are occurring with xml deserialization. We still need to support xml deserialization! |
Understood. I am digging deeper in the issue with XML now.en |
Ok I think I have got it. It was indeed because the XML deseiralization of the VariableInputNode (which Watch3D now inherits) was expecting a an XML attribute called "inputcount", which did not exist in the existing Watch3D's XML serialized data. I have addressed this and the tests now pass on my local machine. Let's see they will pass on Jenkins too. |
Looks like all tests now pass on Jenkins! Except |
All tests have passed now ! |
this happened when we moved from dynamo 1.x to 2.x |
I also notice the watch3d node looks a bit different -FYI @Jingyi-Wen for review. |
yeah this test is just flaky, don't worry about that one, I think it's marked failure now. |
We made some change to the UI/UX design. We wanted to use per-port context menu for add and removing ports (instead of using the plus or minus button). This way the user can insert a new node in-between existing node and remove a node in the middle if needed. But this require significantly more work so @saintentropy and I thought we should just keep using the plus and minus buttons for now and make another task for the per-port context menu later (I believe this won't break any existing graph that uses plus and minus buttons) |
thanks @LongNguyenP - last thing can you please see my clarifying comments on the partial function application (function passing) and check the behavior before and after. |
@LongNguyenP please give an appropriately descriptive title to your Dynamo PRs, other than just the JIRA ticket number. It helps reviewers both internally and externally what the overall intention of the change is. |
Purpose
This PR implements DYN-5369 (Allowing the Watch3D node to have variable number of input ports)
Declarations
Check these if you believe they are true
*.resx
filesRelease Notes
This PR makes the Watch3D node into a VariableInputNode. This allows the user to avoid using the List.Create.
Reviewers
FYIs