[Maya/Vray] - Changing output name each frame of animation


Hey all! Got a sort of odd question in regards to rendering with Vray in Maya via Python commands.

I’m building a setup for a spherical interactive piece driven by HTML. I have created code that generates a sphere around an object (with specified U and V segments). Then I have it so the camera travels to each of the verts of the sphere, with an aim constraint at the center of the bounding box of the objects I want to capture…

The problem is that I’d like to submit this via deadline, but the naming conventions for each frame need to be specific and not just frame.001, frame.002, frame.003, etc…

So, how would I change the name of the output to something else other than frame numbers for each frame in the animation where the camera is placed at each vert of the projection sphere per each frame?

I need the names of the output animation to follow this rule (which I’ve programmed and got working when rendering local using the cmd.vrend command to execute each frame render). Desired frame names of the output animation sent to deadline are as followed-

0_1 , 0_2 , 0_3 , 0_4 , 0_5 , 1_0 , 1_1 , 1_2 , 1_3… and so on… The first number represents the U segment the camera is traveling and the second is the V segment. Each of those together provide me with a plug to tell where on the sphere the render took place for processing in an HTML document.

So I have an animation. Camera traversing a sphere’s verts in a predefined, known order, but how do I actively change the name of the output frame to match that order? Thanks for any input, sorry if this was long winded…

If I don’t figure out a solution I’m afraid I’ll be forced to have each frame be it’s own separate render job submitted to deadline as opposed to one render job that is an animation of all the frames. Thank you!


Maya only seems to support basic sequential filenames during a multi-frame render. Rather than change the output name, I’d just generate a python dictionary of maya_ouput_filename: desired_filename pairs, and rename the files post-render via os.path or pymel.util.common.path.


Yeah, that is one option… I’d like to avoid that if possible to make this a one button click sort of solution.

If I were doing the rendering locally, this wouldn’t be an issue, but I’m wanting to send it to Deadline so it needs instructions on what to do on file open.

Currently I’m making headway by using the preRender and preMel command options of Maya. I’m able now to change the file name after each frame when starting up a normal animation. The only issue now is that the output frame does not match the file name I’m generating for it.

All I’m doing is telling maya that before the frame gets rendered, change the output name to something else. I don’t know why it wouldn’t register. Going to try in a fresh Maya scene now to see if I had some backed up stuff stopping it from working. Cheers.


The Mel/Python callbacks section is what I’m using. I thought I had it working, but now the File Name Prefix is sticking to whatever is in the input box originally…

Although I see it changing each frame change (as it should) the output frames are named what was in the original box before rendering… uhhh. Pain in the arse.