Пример #1
0
        def testColorLoading(self):

            r = IECoreRI.PTCParticleReader("test/IECoreRI/data/cube.ptc")
            n = r.numParticles()

            p = r.read()
            self.assertEqual(
                p.variableSize(IECore.PrimitiveVariable.Interpolation.Vertex),
                n)

            c = p["Ci"].data
            self.assertEqual(len(c), n)
            self.assert_(
                c.isInstanceOf(IECore.Color3fVectorData.staticTypeId()))
Пример #2
0
 def testRead(self):
     r = IECoreRI.PTCParticleReader()
     r['fileName'] = self.testfile
     pointCloud = r.read()
     self.assertEqual(type(pointCloud), IECore.PointsPrimitive)
     self.assertEqual(pointCloud.numPoints, 2975)
     self.assertEqual(len(pointCloud["P"].data), 2975)
     self.assertEqual(
         set(pointCloud.blindData()['PTCParticleIO'].keys()),
         set([
             "boundingBox", "worldToEye", "worldToNdc", "variableTypes"
         ]))
     r['percentage'] = 50
     pointCloud2 = r.read()
     self.assertEqual(len(pointCloud2["P"].data), 1502)