Skip to content

Commit

Permalink
Merge pull request #6027 from johnhaddon/scriptNodeAlgo
Browse files Browse the repository at this point in the history
Move selection API from ContextAlgo to ScriptNodeAlgo
  • Loading branch information
johnhaddon committed Sep 10, 2024
2 parents 4940d08 + 1c0dfe1 commit bc2ff07
Show file tree
Hide file tree
Showing 60 changed files with 1,268 additions and 507 deletions.
7 changes: 7 additions & 0 deletions Changes.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,10 @@ Fixes
- CreateViews : Fixed redundant serialisation of internal connections.
- LightEditor, RenderPassEditor : Removed ambiguous `The selected cells cannot be edited in the current Edit Scope` message when attempting to edit non-editable columns, such as the `Name` column.
- SetEditor : Fixed right-click to ensure the item under the cursor is selected before the menu is shown.
- PrimitiveInspector :
- Fixed bug which prevented cancellation of long-running computes, making the UI unresponsive until they completed.
- Fixed thread-safety bug.
- HierarchyView, SetEditor : Fixed thread-safety bugs.

API
---
Expand All @@ -63,6 +67,9 @@ API
- It is now legal to construct an ArrayPlug with a minimum size of 0. Previously the minimum size was 1.
- Added `elementPrototype()` method.
- View : Added `scriptNode()` method.
- VisibleSet : Added Python constructor with keyword arguments for `expansions`, `inclusions` and `exclusions`.
- ScriptNodeAlgo : Added new namespace with functions for managing shared UI state for GafferSceneUI.
- ContextAlgo : Deprecated. Use ScriptNodeAlgo instead.

Breaking Changes
----------------
Expand Down
8 changes: 4 additions & 4 deletions apps/screengrab/screengrab-1.py
Original file line number Diff line number Diff line change
Expand Up @@ -328,19 +328,19 @@ def _run( self, args ) :

# Set up the scene expansion and selection.

GafferSceneUI.ContextAlgo.clearExpansion( script.context() )
GafferSceneUI.ScriptNodeAlgo.setVisibleSet( script, GafferScene.VisibleSet() )

pathsToExpand = IECore.PathMatcher( list( args["scene"]["fullyExpandedPaths"] ) + list( args["scene"]["expandedPaths"] ) )
GafferSceneUI.ContextAlgo.expand( script.context(), pathsToExpand )
GafferSceneUI.ScriptNodeAlgo.expandInVisibleSet( script, pathsToExpand )

pathsToFullyExpand = IECore.PathMatcher( list( args["scene"]["fullyExpandedPaths"] ) )

with script.context() :
for node in script.selection() :
for scenePlug in [ p for p in node.children( GafferScene.ScenePlug ) if p.direction() == Gaffer.Plug.Direction.Out ] :
GafferSceneUI.ContextAlgo.expandDescendants( script.context(), pathsToFullyExpand, scenePlug )
GafferSceneUI.ScriptNodeAlgo.expandDescendantsInVisibleSet( script, pathsToFullyExpand, scenePlug )

GafferSceneUI.ContextAlgo.setSelectedPaths( script.context(), IECore.PathMatcher( args["scene"]["selectedPaths"] ) )
GafferSceneUI.ScriptNodeAlgo.setSelectedPaths( script, IECore.PathMatcher( args["scene"]["selectedPaths"] ) )

# Add a delay.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,23 +75,23 @@ def __delay( delay ) :
GafferUI.WidgetAlgo.grab( widget = scriptWindow, imagePath = "images/viewerSceneReaderBounding.png" )

# GafferBot torso in Hierarchy View
GafferSceneUI.ContextAlgo.setExpandedPaths( script.context(), IECore.PathMatcher( [ "/GAFFERBOT", "/GAFFERBOT/C_torso_GRP" ] ) )
GafferSceneUI.ScriptNodeAlgo.setVisibleSet( script, GafferScene.VisibleSet( expansions = IECore.PathMatcher( [ "/GAFFERBOT", "/GAFFERBOT/C_torso_GRP" ] ) ) )
__delay( 0.1 )
GafferUI.WidgetAlgo.grab( widget = hierarchyView, imagePath = "images/hierarchyViewExpandedTwoLevels.png" )

