Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
Adding support for array parameters #5954
base: main
Are you sure you want to change the base?
Adding support for array parameters #5954
Changes from 3 commits
eed1e18
eb76316
9634b89
98c95b5
c902277
77420aa
881d8d4
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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.
It's not clear to me what this case is for - could definitely use a comment at least. It doesn't seem related to this PR's main purpose ( arrays, which are handled in the case above ). Maybe this should be obvious, but I can't think offhand of what data types have components, other than compoundNumerics, splines, and arrays?
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.
This was to allow support connections to the entire array or individual array indices.
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'm still not quite following here - the conditional on line 615 should be handling arrays?
You're saying that if you make a connection to the entire array, then addParameterComponentConnections is called on a Plug that isn't an ArrayPlug?
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 have finally come back to this to implement John's change, and the reason for this block of code is to handle a float array that has a float plug connected to an index.
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.
Hmm, I'm still not 100% sure I understand this, but if I'm understanding correctly, you've identified a bug in the existing code, but I don't think this solution is in the right place.
addComponentConnections
is intended to add connections to the children of a plug, not the plug itself. I think the bug is on line 621 when the children of an array plug are handled just by calling addComponentConnections - this isn't right, because the children of an array might not have components ( ie. a float array ). But we don't exactly have the right code for "add a top level connection if the top level is connected, otherwise add component connections" in a form that's easy to call - if we just called addParameter on line 621, that would sort of do the trick, but it would also be trying to set the parameter value, which we don't want here. We could paste in the relevant code from addParameter, but that's a bit messy. Maybe @johnhaddon has an idea how he'd like this arranged.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.
It's not really a bug in current gaffer, it's very specific to array plugs as they have component connections which can either have sub component connections or just regular component connections. eg.
ramp['color'][1]['r']
vsramp['position'][1]
. This made the most sense to me as I didn't want to have a bunch of duplicate code looking for components within the array, I would be happy to move it anywhere it would make more sense.