-
Notifications
You must be signed in to change notification settings - Fork 3
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
Conversation
const GafferScene::ScenePlugPtr &scene, | ||
const Gaffer::PlugPtr &editScope, | ||
IECore::InternedString setName, | ||
const std::string &name = "" |
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.
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() ); |
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.
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 ) ); |
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.
Probably worth not repeating the call to match()
here.
} | ||
if( const auto setSource = runTimeCast<GafferScene::Set>( sceneNode ) ) | ||
{ | ||
if( auto nameSource = setSource->namePlug()->source<StringVectorDataPlug>() ) |
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.
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?
const std::vector<std::string> &names = nameSource->getValue()->readable(); | ||
if( std::find( names.begin(), names.end(), m_setName.string() ) == names.end() ) | ||
{ | ||
return nullptr; | ||
} |
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.
The Set node actually uses matchMultiple()
to decide if it is processing a set of not. Perhaps we should do the same here?
if( const auto spreadsheetSource = runTimeCast<Spreadsheet>( nameSource->parent() ) ) | ||
{ | ||
return spreadsheetSource->rowsPlug()->row( m_setName ); | ||
} |
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 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?
c8590be
to
809f606
Compare
809f606
to
07bc20c
Compare
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.
e617bc7
to
35855e0
Compare
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
35855e0
to
e253632
Compare
Windows build fixes
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.
e253632
to
c75621e
Compare
No description provided.