# GafferBot head and left leg in main window
paths = IECore.PathMatcher( [ "/GAFFERBOT/C_torso_GRP/C_head_GRP", "/GAFFERBOT/C_torso_GRP/R_legUpper_GRP" ] )
GafferSceneUI.ContextAlgo.expand( script.context(), paths )
GafferSceneUI.ContextAlgo.expandDescendants( script.context(), paths, script["SceneReader"]["out"] )
GafferSceneUI.ContextAlgo.expandDescendants( script.context(), paths, readerNode["out"] )
GafferSceneUI.ScriptNodeAlgo.expandInVisibleSet( script, paths )
GafferSceneUI.ScriptNodeAlgo.expandDescendantsInVisibleSet( script, paths, script["SceneReader"]["out"] )
GafferSceneUI.ScriptNodeAlgo.expandDescendantsInVisibleSet( script, paths, readerNode["out"] )
viewer.view().viewportGadget().getPrimaryChild().waitForCompletion()
GafferUI.WidgetAlgo.grab( widget = scriptWindow, imagePath = "images/mainHeadAndLeftLegExpanded.png" )

# GafferBot head and both legs in Viewer
paths = IECore.PathMatcher( [ "/GAFFERBOT/C_torso_GRP/L_legUpper_GRP" ] )
GafferSceneUI.ContextAlgo.expand( script.context(), paths )
GafferSceneUI.ContextAlgo.expandDescendants( script.context(), paths, readerNode["out"] )
GafferSceneUI.ContextAlgo.setSelectedPaths( script.context(), paths )
GafferSceneUI.ScriptNodeAlgo.expandInVisibleSet( script, paths )
GafferSceneUI.ScriptNodeAlgo.expandDescendantsInVisibleSet( script, paths, readerNode["out"] )
GafferSceneUI.ScriptNodeAlgo.setSelectedPaths( script, paths )
viewer.view().viewportGadget().getPrimaryChild().waitForCompletion()
GafferUI.WidgetAlgo.grab( widget = viewer, imagePath = "images/viewerHeadAndLegsExpanded.png" )

Expand All @@ -115,15 +115,14 @@ def __delay( delay ) :
script.selection().add( groupNode )
script.setFocus( groupNode )
viewer.view()["minimumExpansionDepth"].setValue( 999 )
GafferSceneUI.ContextAlgo.clearExpansion( script.context() )
GafferSceneUI.ContextAlgo.expand( script.context(), IECore.PathMatcher( [ "/group" ] ) )
GafferSceneUI.ScriptNodeAlgo.setVisibleSet( script, GafferScene.VisibleSet( expansions = IECore.PathMatcher( [ "/group" ] ) ) )
viewer.view().viewportGadget().getPrimaryChild().waitForCompletion()
GafferUI.WidgetAlgo.grab( widget = scriptWindow, imagePath = "images/mainGroupNode.png" )

# Camera repositioned, with translate tool on, in Viewer
cameraNode["transform"]["translate"].setValue( imath.V3f( 16, 13, 31 ) )
viewer.view().viewportGadget().frame( groupNode["out"].bound( "/group" ) )
GafferSceneUI.ContextAlgo.setSelectedPaths( script.context(), IECore.PathMatcher( [ "/group/camera" ] ) )
GafferSceneUI.ScriptNodeAlgo.setSelectedPaths( script, IECore.PathMatcher( [ "/group/camera" ] ) )
for i in viewer._Viewer__toolChooser.tools():
if type( i ) == GafferSceneUI.TranslateTool:
translateTool = i
Expand Down Expand Up @@ -252,7 +251,7 @@ def __renderAndGrab( script, widget, imagePath, delay = 15 ) :
script.selection().add( script["ShaderAssignment1"] )
script.setFocus( script["ShaderAssignment1"] )
paths = IECore.PathMatcher( [ "/group/GAFFERBOT/C_torso_GRP/C_head_GRP/C_head_CPT/C_browNose001_REN", "/group/GAFFERBOT/C_torso_GRP/C_head_GRP/C_head_CPT/C_mouthGrill001_REN" ] )
GafferSceneUI.ContextAlgo.setSelectedPaths( script.context(), paths )
GafferSceneUI.ScriptNodeAlgo.setSelectedPaths( script, paths )
GafferUI.EventLoop.waitForIdle()
paths = IECore.PathMatcher( [ "/group/GAFFERBOT/C_torso_GRP/C_head_GRP/C_head_CPT" ] )
viewer.view().frame( paths, direction = imath.V3f( -0.2, -0.2, -1 ) )
Expand Down
3 changes: 1 addition & 2 deletions doc/source/WorkingWithScenes/AnatomyOfACamera/screengrab.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,7 @@

