Installation and Configuration Guide for Linux® Workstations
Installation and Configuration Guide for Linux® Workstations
Installation and Configuration Guide for Linux® Workstations
Create successful ePaper yourself
Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.
functions are referred to as “hooks”. You can enter Python comm<strong>and</strong>s directly inside these functions, or<br />
use the functions to call an external script or executable.<br />
NOTE To be able to run shell comm<strong>and</strong>s or external script using the os.system Python statement, add the<br />
following line in the hook.py script, be<strong>for</strong>e the definition of the first hook:<br />
import os<br />
Note the following about hook functions:<br />
■ Functions in hook.py receive certain predefined parameters from the application. These parameters<br />
contain specific details on the event that occurred in the application, <strong>for</strong> example, the name of the project<br />
loaded. Use these details to better customize the response action.<br />
■ Functions in hook.py are executed in a separate thread from the application. Thus, the application does<br />
not wait <strong>for</strong> a hook function to complete.<br />
■ When a function is called by the application, it executes with the privileges of the user account from<br />
which the application was launched. Make sure your custom code in the hook.py file does not call external<br />
scripts or executables that require more elevated user privileges.<br />
■ Functions do not return any value to the application that called them. Thus, the application cannot<br />
provide any feedback on whether your custom code executed properly or not.<br />
■ Actions defined in the hook.py file <strong>for</strong> one version of an application are not automatically used by other<br />
versions or applications. To carry your code over to another application or version, you must manually<br />
copy your customized hook.py file into the python subdirectory of that application’s home directory.<br />
This chapter describes the functions available in the hook API. More functions may be added by Autodesk<br />
in subsequent versions. Check the latest hook.py file after installing new versions of the software, to see any<br />
new functions that may have been added.<br />
NOTE You must be logged in as root to edit the hook.py file.<br />
void projectChanged(string projectName)<br />
This hook is called by the Visual Effects <strong>and</strong> Finishing application when the project is changed in the Project<br />
Management section of the Preferences menu. This hook is not triggered when a project is loaded at<br />
application start-up.<br />
This function receives the following parameter from the application.<br />
projectName A string that specifies the name of the loaded project. For example, My Project.<br />
Usage example:<br />
def projectChanged(projectName):<br />
print projectName<br />
When the project is changed in the application, this example function outputs the name of the project in<br />
the application terminal.<br />
void previewWindowConfigChanged(string description, int width, int height, int bitDepth, string<br />
rateString, string synchString)<br />
This hook is called by the Visual Effects <strong>and</strong> Finishing application when the video preview timing is changed<br />
in the software.<br />
Advanced <strong>Configuration</strong> <strong>and</strong> Troubleshooting | 53