コード例 #1
0
ファイル: testUsdMtlxFileFormat.py プロジェクト: zxwzxw/USD
 def test_Cycle(self):
     """
     Verify that a MaterialX file with an inherits cycle fails.
     """
     with self.assertRaises(Tf.ErrorException) as e:
         UsdMtlx._TestString('''<?xml version="1.0" ?>
                <materialx version="1.35">
                    <nodedef name="n1" type="float" node="test" inherit="n2">
                    <nodedef name="n2" type="float" node="test" inherit="n1">
                </materialx>
             ''')
コード例 #2
0
ファイル: testUsdMtlxFileFormat.py プロジェクト: zxwzxw/USD
 def test_DuplicateName(self):
     """
     Verify that a MaterialX file with duplicate element names fails.
     """
     with self.assertRaises(Tf.ErrorException) as e:
         UsdMtlx._TestString('''<?xml version="1.0" ?>
                <materialx version="1.35">
                    <typedef name="type1">
                    <typedef name="type1">
                </materialx>
             ''')
コード例 #3
0
 def test_Cycle(self):
     """
     Verify that a MaterialX file with an inherits cycle fails.
     """
     with self.assertRaises(Tf.ErrorException) as e:
         UsdMtlx._TestString(
             '''<?xml version="1.0" ?>
                <materialx version="1.35">
                    <nodedef name="n1" type="float" node="test" inherit="n2">
                    <nodedef name="n2" type="float" node="test" inherit="n1">
                </materialx>
             ''')
コード例 #4
0
 def test_DuplicateName(self):
     """
     Verify that a MaterialX file with duplicate element names fails.
     """
     with self.assertRaises(Tf.ErrorException) as e:
         UsdMtlx._TestString(
             '''<?xml version="1.0" ?>
                <materialx version="1.35">
                    <typedef name="type1">
                    <typedef name="type1">
                </materialx>
             ''')
コード例 #5
0
ファイル: testUsdMtlxFileFormat.py プロジェクト: zxwzxw/USD
 def test_EmptyMaterialXDocument(self):
     """
     Verify that a file with an empty a materialx element is okay.
     """
     stage = UsdMtlx._TestString('''<?xml version="1.0" ?>
            <materialx version="1.35">
            </materialx>
         ''')
     self.assertEqual(stage.GetRootLayer().ExportToString(), _EmptyLayer())
コード例 #6
0
 def test_EmptyMaterialXDocument(self):
     """
     Verify that a file with an empty a materialx element is okay.
     """
     stage = UsdMtlx._TestString(
         '''<?xml version="1.0" ?>
            <materialx version="1.35">
            </materialx>
         ''')
     self.assertEqual(stage.GetRootLayer().ExportToString(),
                      _EmptyLayer())
コード例 #7
0
ファイル: testUsdMtlxFileFormat.py プロジェクト: zxwzxw/USD
 def test_EmptyXMLDocument(self):
     """
     Verify that a MaterialX file with only an XML header fails.
     """
     with self.assertRaises(Tf.ErrorException) as e:
         UsdMtlx._TestString('''<?xml version="1.0" ?>''')
コード例 #8
0
ファイル: testUsdMtlxFileFormat.py プロジェクト: zxwzxw/USD
 def test_BadMagic(self):
     """
     Verify that a MaterialX file with a bad XML header fails.
     """
     with self.assertRaises(Tf.ErrorException) as e:
         UsdMtlx._TestString('''<?not_xml version="1.0" ?>''')
コード例 #9
0
ファイル: testUsdMtlxFileFormat.py プロジェクト: zxwzxw/USD
 def test_EmptyFile(self):
     """
     Verify that an empty MaterialX document fails.
     """
     with self.assertRaises(Tf.ErrorException) as e:
         UsdMtlx._TestString('')
コード例 #10
0
 def test_EmptyXMLDocument(self):
     """
     Verify that a MaterialX file with only an XML header fails.
     """
     with self.assertRaises(Tf.ErrorException) as e:
         UsdMtlx._TestString('''<?xml version="1.0" ?>''')
コード例 #11
0
 def test_BadMagic(self):
     """
     Verify that a MaterialX file with a bad XML header fails.
     """
     with self.assertRaises(Tf.ErrorException) as e:
         UsdMtlx._TestString('''<?not_xml version="1.0" ?>''')
コード例 #12
0
 def test_EmptyFile(self):
     """
     Verify that an empty MaterialX document fails.
     """
     with self.assertRaises(Tf.ErrorException) as e:
         UsdMtlx._TestString('')