AWS Thinkbox Discussion Forums

Setting Maya Environment Variables

Hello,



I was wondering if it is possible to have Deadline set Maya Environment variables on a machine before commencing renders on that machine.



For example, we have a series of Maya plug-in directories, and we also have a department that uses Maya but isn’t set to see those directories via the MAYA_PLUG_IN_PATH Environment variable (the other department has it set), but we’re using computers from both departments to render. So it would be useful to be able to set the Maya Env variables on machines that get render tasks (we do this when we use Rush).



I thought the PreRenderTasks.ffs file in the …Repository\plugins\Maya\ directory might be the way to do this, but I’d need to know more about what the PreRenderTasks.ffs file actually does & how to modify it.



Cheers,



-DW

Hi Dean,



The PreRenderTasks.ffs is called before every task that the slave

renders, so this would be the ideal place to add the functionality you

want. The *.ffs files are plain text scripts, so you can add code to

them to do whatever you want. The full plugin scripting documentation

can be found here:

http://software.franticfilms.com/index.aspx?page=deadline/sdk/scriptplugin



If you open up the PreRenderTasks.ffs file in the maya plugin directory,

you’ll see that an environment variable is set when rendering with

Turtle for Maya. In your case, you would want to set the

MAYA_PLUG_IN_PATH variable all the time, so you should add the following

to the very top of the script (hit Enter a few times at the top to make

space):





newPluginPathSetting = “put your path setting here”;

LogInfo( "Setting MAYA_PLUG_IN_PATH environment variable to " …

newPluginPathSetting );

SetEnv( “MAYA_PLUG_IN_PATH”, newPluginPathSetting );





Then save the file and restart the slaves so they recognize the changes.



Hope this helps! If you have any questions or run into any problems, let

us know!



Cheers,

Thanks Ryan…trying it out now…



Cheers,



-DW

Hi Ryan,



I think the error parsing & such isn’t working because I’m submitting the renders via the Command-Line, and not the Maya plugin (although I am invoking the Maya renderer through the Command-Line).



So should I put all the Maya error checking lines & evironment variables setting lines from the files PreRenderTasks.ffs & MayaErrorParsing.ffs into their CommandLine counterparts?



I had a bunch of test files show up as Completed when the Logs for the tasks showed that the Maya scene files were not found, and I know that the Error Parsing has lines in it to pick up the missing scene file errors, so something is amiss.



Cheers,



-DW

Hi Ryan,



I think the error parsing & such isn’t working because I’m submitting the renders via the Command-Line, and not the Maya plugin (although I am invoking the Maya renderer through the Command-Line).



So should I put all the Maya error checking lines & evironment variables setting lines from the files PreRenderTasks.ffs & MayaErrorParsing.ffs into their CommandLine counterparts?



I had a bunch of test files show up as Completed when the Logs for the tasks showed that the Maya scene files were not found, and I know that the Error Parsing has lines in it to pick up the missing scene file errors, so something is amiss.



Cheers,



-DW

Hi Dean,



That would be the reason why the error parsing and such isn’t working.

The CommandLine plugin is intended for generic command line operations,

so any additional features like error checking would have to be added

manually. You should try using the Maya plugin (whether submitting the

job from within Maya or from the Deadline Monitor) to make use of the

changes you made to the Maya plugin script files.



If you’re having any difficulty with the Maya plugin itself, let us know!



Cheers,

Hi Ryan,



I’m using the CommandLine plugin because I have a custom melscript GUI that I’m using to submit, which is munging together a simple render command string.



Is there a way to pass this info to the Maya plug-in instead? I won’t be using the GUIs that FF provides (mel or vb). I’m also willing to modify the CommandLine .ffs files to do the job (assuming I can use much of what I already did in the Maya versions of those files).



Cheers,



-DW

Hi Dean,



