Hi all.
I was wondering if it’s possible and How setting dynamic environement on a maya job submission?
thanks
Hi all.
I was wondering if it’s possible and How setting dynamic environement on a maya job submission?
thanks
Do you mean things like custom environment variables? Or plugin synchronization? You can probably create a PreLoad.py script for the MayaBatch and MayaCmd plugins, but it might help if you could provide more specifics on what you would like to achieve.
Here is some info on creating a PreLoad.py script:
thinkboxsoftware.com/deadlin … -_Optional
Cheers,
Ok sorry for that,
I mean custom environment variables.
Actually I am lauching my job in python, and I declare all my variables just before launching my mayaBatch command.
I would like to do the same stuff inside deadline with the mayaCmd and the mayaBatch.
We can’t use the preaload script because the mayaBatch load the script after sourcing all the plugin, and shading etc…
Hope it’s clear. My english is not very good.
thanks for evrythings.
Thanks for the additional info! Could you perhaps use Maya’s pre/post MEL scripts to do this?
That way, nothing has to be tweaked on Deadline’s end, and you can set up your environment on a per-scene basis.
Cheers,
Thanks for you reply
No I can’t using pre-render mel and all the other possibility as post pre-render … because, those script are loaded after maya opening.
What I want to do is to set all the environements before maya open. This is the only wait to have the good plugin and scripts paths.
in batch mode actually I wrote a small python script to set my environement and after that laoding maya:
import os
os.environ[‘PYTHONPATH’] = ’ the PATH ’
os.environ[‘MAYA_FILE_ICON_PATH’] = ’ the PATH ’
os.environ[‘MAYA_PLUG_IN_PATH’] = ’ the PATH ’
os.environ[‘MAYA_SCRIPT_PATH’] = ’ the PATH ’
os.environ[‘MI_CUSTOM_SHADER_PATH’] = ’ the PATH ’
os.environ[‘MI_LIBRARY_PATH’] = ’ the PATH ’
os.environ[‘MAYA_MRFM_SHOW_CUSTOM_SHADERS’] = ’ the PATH ’
os.environ[‘PYTHON_SCRIPT_PATH’] = ’ the PATH ’
os.system('render -r mr -proj ’ the PATH ’ -rd ’ the PATH ’ ’ the PATH ')
whith this way all my renderer nodes are set dynamically
I would like to reproduce the same stuff with the mayaBatch.
mathieu
The PreLoad.py script I referred to earlier is executed before Maya is loaded, and therefore it’s executed prior to any rendering occurring. All your PreLoad.py script would do is call the following inside a main function:
[code]import os
def main( *args )
os.environ[‘PYTHONPATH’] = ’ the PATH ’
os.environ[‘MAYA_FILE_ICON_PATH’] = ’ the PATH ’
os.environ[‘MAYA_PLUG_IN_PATH’] = ’ the PATH ’
os.environ[‘MAYA_SCRIPT_PATH’] = ’ the PATH ’
os.environ[‘MI_CUSTOM_SHADER_PATH’] = ’ the PATH ’
os.environ[‘MI_LIBRARY_PATH’] = ’ the PATH ’
os.environ[‘MAYA_MRFM_SHOW_CUSTOM_SHADERS’] = ’ the PATH ’
os.environ[‘PYTHON_SCRIPT_PATH’] = ’ the PATH '[/code]
If that won’t work, then I must be missing something…
I thought you meant that you wanted your script to run after maya is loaded, which is why I recommended the pre/post MEL scripts.
Cheers,