def __init__( self, fileName ) :

		FileExaminer.__init__( self, fileName )
# to do the work.
class RIBFileExaminer( FileExaminer ) :

	def __init__( self, fileName ) :

		FileExaminer.__init__( self, fileName )

	def dependencies( self ) :

		pipe = os.popen( "ribdepends \"%s\"" % self.getFileName(), 'r' )
		lines = pipe.readlines()
		status = pipe.close()
		if status :
			raise RuntimeError( "Error running ribdepends" )

		goodIdentifiers = [ 's', 't', 'x', 'u', 'c' ]
		files = []
		for line in lines :
			if len( line ) > 4 :
				if line[0]=='[' and line[2:4]=="] " and line[1] in goodIdentifiers :

					files.append( line[4:].strip() )

		result = set()
		for f in files :
			result.add( f )

		return result

FileExaminer.registerExaminer( [ "rib" ], RIBFileExaminer )
예제 #3
0
    def __init__(self, fileName):

        FileExaminer.__init__(self, fileName)
예제 #4
0
# to do the work.
class RIBFileExaminer(FileExaminer):
    def __init__(self, fileName):

        FileExaminer.__init__(self, fileName)

    def dependencies(self):

        pipe = os.popen('ribdepends "%s"' % self.getFileName(), "r")
        lines = pipe.readlines()
        status = pipe.close()
        if status:
            raise RuntimeError("Error running ribdepends")

        goodIdentifiers = ["s", "t", "x", "u", "c"]
        files = []
        for line in lines:
            if len(line) > 4:
                if line[0] == "[" and line[2:4] == "] " and line[1] in goodIdentifiers:

                    files.append(line[4:].strip())

        result = set()
        for f in files:
            result.add(f)

        return result


FileExaminer.registerExaminer(["rib"], RIBFileExaminer)
예제 #5
0
			if len( words )==2 and words[0]==knobName :
				return words[1]

		return default

	def __convertFileName( self, fileName, firstFrame, lastFrame ) :

		m = re.compile( "^(.*)%([0-9]*)d(.*)$" ).match( fileName )
		if m :

			padding = 1
			padder = m.group( 2 )
			if len( padder ) :

				if padder[0]=="0" :
					padding = int( padder[1:] )
				else :
					# if the padding doesn't begin with 0 then
					# nuke seems to pad with spaces. we won't accept
					# spaces in a filename
					raise Exception( "Filename \"%s\" is padded with spaces." % fileName )
			
			fileName = m.group( 1 ) + "#" * padding + m.group( 3 )
		
		if "#" in fileName :
			return fileName + " " + str( IECore.FrameRange( min( firstFrame, lastFrame ), max( firstFrame, lastFrame ) ) )
		else :
			return fileName

FileExaminer.registerExaminer( [ "nk" ], NukeFileExaminer )
    def __convertFileName(self, fileName, firstFrame, lastFrame):

        m = re.compile("^(.*)%([0-9]*)d(.*)$").match(fileName)
        if m:

            padding = 1
            padder = m.group(2)
            if len(padder):

                if padder[0] == "0":
                    padding = int(padder[1:])
                else:
                    # if the padding doesn't begin with 0 then
                    # nuke seems to pad with spaces. we won't accept
                    # spaces in a filename
                    raise Exception("Filename \"%s\" is padded with spaces." %
                                    fileName)

            fileName = m.group(1) + "#" * padding + m.group(3)

        if "#" in fileName:
            return fileName + " " + str(
                IECore.FrameRange(min(firstFrame, lastFrame),
                                  max(firstFrame, lastFrame)))
        else:
            return fileName


FileExaminer.registerExaminer(["nk"], NukeFileExaminer)