Loading a new project with footage from command line (linux)

Hey guys,

I’m trying to make a hotkey in nuke on linux (CentOS) that will open mocha with my footage already loaded using the os command line. I’ve tried running “mochapro-4 <filename>” but it just opens mocha normally without the footage. I couldn’t find much on this in the documentation. Anyone know how to do this, or could point me to where more detailed documentation might be?



Hi Sam,

We have this functionality already available as a free Nuke Python plugin:

There’s a slight bug for Nuke 9 (you’ll see some warnings turn up), but we will be releasing a patch for this soon.

In terms of doing it yourself, take a look at the command line interface:

Just make sure you’re calling the right mocha bin file, which by default for V4 on Linux is:

Thanks for the reply! Our mocha bin file is on a server, so I don’t know if that makes a difference. I can’t get the Nuke Python plugin to do anything apart from opening mocha, and manually using the command line does the same. I’ve tried the following command:

" <mocha bin filepath> --in 1 --out 60 --frame-rate 24 <footage filepath>"

I’ve also just tried

“<mocha bin filepath> <footage filepath>”

It just opens mocha without the footage loaded. Any ideas?

I’ve noticed a related issue on Mac; If I right-click a footage file and do “Open with Mocha”, it opens Mocha but does not open the footage. I also can’t drag-drop footage into Mocha to open it. I have to go through the “File…Open” dialogue, which is the slowest way to find footage. It would be nice if one of the two methods above worked instead.

Which versions are you both using?

Sam, i’ve never personally tested launching mocha on another system, so I’m not sure of the behaviour here.
The command line is designed to be launched from the same system the bin is on.

Is the footage also on the server?

Yea, technically everything is on the server here. I can still access the directories like they were local though, since it’s connected through the network.

I’m using mochapro 4. OS is CentOS Release 6.5

Hi Sam,

Are you calling specifically /opt/isl/mochaproV4/bin/mochapro or the mochapro-v4 batch file?

For example:
/opt/isl/mochaproV4/bin/mochapro --frame-rate 30 --par 1.0 --interlace-mode 0 --in 1 ‘/path/to/your/footage/footage_00000.png’

I’m specifically calling the bin, just like your example above. We run RV commands this way all the time off the server and don’t have any issues with it in terms of user permissions.