Example #1
0
    def testPromotedCameraHitMode(self):

        b = Gaffer.Box()
        b["a"] = GafferRenderMan.RenderManAttributes()

        p = b.promotePlug(b["a"]["attributes"]["cameraHitMode"])
        self.assertEqual(Gaffer.NodeAlgo.presets(p["value"]),
                         ["Shader", "Primitive"])
    def testSerialisation(self):

        s = Gaffer.ScriptNode()
        s["a"] = GafferRenderMan.RenderManAttributes()
        s["a"]["attributes"]["cameraVisibility"]["value"].setValue(False)
        names = s["a"]["attributes"].keys()

        s2 = Gaffer.ScriptNode()
        s2.execute(s.serialise())

        self.assertEqual(s2["a"]["attributes"].keys(), names)
        self.assertTrue("attributes1" not in s2["a"])
        self.assertEqual(
            s2["a"]["attributes"]["cameraVisibility"]["value"].getValue(),
            False)