Page 1 of 1

Maya: Keep job scene open between tasks

Posted: Wed Sep 06, 2023 1:59 am
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
import maya.cmds as cmds
cmds.workspace('w:/FLUX_2021/FLU21002_farmTests/software/maya/', o=True)
cmds.setAttr("defaultRenderGlobals.startFrame", 2)
cmds.setAttr("defaultRenderGlobals.endFrame", 4)
Timur, can you see this being able to work within the Afanasy infrustructure?

Re: Maya: Keep job scene open between tasks

Posted: Thu Sep 07, 2023 10:11 am
by timurhai
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?

Re: Maya: Keep job scene open between tasks

Posted: Thu Sep 14, 2023 3:50 am
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.

Re: Maya: Keep job scene open between tasks

Posted: Thu Sep 14, 2023 8:36 am
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.

It can be even a separated open-source project that can be supported by users that are not using CGRU.