tmaduro
Hi Soupers,

I'm trying to cache a fluid sim in batch on OSX and thought one of you FX gurus might help.

This is what I have so far:


maya -batch -file /Users/grfx2/Desktop/FireBatch/scenes/Fire_1.mb -command "
select -r Flame ;

performCreateFluidCache 0 add;
doCreateFluidCache 5 {// bunch of cache attributes I'm too lazy to add, as workstation is walled from internet//};

getFluidDescriptionInfo selected;

/Users/grfx2/Desktop/FireBatch/scenes/Fire_2.mb -save"


The shell results after execute:
-bash maya: command not found

If this was windows workstation I would guess this is a environmental variable issue..
As this was done on macOSX, I'm not entirely sure..
My work workstation gives me very limited permissions as they have draconian security  at this company.

Anyone point me in the right direction?
Many thanks ahead of time for responses.

Reply 0 0
noizfactory
I don't use OSX but this definitely looks like a environment issue like you already guessed. Maya app is probably not declared in the PATH variable. Not near a PC right now but the command that you're passing and the syntax look fine. If there are permission issues then you could probably just do export PATH in the terminal itself and then run your batch command.
Reply 0 0
tmaduro
Sachin, Thanks so much for your response.
Can you clarify what you mean by "do export path in terminal"..
Thanks

I have tried navigating to the executables path via terminal before running the command.
Example:

cd /Applications/Autodesk/maya2014/Maya.app/Contents/bin/

then I ran the command:

maya -batch -file /Users/grfx2/Desktop/FireBatch/scenes/Fire_1.mb -command "
select -r Flame ;

performCreateFluidCache 0 add;
doCreateFluidCache 5 {// bunch of cache attributes I'm too lazy to add, as workstation is walled from internet//};

getFluidDescriptionInfo selected;

/Users/grfx2/Desktop/FireBatch/scenes/Fire_2.mb -save"
Reply 0 0
pshipkov
Just wanted to mention something here.
I think you should fallow the "rule of thumb" when dealing with mayabatch.
The rules says - use mayapy. :)
Reply 0 0
tmaduro
Did a bit of search on mayapy - I suppose its some type of environment were I can use python to run maya without gui....

Thanks Peter for the tip...
This is all a bit over my head, as my primary concerns at work tend to be creative...I can usually get as far as copying snippets of mel from my script editor..and chaining them together....I'm also a bit better with maya in windows. I've set env variables in win 100s of times..Not crazy about maya on OSX.

I'm in awe of all of you can really dig into maya and bend it to your will :)

Forgive my ignorance 
Perhaps there is someone in soup community that can shed a bit more light on all of this.
Thanks
Reply 0 0
pshipkov
Hmm, if you know where the maya executables are located, you navigated to there, ran "maya -batch" and that didn't work then this looks like a problem for the system guys.

try to run "mayapy" from the same location.
Reply 0 0
tmaduro
Looks like you're correct peter..
running mayapy from executable directory..I get build copyright and credits info...indicating a successful startup of the mayapy ..

However running mayabatch give:

w
dyld: Library not loaded: @executable_path/libMaya.dylib
Referenced from: /Applications/Autodesk/maya2014/Maya.app/Contents/bin/mayabatch
Reason: image not found

g
time to get systems guys on the case
Reply 0 0
noizfactory
I don't think mayabatch runs on OSX or Linux. If you're able to run mayapy from the executable directory then you can run your original command as well from there. As for my first comment, what I meant was you could set the environment variable in the terminal first before running your command. On OSX you'd do :
export YOUR_VARIABLE_NAME=YOUR_PATH
This is just an alternative to actually navigating to the executable path.
Reply 0 0
pshipkov
It does :)
Reply 0 0
tmaduro
Thanks guys...your help is greatly appreciated
Reply 0 0
noizfactory
pshipkov wrote:
It does :)


Not an OSX user but yes, we do run mayabatch on Linux :) The doc for some reason explicitly mentions using mayabatch on Windows and maya -batch on OSX or Linux but I guess that's Autodesk!

Quote:
Maya can be run in several distinct modes that affect its overall manner of operation, two of which allow you to execute Maya commands without the interface, -prompt and -batch (on Windows, use mayabatch.exe instead of maya -batch).


Does mayapy consume a license and do you usually run all batch operations using this instead of mayabatch? I've often heard this mentioned by other users too but never got around to exploring it.


Reply 0 0
animatedfox
For what its worth, I found troubleshooting any kind of real command building in maya batch very annoying. We run Linux here but I think this still would apply on your end. If I want to do anything in batch mode I build a script node in the scene and submit it to just run the script node command.
The general idea is a command like this.
maya -batch -file /tempScene.mb -command setProject /projectDir/ ; scriptNode -eb myScriptNode;

True, you need the scene open to submit it to batch mode...so maybe not what you are looking for. But the benefit is that scriptNodes have a button that allow you to test your script which is great for setting things up...and could help you avoid calling some of those commands from the command line.

Just a little thought.
~Ben

Reply 0 0
tmaduro
Thanks animated fox...this is helpful. Not just for running batches.
Reply 0 0
Reply