script.selection().add( script["Camera"] )
__path = "/camera"
__paths = IECore.PathMatcher( [ __path ] )
GafferSceneUI.ContextAlgo.expand( script.context(), __paths )
GafferSceneUI.ScriptNodeAlgo.expandInVisibleSet( script, IECore.PathMatcher( [ __path ] ) )

from GafferSceneUI.SceneInspector import __TransformSection, __BoundSection, __ObjectSection, __AttributesSection, __SetMembershipSection

Expand Down
8 changes: 4 additions & 4 deletions doc/source/WorkingWithScenes/AnatomyOfAScene/screengrab.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,11 @@ def __delay( delay ) :

# The Scene Inspector
__paths = IECore.PathMatcher( [ __path ] )
GafferSceneUI.ContextAlgo.expand( script.context(), __paths )
GafferSceneUI.ContextAlgo.expandDescendants( script.context(), __paths, script["SceneReader"]["out"] )
GafferSceneUI.ContextAlgo.setSelectedPaths( script.context(), __paths )
GafferSceneUI.ScriptNodeAlgo.expandInVisibleSet( script, __paths )
GafferSceneUI.ScriptNodeAlgo.expandDescendantsInVisibleSet( script, __paths, script["SceneReader"]["out"] )
GafferSceneUI.ScriptNodeAlgo.setSelectedPaths( script, __paths )
scriptWindow = GafferUI.ScriptWindow.acquire( script )
GafferSceneUI.ContextAlgo.setExpandedPaths( script.context(), IECore.PathMatcher( [ __path ] ) )
GafferSceneUI.ScriptNodeAlgo.setVisibleSet( script, GafferScene.VisibleSet( expansions = IECore.PathMatcher( [ __path ] ) ) )
hierarchyView = scriptWindow.getLayout().editors( GafferSceneUI.HierarchyView )[0]
__delay( 1.0 )
GafferUI.WidgetAlgo.grab( widget = hierarchyView, imagePath = "images/hierarchyView.png" )
Expand Down
4 changes: 2 additions & 2 deletions doc/source/WorkingWithScenes/Camera/screengrab.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,8 @@ def __dispatchScript( script, tasks, settings ) :
__delay( 0.1 )
viewer.view()["grid"]["visible"].setValue( False )
paths = IECore.PathMatcher( [ "/camera" ] )
GafferSceneUI.ContextAlgo.expand( script.context(), paths )
GafferSceneUI.ContextAlgo.setSelectedPaths( script.context(), paths )
GafferSceneUI.ScriptNodeAlgo.expandInVisibleSet( script, paths )
GafferSceneUI.ScriptNodeAlgo.setSelectedPaths( script, paths )
viewer.view().viewportGadget().getPrimaryChild().waitForCompletion()
GafferUI.WidgetAlgo.grab( widget = viewer, imagePath = "images/interfaceCameraVisualizer.png" )
script.selection().clear()
Expand Down
2 changes: 1 addition & 1 deletion doc/source/WorkingWithScenes/LightLinking/screengrab.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
script.selection().add( script["StandardAttributes"] )
__path = "/group/sphere"
__paths = IECore.PathMatcher( [ __path ] )
GafferSceneUI.ContextAlgo.setSelectedPaths( script.context(), __paths )
GafferSceneUI.ScriptNodeAlgo.setSelectedPaths( script, __paths )

