Maya python : TypeError: coercing to Unicode: need string or buffer, int found
Maya python : TypeError: coercing to Unicode: need string or buffer, int found
我正在尝试为 Maya 批量渲染制作一个小脚本,但每次我在 for i in xrange((startFrame)+"," +(endFrame) + int(1)):
行出现此错误:
在批次中 # TypeError: coercing to Unicode: need string or buffer, int found
代码:
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'
如果有人能帮助我,我将不胜感激。
Python xrange
将整数作为参数而不是字符串,
这应该可以解决:
for i in xrange(int(startFrame), int(endFrame)+1):
...
我正在尝试为 Maya 批量渲染制作一个小脚本,但每次我在 for i in xrange((startFrame)+"," +(endFrame) + int(1)):
行出现此错误:
在批次中 # TypeError: coercing to Unicode: need string or buffer, int found
代码:
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'
如果有人能帮助我,我将不胜感激。
Python xrange
将整数作为参数而不是字符串,
这应该可以解决:
for i in xrange(int(startFrame), int(endFrame)+1):
...