AWS Thinkbox Discussion Forums

global job properties queried from within mayabatch

Hi there,

In a script job, i can currently query DataFileName, PluginDirectory, JobsDataDiretory (note the typo btw!!), StartFrame, EndFrame, ThreadNumber.

Is it possible to query other globals, such as, first frame of the whole job, last frame of the whole job, frame list, etc? So not just the job info stuff, but deadline controlled props.

cheers,
laszlo

Thanks for pointing out that typo! It will be fixed in beta 12.

All of the stuff in the plugin info file can be accessed from the melscript using the global DeadlinePluginInfo function. So if you store this extra stuff in your plugin info file on submission, you’ll be able to pull it from your script.

We could probably look at explicitly exposing things like the job’s pool, group, priority, name, frame list, etc. However for something like the first frame of the job, you should store this in the plugin info file because the job doesn’t actually store this as a separate value. Yes, you could parse it from the job’s frame list, but it might just be easier to set this yourself.

Cheers,

  • Ryan

I ended up modifying the mayabatch code to add frame lists there as well.

The main concern with trusting the job info file, is that that file does not reflect any changes done to the job post submission. For example, one of the things we do on deadline is caching out heavy scenes. Each frame represents a group of rigs. If an artist by accident does not set up his job right, a scene with 400 rigs could end up rendering on a single box.

So i wanted to add the ability to be able to change the frame range via deadline, and thus notify our caching script that “ok, now i have 10 frames total in the job, i am rendering frame 2, that means i should only cache the second 1/10th of the rigs in the scene”.

I have added:

        scriptBuilder.AppendLine("      case \"ThreadNumber\" : return \"" + str(self.GetThreadNumber()) + "\"; break;")

scriptBuilder.AppendLine(" case “JobFrames” : return “” + job.JobFrames + “”; break;")
scriptBuilder.AppendLine(" }")

And am parsing the JobFrames value in the script job.

My question was more related to whether these job properties are somehow natively exposed while in the mayabatch session, or we would need to add exposure to them ourselves. (there is such a nice python interface to deadline, but im not sure if that works at all in a python script that’s running in mayabatch)

They are not natively exposed. As you’ve seen, we’re just defining global functions in melscript code and then executing that code in the mayabatch session so that you can query those properties.

Privacy | Site terms | Cookie preferences