from GafferSceneUI.SceneInspector import __AttributesSection

Expand Down
2 changes: 1 addition & 1 deletion doc/source/WorkingWithTheNodeGraph/Contexts/screengrab.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ def __delay( delay ) :
__delay( 0.1 )

# Concept: Querying results
GafferSceneUI.ContextAlgo.setSelectedPaths( script.context(), IECore.PathMatcher( [ "/cube2" ] ) )
GafferSceneUI.ScriptNodeAlgo.setSelectedPaths( script, IECore.PathMatcher( [ "/cube2" ] ) )
#sceneInspector.reveal()
# Expand the "Transform" section
#sceneInspector._SceneInspector__sections[2]._Section__collapsible.setCollapsed( False )
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ def __delay( delay ) :
script["Camera"]["transform"]["translate"]["z"].setValue( 8 )
script.setFocus( script["Camera"] )
paths = IECore.PathMatcher( [ "/camera" ] )
GafferSceneUI.ContextAlgo.setSelectedPaths( script.context(), paths )
GafferSceneUI.ScriptNodeAlgo.setSelectedPaths( script, paths )
__delay( 0.1 )
GafferUI.WidgetAlgo.grab( widget = viewer, imagePath = "images/viewerCameraPosition.png" )

Expand All @@ -125,8 +125,8 @@ def __delay( delay ) :
# Final script in Viewer
script.setFocus( script["Group"] )
paths = IECore.PathMatcher( [ "/group" ] )
GafferSceneUI.ContextAlgo.setExpandedPaths( script.context(), paths )
GafferSceneUI.ContextAlgo.expandDescendants( script.context(), paths, script["Group"]["out"] )
GafferSceneUI.ScriptNodeAlgo.setVisibleSet( script, GafferScene.VisibleSet( expansions = paths ) )
GafferSceneUI.ScriptNodeAlgo.expandDescendantsInVisibleSet( script, paths, script["Group"]["out"] )
__delay( 0.1 )
GafferUI.WidgetAlgo.grab( widget = viewer, imagePath = "images/viewerFinalScene.png" )

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,6 @@ def __dispatchScript( script, tasks, settings ) :
viewer.view().viewportGadget().frame( script["SceneReader"]["out"].bound( "/" ) )
viewer.view().viewportGadget().getPrimaryChild().waitForCompletion()
paths = IECore.PathMatcher( [ "/" ] )
GafferSceneUI.ContextAlgo.expand( script.context(), paths )
GafferSceneUI.ContextAlgo.expandDescendants( script.context(), paths, script["SceneReader"]["out"] )
GafferSceneUI.ScriptNodeAlgo.expandInVisibleSet( script, paths )
GafferSceneUI.ScriptNodeAlgo.expandDescendantsInVisibleSet( script, paths, script["SceneReader"]["out"] )
GafferUI.WidgetAlgo.grab( widget = scriptWindow, imagePath = "images/tutorialVariableSubstitutionTest.png" )
1 change: 1 addition & 0 deletions include/GafferSceneUI/LightTool.h
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ class GAFFERSCENEUI_API LightTool : public GafferSceneUI::SelectionTool

void connectToViewContext();
void contextChanged( const IECore::InternedString &name );
void selectedPathsChanged();
void metadataChanged( IECore::InternedString key );
void updateHandleInspections();
void updateHandleTransforms( float rasterScale );
Expand Down
9 changes: 2 additions & 7 deletions include/GafferSceneUI/SceneView.h
Original file line number Diff line number Diff line change
Expand Up @@ -108,10 +108,6 @@ class GAFFERSCENEUI_API SceneView : public GafferUI::View
static void registerRenderer( const std::string &name, const RendererSettingsCreator &settingsCreator );
static std::vector<std::string> registeredRenderers();

protected :

void contextChanged( const IECore::InternedString &name ) override;

private :

// The filter for a preprocessing node used to hide things.
Expand All @@ -120,12 +116,11 @@ class GAFFERSCENEUI_API SceneView : public GafferUI::View

