Setting MoTemp dir from Environement Variable?


is there a way to set the MoTemp location via Environment Variable or some other way that allows us to do pipeline/system administration?

If not, this would be a HUGE benefit to have in larger studios.

Have you checked out our python guide here?

We don’t have a specific environment variable for the cache, but you can set this up via the Python settings API.

If you want to automate the cache directory via Python, first, you can define the location:

export MOCHA_INIT_SCRIPT="/my_scripts//Mocha/"

This sets the environment variable for the script.

Inside, you can define the settings:

import mocha
real_settings = mocha.Settings(override=False, read_overridden=False)
overridden_settings = mocha.Settings(override=True, read_overridden=True)

#Toggle an override of the Temp Dir setting
real_settings.setValue('FileCacheFolder', '/my_cache/cache/MoTemp')
overridden_settings.setValue('FileCacheFolder', '/my_cache/cache/MoTemp')
checking_settings = mocha.Settings()

As Mary mentions above, you can see how to do this via the Python Scripting guide here (or via the offline PDF in the help menu): Boris FX | Mocha® 2021 Python Scripting Guide

Search for “Adjusting mocha Preferences using mocha.Settings”

You can also edit your preferences file.

The preference you are looking for is FileCacheFolder

1 Like

Thank you Martin and Mary,

I shall try this out :slight_smile: