def test( self ) :

		points = IECore.PointsPrimitive( 1 )
		points["P"] = IECore.PrimitiveVariable(
			IECore.PrimitiveVariable.Interpolation.Vertex,
			IECore.V3fVectorData( [ IECore.V3f( 1, 2, 3 ) ] ),
		)

		objectToScene = GafferScene.ObjectToScene()
		objectToScene["object"].setValue( points )

		group = GafferScene.Group()
		group["in"][0].setInput( objectToScene["out"] )

		filter = GafferScene.PathFilter()
		filter["paths"].setValue( IECore.StringVectorData( [ "/group/object" ] ) )

		pointsType = GafferScene.PointsType()
		pointsType["in"].setInput( group["out"] )
		pointsType["filter"].setInput( filter["out"] )

		def assertExpectedOutput( type, unchanged ) :

			self.assertSceneValid( pointsType["out"] )

			if type is not None :
				self.assertEqual( pointsType["out"].object( "/group/object" )["type"].data.value, type )
			else :
				self.assertFalse( "type" in pointsType["out"].object( "/group/object" ) )

			if unchanged :
				self.assertScenesEqual( pointsType["out"], group["out"] )
				self.assertEqual( pointsType["out"].object( "/group/object" ), group["out"].object( "/group/object" ) )
				self.assertTrue(
					pointsType["out"].object( "/group/object", _copy = False ).isSame( group["out"].object( "/group/object", _copy = False ) )
				)

		# Test unchanged settings (no type on input points).

		assertExpectedOutput( type = None, unchanged = True )

		# Test unchanged settings.

		points["type"] = IECore.PrimitiveVariable( IECore.PrimitiveVariable.Interpolation.Constant, IECore.StringData( "particles" ) )
		objectToScene["object"].setValue( points )

		assertExpectedOutput( type = "particles", unchanged = True )

		# Test converting particles to particles ( shouldn't do anything )

		pointsType["type"].setValue( "particles" )
		assertExpectedOutput( type = "particles", unchanged = True )

		# Test converting particles to sphere

		pointsType["type"].setValue( "sphere" )
		assertExpectedOutput( type = "sphere", unchanged = False )

		# Test converting particles to patches. The bound should change at this point.

		pointsType["type"].setValue( "patch" )
		assertExpectedOutput( type = "patch", unchanged = False )
dataset/ETHPy150Open ImageEngine/gaffer/python/GafferSceneTest/PointsTypeTest.py/PointsTypeTest.test/original