Imath::Box3f framingBound() const;

void selectedPathsChanged();
void visibleSetChanged();
bool keyPress( GafferUI::GadgetPtr gadget, const GafferUI::KeyEvent &event );
void transferSelectionToContext();
void plugSet( Gaffer::Plug *plug );

Gaffer::Signals::ScopedConnection m_selectionChangedConnection;

SceneGadgetPtr m_sceneGadget;

/// \todo Refactor all these bolt-on classes to follow the model of
Expand Down
117 changes: 117 additions & 0 deletions include/GafferSceneUI/ScriptNodeAlgo.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,117 @@
//////////////////////////////////////////////////////////////////////////
//
// Copyright (c) 2024, Cinesite VFX Ltd. All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
//
// * Redistributions of source code must retain the above
// copyright notice, this list of conditions and the following
// disclaimer.
//
// * Redistributions in binary form must reproduce the above
// copyright notice, this list of conditions and the following
// disclaimer in the documentation and/or other materials provided with
// the distribution.
//
// * Neither the name of John Haddon nor the names of
// any other contributors to this software may be used to endorse or
// promote products derived from this software without specific prior
// written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
// IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
//
//////////////////////////////////////////////////////////////////////////

#pragma once

#include "GafferSceneUI/Export.h"

#include "GafferScene/VisibleSet.h"

#include "Gaffer/Signals.h"

#include "IECore/PathMatcher.h"

namespace Gaffer
{

class ScriptNode;

} // namespace Gaffer

namespace GafferScene
{

class ScenePlug;

} // namespace GafferScene

namespace GafferSceneUI
{

namespace ScriptNodeAlgo
{

using ChangedSignal = Gaffer::Signals::Signal<void ( Gaffer::ScriptNode * ), Gaffer::Signals::CatchingCombiner<void>>;

/// Visible Set
/// ===========

/// The UI components coordinate with each other to perform on-demand scene
/// generation by managing a VisibleSet specifying which scene locations should
/// be shown. For instance, this allows the Viewer to show the objects from
/// locations exposed by expansion performed in the HierarchyView, and vice
/// versa.
GAFFERSCENEUI_API void setVisibleSet( Gaffer::ScriptNode *script, const GafferScene::VisibleSet &visibleSet );
GAFFERSCENEUI_API GafferScene::VisibleSet getVisibleSet( const Gaffer::ScriptNode *script );
/// Returns a signal emitted when the visible set for `script` is changed.
GAFFERSCENEUI_API ChangedSignal &visibleSetChangedSignal( Gaffer::ScriptNode *script );

/// Visible Set Utilities
/// =====================

/// Appends paths to the current expansion, optionally adding all ancestor paths too.
GAFFERSCENEUI_API void expandInVisibleSet( Gaffer::ScriptNode *script, const IECore::PathMatcher &paths, bool expandAncestors = true );
/// Appends descendant paths to the current expansion up to a specified maximum depth.
/// Returns a new PathMatcher containing the new leafs of this expansion.
GAFFERSCENEUI_API IECore::PathMatcher expandDescendantsInVisibleSet( Gaffer::ScriptNode *script, const IECore::PathMatcher &paths, const GafferScene::ScenePlug *scene, int depth = std::numeric_limits<int>::max() );

/// Path Selection
/// ==============

/// Similarly to Path Expansion, the UI components coordinate with each other to
/// perform scene selection, storing the paths to the currently selected
/// locations within the scene.
GAFFERSCENEUI_API void setSelectedPaths( Gaffer::ScriptNode *script, const IECore::PathMatcher &paths );
GAFFERSCENEUI_API IECore::PathMatcher getSelectedPaths( const Gaffer::ScriptNode *script );

/// When multiple paths are selected, it can be useful to know which was the last path to be
/// added. Because `PathMatcher` is unordered, this must be specified separately.
///
/// > Note : The last selected path is synchronised automatically with the list of selected
/// > paths. When `setLastSelectedPath()` is called, it adds the path to the main selection list.
/// > When `setSelectedPaths()` is called, an arbitrary path becomes the last selected path.
/// >
/// > Note : An empty path is considered to mean that there is no last selected path, _not_
/// > that the scene root is selected.
GAFFERSCENEUI_API void setLastSelectedPath( Gaffer::ScriptNode *script, const std::vector<IECore::InternedString> &path );
GAFFERSCENEUI_API std::vector<IECore::InternedString> getLastSelectedPath( const Gaffer::ScriptNode *script );

/// Returns a signal emitted when either the selected paths or last selected path change for `script`.
GAFFERSCENEUI_API ChangedSignal &selectedPathsChangedSignal( Gaffer::ScriptNode *script );

} // namespace ScriptNodeAlgo

} // namespace GafferSceneUI
1 change: 1 addition & 0 deletions include/GafferSceneUI/TransformTool.h
Original file line number Diff line number Diff line change
Expand Up @@ -256,6 +256,7 @@ class GAFFERSCENEUI_API TransformTool : public GafferSceneUI::SelectionTool

