

def testIsolation(self):
    sphere = IECore.SpherePrimitive()
    input = GafferSceneTest.CompoundObjectSource()
    input['in'].setValue(IECore.CompoundObject({
        'bound': IECore.Box3fData(sphere.bound()),
        'children': {
            'groupA': {
                'bound': IECore.Box3fData(sphere.bound()),
                'children': {
                    'sphereAA': {
                        'bound': IECore.Box3fData(sphere.bound()),
                        'object': sphere,
                    },
                    'sphereAB': {
                        'bound': IECore.Box3fData(sphere.bound()),
                        'object': sphere,
                    },
                },
            },
            'groupB': {
                'bound': IECore.Box3fData(sphere.bound()),
                'children': {
                    'sphereBA': {
                        'bound': IECore.Box3fData(sphere.bound()),
                        'object': sphere,
                    },
                    'sphereBB': {
                        'bound': IECore.Box3fData(sphere.bound()),
                        'object': sphere,
                    },
                },
            },
        },
    }))
    isolate = GafferScene.Isolate()
    isolate['in'].setInput(input['out'])
    filter = GafferScene.PathFilter()
    filter['paths'].setValue(IECore.StringVectorData(['/groupA/sphereAB']))
    isolate['filter'].setInput(filter['out'])
    self.assertNotEqual(isolate['out'].childNamesHash('/groupA'), input['out'].childNamesHash('/groupA'))
    self.assertEqual(isolate['out'].childNames('/groupA'), IECore.InternedStringVectorData(['sphereAB']))
    self.assertEqual(isolate['out'].childNames('/'), IECore.InternedStringVectorData(['groupA']))
    filter['paths'].setValue(IECore.StringVectorData(['/groupA/sphereAA']))
    self.assertEqual(isolate['out'].childNames('/groupA'), IECore.InternedStringVectorData(['sphereAA']))
    self.assertEqual(isolate['out'].childNames('/'), IECore.InternedStringVectorData(['groupA']))

dataset/ETHPy150Open ImageEngine/gaffer/python/GafferSceneTest/IsolateTest.py IsolateTest.testIsolation/original