Esempio n. 1
0
	def testHash( self ) :

		c = IECore.CompoundParameter(

			"c",
			"",

			[
				IECore.IntParameter( "i", "" ),
				IECore.FloatParameter( "f", "" )
			]

		)

		n = Gaffer.Node()

		h = GafferCortex.CompoundParameterHandler( c )
		h.setupPlug( n )

		hash1 = h.hash()
		n["c"]["i"].setValue( 10 )
		hash2 = h.hash()
		n["c"]["f"].setValue( 10 )
		hash3 = h.hash()

		self.assertNotEqual( hash1, hash2 )
		self.assertNotEqual( hash1, hash3 )
		self.assertNotEqual( hash2, hash3 )
Esempio n. 2
0
    def testCompoundParameterHandler(self):

        c = IECore.CompoundParameter(
            "c", "",
            [IECore.IntParameter("i", ""),
             IECore.FloatParameter("f", "")])

        n = Gaffer.Node()

        h = GafferCortex.CompoundParameterHandler(c)
        h.setupPlug(n)

        self.failUnless(
            h.childParameterHandler(c["i"]).parameter().isSame(c["i"]))
        self.failUnless(
            h.childParameterHandler(c["f"]).parameter().isSame(c["f"]))
Esempio n. 3
0
	def __init__( self, name="ObjectWriter" ) :

		GafferDispatch.TaskNode.__init__( self, name )

		inPlug = Gaffer.ObjectPlug( "in", Gaffer.Plug.Direction.In, IECore.NullObject.defaultNullObject() )
		self.addChild( inPlug )

		fileNamePlug = Gaffer.StringPlug( "fileName", Gaffer.Plug.Direction.In )
		self.addChild( fileNamePlug )

		self.addChild( Gaffer.CompoundPlug( "parameters" ) )

		self.__writer = None
		self.__writerExtension = ""
		self.__exposedParameters = IECore.CompoundParameter()
		self.__parameterHandler = GafferCortex.CompoundParameterHandler( self.__exposedParameters )
		self.__parameterHandler.setupPlug( self )

		self.__plugSetConnection = self.plugSetSignal().connect( Gaffer.WeakMethod( self.__plugSet ) )