void connectToViewContext();
void contextChanged( const IECore::InternedString &name );
void selectedPathsChanged();
void plugDirtied( const Gaffer::Plug *plug );
void metadataChanged( IECore::InternedString key );
void updateSelection() const;
Expand Down
5 changes: 1 addition & 4 deletions include/GafferSceneUI/UVView.h
Original file line number Diff line number Diff line change
Expand Up @@ -92,10 +92,6 @@ class GAFFERSCENEUI_API UVView : public GafferUI::View
using UVViewSignal = Gaffer::Signals::Signal<void (UVView *)>;
UVViewSignal &stateChangedSignal();

protected :

void contextChanged( const IECore::InternedString &name ) override;

private :

Gaffer::CompoundObjectPlug *texturesPlug();
Expand All @@ -114,6 +110,7 @@ class GAFFERSCENEUI_API UVView : public GafferUI::View
void plugDirtied( const Gaffer::Plug *plug );
void preRender();
void visibilityChanged();
void selectedPathsChanged();
void updateTextureGadgets( const IECore::ConstCompoundObjectPtr &textures );
void gadgetStateChanged( const GafferUI::Gadget *gadget, bool running );

Expand Down
26 changes: 26 additions & 0 deletions python/GafferSceneTest/VisibleSetTest.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,32 @@

class VisibleSetTest( GafferSceneTest.SceneTestCase ) :

def testConstructor( self ) :

vs = GafferScene.VisibleSet()
self.assertEqual( vs.expansions, IECore.PathMatcher() )
self.assertEqual( vs.inclusions, IECore.PathMatcher() )
self.assertEqual( vs.exclusions, IECore.PathMatcher() )

vs = GafferScene.VisibleSet( expansions = IECore.PathMatcher( [ "/e" ] ) )
self.assertEqual( vs.expansions, IECore.PathMatcher( [ "/e" ] ) )
self.assertEqual( vs.inclusions, IECore.PathMatcher() )
self.assertEqual( vs.exclusions, IECore.PathMatcher() )

vs = GafferScene.VisibleSet( inclusions = IECore.PathMatcher( [ "/i" ] ) )
self.assertEqual( vs.expansions, IECore.PathMatcher() )
self.assertEqual( vs.inclusions, IECore.PathMatcher( [ "/i" ] ) )
self.assertEqual( vs.exclusions, IECore.PathMatcher() )

vs = GafferScene.VisibleSet(
expansions = IECore.PathMatcher( [ "/e" ] ),
inclusions = IECore.PathMatcher( [ "/i" ] ),
exclusions = IECore.PathMatcher( [ "/x" ] ),
)
self.assertEqual( vs.expansions, IECore.PathMatcher( [ "/e" ] ) )
self.assertEqual( vs.inclusions, IECore.PathMatcher( [ "/i" ] ) )
self.assertEqual( vs.exclusions, IECore.PathMatcher( [ "/x" ] ) )

def testExpansions( self ) :

e = GafferScene.VisibleSet()
Expand Down
Loading

0 comments on commit bc2ff07

Please sign in to comment.