iobs
iobs

Reputation: 47

Maya python : TypeError: coercing to Unicode: need string or buffer, int found

I'm trying to make a little script for batch rending for maya and every time I have this error at the line for i in xrange((startFrame)+"," +(endFrame) + int(1)): : in Batch # TypeError: coercing to Unicode: need string or buffer, int found

the code :

def Batch(ignore):
    # Settings
    startFrame = cmds.textField (myStart, query=True, text=True)
    endFrame   = cmds.textField (myEnd,   query=True, text=True)
    Camera     = cmds.textField (myCamera,query=True, text=True)

    for i in xrange((startFrame)+"," +(endFrame) + int(1)):
        maya.cmds.currentTime(i)
        mel.eval('execRmanMenuItem("Render");')
        editor = 'renderView'

I'll be very thankful if someone could help me.

Upvotes: 1

Views: 1467

Answers (1)

Netwave
Netwave

Reputation: 42786

Python xrange takes ints as parameters not strings,

This should solve it:

for i in xrange(int(startFrame), int(endFrame)+1):
    ...

Upvotes: 1

Related Questions