You have a few options in this case:


  1. Modify the CommandLine plugin and continue to submit to it.



    This would likely be the easiest solution. The CommandLine plugin

    already has a PreRenderTasks.ffs file, which you could add your

    Environment Variable modifications to. You would have to add the

    MayaErrorParsing.ffs script yourself (just copy it from the Maya plugin

    folder), and then add the following regex handler to CommandLine.dlinit

    (note that I’m using 0 for the regex # because by default, the

    CommandLine plugin doesn’t have any regex handlers yet):



    ; Error message handling

    OutputRegEx0=.Error: .|.Warning: .

    OutputRule0=ExecuteScriptFile( “MayaErrorParsing.ffs” );



    That should be everything you would have to do. If you go this route,

    test it out and let us know how it works.






  2. Have your custom melscript submit to our Maya plugin.



    This difficulty of this option depends on the custom information

    currently being passed to the CommandLine plugin. You would have to

    create the necessary submission files manually, as explained here:

    http://software.franticfilms.com/index.aspx?page=deadline/submission#submissionfiles



    What you could do is see how our Maya submission script (in

    \your\repository\submission\Maya) creates these files and submits them

    to Deadline, and use this as a reference. Here you’ll find how the

    Plugin Info File is created, which is likely where you would want to

    specify your custom information.



    If you decide to go this route, let us know and I can go into greater

    detail then.






  3. Create a new custom plugin that your melscript would submit to.



    This would probably require the most work, but would allow for the

    greatest level of customization. The link below provides a walkthrough

    of how to create a custom plugin, which you could use as a reference to

    create your own.

    http://software.franticfilms.com/index.aspx?page=deadline/sdk/scriptplugin



    If you decide to go this route and have any questions or concerns along

    the way, let us know.







    Hope this helps!



    Cheers,

Thanks Ryan,



I’ll try option #1 and let you know how that goes.



Cheers,



-DW

Hi Ryan,



This question is related, so I’ll keep it in this thread. I need to copy a mental ray rayrc file from one location to each Slave machine before rendering. Would I put a CopyFile line in the PreRenderTasks.ffs file?



Cheers,



-DW

Hi Dean,



Yes, this would be the PreRenderTasks.ffs file would be the appropriate

place to copy the file over. Anything that you would want done before

rendering begins should be a part of the pre-render tasks.



Cheers,

Hi Ryan,



The logs are telling me that the env settings are working, and the error parsing is as well, as the frames are failing with this error:



Exception during render: Script accessed non-existent plugin config key StrictErrorChecking



What should I be looking at to troubleshoot that error?



Cheers,



-DW

Ahh, right, StrictErrorChecking is a plugin configuration option that’s

specific to the Maya plugin. Open up the MayaErrorParsing.ffs file (the

one in your CommandLine plugin directory), and find these 11 lines of

code at the bottom (some of the stuff here may wrap in the post, but

you’ll recognize it as 11 lines in the script file):





if( ToLower(GetPluginConfigEntry(“StrictErrorChecking”)) == false )

{

LogInfo( “Deadline Slave ignoring error: “” … GetRegExMatch(0) …

“” because the plugin setting StrictErrorChecking is set to false.” );

}

else

{

if( ignore )

LogInfo( “Deadline Slave ignoring error: “” … GetRegExMatch(0)

… “” because it is not usually fatal.” );

else

FailRender( GetRegExMatch(0) … “\nThis error was printed by

Maya. If this error message is unavoidable but not fatal to your render,

please email deadline-support@franticfilms.com with the error message,

and change the plugin setting StrictErrorChecking to false.”);

}





You can replace it with the following 4 lines of code:





if( ignore )

LogInfo( “Deadline Slave ignoring error: “” … GetRegExMatch(0) …

“” because it is not usually fatal.” );

else

FailRender( GetRegExMatch(0) );





Then save the file, restart your slave applications, and try to render

again. If you have any problems, let me know!



Cheers,

Worked perfectly.



Thanks again for all your help!



Cheers,



-DW

Privacy | Site terms | Cookie preferences