

def testFrom(self):
    light1 = GafferSceneTest.TestLight()
    light1['name'].setValue('light1')
    light2 = GafferSceneTest.TestLight()
    light2['name'].setValue('light2')
    light3 = GafferSceneTest.TestLight()
    light3['name'].setValue('light3')
    group1 = GafferScene.Group()
    group1['name'].setValue('group1')
    group2 = GafferScene.Group()
    group2['name'].setValue('group2')
    group1['in'][0].setInput(group2['out'])
    group1['in'][1].setInput(light3['out'])
    filter['in'][0].setInput(light1['out'])
    group2['in'][1].setInput(light2['out'])
    plane = GafferScene.Plane()
    parent = GafferScene.Parent()
    parent['parent'].setValue('/')
    parent['in'].setInput(group1['out'])
    parent['child'].setInput(plane['out'])
    isolate = GafferScene.Isolate()
    isolate['in'].setInput(parent['out'])
    self.assertSceneValid(isolate['out'])
    self.assertEqual(isolate['out'].childNames('/'), IECore.InternedStringVectorData(['group1', 'plane']))
    self.assertEqual(isolate['out'].childNames('/group1'), IECore.InternedStringVectorData(['group2', 'light3']))
    self.assertEqual(isolate['out'].childNames('/group1/group2'), IECore.InternedStringVectorData(['light1', 'light2']))
    filter = GafferScene.PathFilter()
    filter['paths'].setValue(IECore.StringVectorData(['/group1/group2/light1']))
    isolate['filter'].setInput(filter['out'])
    self.assertSceneValid(isolate['out'])
    self.assertEqual(isolate['out'].childNames('/'), IECore.InternedStringVectorData(['group1']))
    self.assertEqual(isolate['out'].childNames('/group1'), IECore.InternedStringVectorData(['group2']))
    self.assertEqual(isolate['out'].childNames('/group1/group2'), IECore.InternedStringVectorData(['light1']))
    isolate['from'].setValue('/group1')
    self.assertSceneValid(isolate['out'])
    self.assertEqual(isolate['out'].childNames('/'), IECore.InternedStringVectorData(['group1', 'plane']))
    self.assertEqual(isolate['out'].childNames('/group1'), IECore.InternedStringVectorData(['group2']))
    self.assertEqual(isolate['out'].childNames('/group1/group2'), IECore.InternedStringVectorData(['light1']))
    isolate['from'].setValue('/group1/group2')
    self.assertSceneValid(isolate['out'])
    self.assertEqual(isolate['out'].childNames('/'), IECore.InternedStringVectorData(['group1', 'plane']))
    self.assertEqual(isolate['out'].childNames('/group1'), IECore.InternedStringVectorData(['group2', 'light3']))
    self.assertEqual(isolate['out'].childNames('/group1/group2'), IECore.InternedStringVectorData(['light1']))

dataset/ETHPy150Open ImageEngine/gaffer/python/GafferSceneTest/IsolateTest.py IsolateTest.testFrom/VarMisuse@132/212 `group2`->`filter`