Starting in December, we will archive content from the community that is 10 years and older. This FAQ provides more information.
Hi,
our scripts before were setting the render file name prefix with python from the scene name, but lately it doesn't work anymore. Can you tell me how to achieve that please?
Many thanks
Hi!
That depends on how the render gets triggeret in the script. Would you mind posting the code snipped that names the rendered files and starts the render?
cmds.setAttr('defaultRenderGlobals.imageFilePrefix', '<RenderLayer>/<Version>/%s_%s_%s_<RenderLayer>_<Version>'%(project,seq,sceneName), type='string')
For some reason it was working all the time before, and not anymore. I am wondering if a change in the maya api has affected this, I know new tokens were introduced as well at some point.
Hi!
The code you posted works. But depending on what renderengine you are using, the acutal renderer could overwrite the name. Did you change anything in that regard?
Also I can't see the way you are defining your "sceneName" variable, since that one seems to be the one causing problems. When I need the scene name as a variable I usually use the os library to do so. Something like this:
import maya.cmds as cmds
import os
filepath = cmds.file(q=True, sn=True)
filename = os.path.basename(filepath)
sceneName, extention = os.path.splitext(filename)
Are there any specific errors you get when you try to rename your file prefix?
Can't find what you're looking for? Ask the community or share your knowledge.