Skip to content

BoxIO : Fix noduleLayout:section from opposite direction source plugs - #7135

Open
murraystevenson wants to merge 1 commit into
GafferHQ:1.6_maintenancefrom
murraystevenson:boxNoduleLayoutFix
Open

BoxIO : Fix noduleLayout:section from opposite direction source plugs#7135
murraystevenson wants to merge 1 commit into
GafferHQ:1.6_maintenancefrom
murraystevenson:boxNoduleLayoutFix

Conversation

@murraystevenson

Copy link
Copy Markdown
Contributor

noduleLayout:section metadata copied from the source plug is only valid when the source plug and the BoxIO's promoted plug are of the same direction. A BoxIn set up from an out plug with noduleLayout:section "bottom" registered would cause its promoted in plug to also appear on the bottom of the Box. This is common with EditScopes as they set up both their BoxIn and BoxOut from the same source plug.

We now choose the target of setupNoduleSectionMetadata() based on the direction of the source plug, rather than m_direction. When they match, the existing behaviour is unchanged. When they don't match, the metadata target is now the promoted plug, overwriting any noduleLayout:section metadata copied from the source.

An alternate approach might be to always call setupNoduleSectionMetadata() for both outPlugInternal() and inPlugInternal(), I think that might help ensure the internal plugs better represent the flow of their external equivalents in cases where an EditScope is set up with an in plug on the left and the out on the right (note the current lack of "noduleLayout:section" metadata on the internal BoxIO plugs in the additions to BoxInTest/BoxOutTest). But in the general case that feels like it'd only further proliferate instance noduleLayout:section metadata registrations unless we only registered instance metadata when it differs from the default...

`noduleLayout:section` metadata copied from the source plug is only valid when the source plug and the BoxIO's promoted plug are of the same direction. A BoxIn set up from an `out` plug with `noduleLayout:section "bottom"` registered would cause its promoted `in` plug to also appear on the bottom of the Box. This is common with EditScopes as they set up both their BoxIn and BoxOut from the same source plug.

We now choose the target of `setupNoduleSectionMetadata()` based on the direction of the source plug, rather than `m_direction`. When they match, the existing behaviour is unchanged. When they don't match, the metadata target is now the promoted plug, overwriting any `noduleLayout:section` metadata copied from the source.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Pending Review

Development

Successfully merging this pull request may close these issues.

1 participant