

def testInternalNodeDefaultValues(self):
    s = Gaffer.ScriptNode()
    s['b'] = Gaffer.Box()
    s['b']['n'] = Gaffer.Node()
    s['b']['n']['p'] = Gaffer.IntPlug(defaultValue=1, flags=(Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic))
    s['b']['n']['p'].setValue(2)
    s['b'].exportForReference('/tmp/test.grf')
    s['r'] = Gaffer.Reference()
    self['r'].load('/tmp/test.grf')
    self.assertEqual(s['r']['n']['p'].getValue(), 2)
    self.assertEqual(s['r']['n']['p'].defaultValue(), 1)
    s['fileName'].setValue('/tmp/test.gfr')
    s.save()
    s.load()
    self.assertEqual(s['r']['n']['p'].getValue(), 2)
    self.assertEqual(s['r']['n']['p'].defaultValue(), 1)

dataset/ETHPy150Open ImageEngine/gaffer/python/GafferTest/ReferenceTest.py ReferenceTest.testInternalNodeDefaultValues/VarMisuse@120/178 `s`->`self`