Maya: Keep job scene open between tasks

Feature requests discussion.
Post Reply
brother john
Posts: 16
Joined: Sun Feb 19, 2017 9:06 pm

Maya: Keep job scene open between tasks

Post by brother john »

Background: We use both Afanasy and Deadline in our studio. We all prefer Afanasy. Deadline tries to be too tricky, and from an admin POV, deadline is is far more error prone.
At least 1 day every week we have this scenario:
Artist: "My deadline shot is getting errors!"
ME: "Just submit with Afanasy", and the job goes though without any problems!
So why do you use dealine at all, you may ask...
Well, for one single feature, that it keeps the maya scene open during tasks. So the overhead of scene loading (network bandwidth and time) is reduced to 1 load per blade. And since some of our load times can be quite high (multiplied by x blades), this feature is fantastic because it is makes the job go through much faster and doesn't put any strain on the network.
"Why not just send the job in with multiple frames per task?". We do try that, but it mostly ends with 1 or 2 blades finishing off the last frames and we have to wait hours for that to finish anyway. So for small shots that can work, but big shots, there are often no gains. With the 'keep maya open' scenario, the gains can be significant.

So it seems there are (at least) 2 ways of achieving this within Maya. Both work like this... open a terminal, launch Maya in batch/prompt mode, then send it commands like load scene, then render this frame etc... then it just sits there waiting for more commands:
"mayapy" and "mayabatch -prompt"

For mayapy.exe I got it to the point of loading the scene, setting first and last frames then rendering through vray, but assume all render engines would have similar functionality:

Code: Select all

"C:\Program Files/Autodesk/Maya2023/bin/mayapy.exe"
import maya.standalone
maya.standalone.initialize()
import maya.cmds as cmds
cmds.workspace('w:/FLUX_2021/FLU21002_farmTests/software/maya/', o=True)
cmds.file('w:/FLUX_2021/FLU21002_farmTests/software/maya/scenes/yeti01.mb',open=True,force=True)
cmds.loadPlugin('vrayformaya')
cmds.setAttr("defaultRenderGlobals.startFrame", 2)
cmds.setAttr("defaultRenderGlobals.endFrame", 4)
cmds.vrend(camera='persp')
Timur, can you see this being able to work within the Afanasy infrustructure?
User avatar
timurhai
Site Admin
Posts: 916
Joined: Sun Jan 15, 2017 8:40 pm
Location: Russia, Korolev
Contact:

Re: Maya: Keep job scene open between tasks

Post by timurhai »

Hello!
It can works via Python API.
Houdini and Nuke work in CGRU this way, but soft starts and stops each task.
Who will start and stop soft before and after a group for tasks?
Timur Hairulin
CGRU 3.3.1, Ubuntu 20.04, 22.04, MS Windows 10 (clients only).
brother john
Posts: 16
Joined: Sun Feb 19, 2017 9:06 pm

Re: Maya: Keep job scene open between tasks

Post by brother john »

Thanks for the reply Timur. Yeah I was wondering if this would be the problem area. I was hoping CGRU has some function that would handle it? If not, I will think some more about it.
User avatar
timurhai
Site Admin
Posts: 916
Joined: Sun Jan 15, 2017 8:40 pm
Location: Russia, Korolev
Contact:

Re: Maya: Keep job scene open between tasks

Post by timurhai »

No there is no such function "out-of-the-box".

May be the task can have several stages:
1. Check that Maya application is launched, if not - launch it.
2. Check that needed scene is opened, if not open it.
3. Render specified frame(s).
This can be done by some Python script(s) that can contain stand-alone python and maya-api python parts.
On job deletion or job done event, we ask to close Maya on the entire farm - if it not used by other job.

The advantages of this way is that it is not connected to cgru/afanasy.
We can check this scripts by hand.
We can use it with other render manager, or even without any.

ps
It can be even a separated open-source project that can be supported by users that are not using CGRU.
Timur Hairulin
CGRU 3.3.1, Ubuntu 20.04, 22.04, MS Windows 10 (clients only).
Post Reply