Actions (using external Python files)


Overview

  • Python scripts can be used to generate and display text tailored to the situation

  • This example shows how to output action information in combination with the Actions Attribute of the RenderOverride node

    ActionsResult

    The text display can be switched as shown in the upper right corner.


Project file


Process

1. Actions Attribute Settings

  • Add information to the Actions attribute

    ActionsAttr

    Enter ActionName/ StartFrame/ EndFrame

2. Preparing Python Scripts

  • This time, we will use the actions.py provided by the plugin

    • The Python files are installed in C:/ProgramData/Autodesk/ApplicationPlugins/RenderOverride/Contents/plug-ins/[OS-MAYA VERSION]/python/actions/.

    • The PYTHONPATH is passed when RenderOverride is loaded, so you can use it right away.

      • (If you want to run your own Python code, it is recommended that you use PYTHONPATH or similar to pass it through.)

3. Setting Text Attributes

  1. Check Enable of Text.

  2. Set Generate Type of Text to Python.

  3. Enter the following code in the Text String Attribute

    import actions;actions.actions_text()
    
    TextAttr
    • You can also enter code by right-clicking on the text box and selecting Python: Actions.

      TextRightClicked

4. Check display

  • Play the timeline, and if the display changes to look like the text in the upper right corner of the next video, you have succeeded.

    ActionsResult