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

CropWindowTool : Consider read-only state when finding target plug #3239

Closed
wants to merge 4 commits into from

Conversation

themissingcow
Copy link

Fixes #3236

User Facing Changes :

  • The CropWindowTool now properly considers a plug's read-only state when
    looking for a crop window to edit. This covers nodes within references
    as well as individually locked plugs.

return;
}

if( node != m_cropWindowPlug->node() )
Copy link
Member

Choose a reason for hiding this comment

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

Any node in the parent hierarchy for m_cropWindowPlug could cause us to become read only, because read-onliness is inherited. So we can't early-out like this - we'd need to use !node->isAncestorOf() instead. There is an argument for just assuming nothing about how read-onliness is specified/inherited though, and doing as the TransformTool does - just risk doing a little more work once in a while.

Copy link
Author

Choose a reason for hiding this comment

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

Ahh great, thanks. Fixed in 558040a

@@ -459,6 +464,49 @@ void CropWindowTool::plugDirtied( const Gaffer::Plug *plug )
}
}

void CropWindowTool::nodeMetadataChanged( IECore::InternedString key, const Gaffer::Node* node )
{
if( !m_cropWindowPlug || m_overlayDirty )
Copy link
Member

Choose a reason for hiding this comment

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

Does the dirtiness of the overlay really mean we can early-out here? A viewport change can dirty the overlay without setting m_needCropWindowPlugSearch.

Copy link
Author

Choose a reason for hiding this comment

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

Which lead me to find: 32f6337

Fixed in 558040a


void CropWindowTool::plugMetadataChanged( IECore::InternedString key, const Gaffer::Plug* plug )
{
if( !m_cropWindowPlug || m_overlayDirty )
Copy link
Member

Choose a reason for hiding this comment

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

As above.

Copy link
Author

Choose a reason for hiding this comment

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

Fixed in 558040a

m_overlay->setCaption( m_cropWindowPlug->relativeName( m_cropWindowPlug->ancestor<ScriptNode>() ) );
const std::string plugName = m_cropWindowPlug->relativeName( m_cropWindowPlug->ancestor<ScriptNode>() );

// If even after the second search, we could still be read-only
Copy link
Member

Choose a reason for hiding this comment

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

"If even" -> "Even"

Copy link
Author

Choose a reason for hiding this comment

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

Fixed in 826741a

@johnhaddon johnhaddon added the pr-revision PRs that should not be merged because a Reviewer has requested changes. label Jul 3, 2019
User Facing Changes :

 - The CropWindowTool now properly considers a plug's read-only state when
   looking for a crop window to edit. This covers nodes within references
   as well as individually locked plugs.
@themissingcow themissingcow removed the pr-revision PRs that should not be merged because a Reviewer has requested changes. label Jul 22, 2019
johnhaddon added a commit that referenced this pull request Jul 30, 2019
Manual merge of #3239 after squashing commits and fixing a bug.
@johnhaddon
Copy link
Member

Closing - merged this manually after squashing commits and fixing a bug.

@johnhaddon johnhaddon closed this Jul 30, 2019
@themissingcow themissingcow deleted the cropToolReadOnly branch January 2, 2020 10:01
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.

CropWindowTool doesn't check target node read-only status
3 participants