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

Set membership inspector #13

Merged
merged 17 commits into from
Feb 10, 2023
Merged

Conversation

johnhaddon
Copy link
Owner

No description provided.

const GafferScene::ScenePlugPtr &scene,
const Gaffer::PlugPtr &editScope,
IECore::InternedString setName,
const std::string &name = ""
Copy link
Owner Author

Choose a reason for hiding this comment

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

What's the reason for allowing the name to be overridden? Inspector::name() is meant to tell you what property is being inspected, so it should be derived from the setName. We can change the display name by giving the InspectorColumn its own heading.

if( history )
{
const auto &path = history->context->get<ScenePlug::ScenePath>( ScenePlug::scenePathContextName );
const PathMatcher setMembers = SetAlgo::evaluateSetExpression( m_setName.string(), history->scene.get() );
Copy link
Owner Author

Choose a reason for hiding this comment

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

Any reason this isn't just history->scene->set( setName )?


if( setMembers.match( path ) & ( PathMatcher::Result::AncestorMatch | PathMatcher::Result::ExactMatch ) )
{
return new IntData( setMembers.match( path ) );
Copy link
Owner Author

Choose a reason for hiding this comment

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

Probably worth not repeating the call to match() here.

}
if( const auto setSource = runTimeCast<GafferScene::Set>( sceneNode ) )
{
if( auto nameSource = setSource->namePlug()->source<StringVectorDataPlug>() )
Copy link
Owner Author

Choose a reason for hiding this comment

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

namePlug() is a StringPlug, and this if() will fail if it gets its input from another StringPlug. Do we need to know about the type here?

Comment on lines 179 to 199
const std::vector<std::string> &names = nameSource->getValue()->readable();
if( std::find( names.begin(), names.end(), m_setName.string() ) == names.end() )
{
return nullptr;
}
Copy link
Owner Author

Choose a reason for hiding this comment

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

The Set node actually uses matchMultiple() to decide if it is processing a set of not. Perhaps we should do the same here?

Comment on lines 184 to 204
if( const auto spreadsheetSource = runTimeCast<Spreadsheet>( nameSource->parent() ) )
{
return spreadsheetSource->rowsPlug()->row( m_setName );
}
Copy link
Owner Author

Choose a reason for hiding this comment

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

This is what makes us compatible with EditScopeAlgo, right? Should we also be validating that the rows plug is actually driving the filter for the Set node? And maybe do that in such a way that simple user-made "Set + PathFilter" setups are also supported?

@ericmehl ericmehl force-pushed the SetMembershipInspector branch 7 times, most recently from c8590be to 809f606 Compare January 31, 2023 20:30
This is necessary to stop attempts to automatically link to Boost libraries with the wrong name. Since you can't build against `GafferHQ/dependencies` without it, we should define it as standard rather than require everyone to set it themselves.
On Windows, `subprocess` doesn't necessarily use `env["PATH"]` to find an executable, and the Python documentation recommends always using a full path instead. This fixes the build on my machine, where otherwise a system Python was being found, with version 3.10.
@ericmehl ericmehl force-pushed the SetMembershipInspector branch 3 times, most recently from e617bc7 to 35855e0 Compare February 2, 2023 21:46
ericmehl and others added 2 commits February 2, 2023 17:18
We were already not including the Windows-specific `gaffer.cmd` on Linux, this removes the corresponding `gaffer` launch wrapper on Windows.
…ch-wrapper

SConstruct : Remove `gaffer` wrapper on Windows
ericmehl and others added 13 commits February 3, 2023 13:08
If the mute attribute was not present, `InspectorColumn` would not know to add the "Double-click to toggle" ending to the tooltip.
- Getting any old `_GafferSceneUI._LightEditorInspectorColumn` will also
include the new `_GafferSceneUI._LightEditorSoloColumn`, which we don't
want.
- It turns out creating a Python list with multiple entries using the
`[] * n` syntax creates shallow copies of the list contents. Therefore
when modifying the selection, it was affecting all columns because the
list members were all the same `IECore.PathMatcher()`. This caused
incorrect results when both the "Mute" and "Solo" column were toggled.
@johnhaddon johnhaddon merged commit c0407d6 into johnhaddon:main Feb 10, 2023
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.

2 participants