|
42 | 42 | import IECore |
43 | 43 | import IECoreScene |
44 | 44 | import IECoreMaya |
45 | | -import StringUtil |
| 45 | +from . import StringUtil |
| 46 | +import six |
| 47 | +from six.moves import range |
46 | 48 |
|
47 | 49 |
|
48 | 50 | ## A function set for operating on the IECoreMaya::SceneShape type. |
@@ -73,7 +75,7 @@ class FnSceneShape( maya.OpenMaya.MFnDagNode ) : |
73 | 75 | # either be an MObject or a node name in string or unicode form. |
74 | 76 | # Note: Most of the member functions assume that this function set is initialized with the full dag path. |
75 | 77 | def __init__( self, object ) : |
76 | | - if isinstance( object, basestring ) : |
| 78 | + if isinstance( object, six.string_types ) : |
77 | 79 | object = StringUtil.dagPathFromString( object ) |
78 | 80 |
|
79 | 81 | maya.OpenMaya.MFnDagNode.__init__( self, object ) |
@@ -163,7 +165,7 @@ def selectedComponentNames( self ) : |
163 | 165 | ## Selects the components specified by the passed names. |
164 | 166 | def selectComponentNames( self, componentNames ) : |
165 | 167 | if not isinstance( componentNames, set ) : |
166 | | - if isinstance( componentNames, basestring ): |
| 168 | + if isinstance( componentNames, six.string_types ): |
167 | 169 | componentNames = set( (componentNames, ) ) |
168 | 170 | else: |
169 | 171 | componentNames = set( componentNames ) |
@@ -284,7 +286,7 @@ def __createChild( self, childName, sceneFile, sceneRoot, drawGeo = False, drawC |
284 | 286 | # Set visible if I have any of the draw flags in my hierarchy, otherwise set hidden |
285 | 287 | if drawTagsFilter: |
286 | 288 | childTags = fnChild.sceneInterface().readTags( IECoreScene.SceneInterface.EveryTag ) |
287 | | - commonTags = filter( lambda x: str(x) in childTags, drawTagsFilter.split() ) |
| 289 | + commonTags = [x for x in drawTagsFilter.split() if str(x) in childTags] |
288 | 290 | if not commonTags: |
289 | 291 | dgMod.newPlugValueBool( fnChildTransform.findPlug( "visibility" ), False ) |
290 | 292 | else: |
|
0 commit comments