Set Frame As

SetFrameAs.py is a Nuke Python script that provides a user-friendly modal dialog to set the "start at" frame for selected Read Nodes. Accessible via Custom Menu, it allows users to input a custom frame number, defaulting to the project's first frame. The script checks for valid Read nodes and their required knobs (frame_mode and frame), applying the specified frame value if the user confirms via the "OK" button.
Error messages are displayed for invalid selections or missing knobs.
This tool streamlines frame adjustments for Read nodes, enhancing workflow efficiency in Nuke's GUI environment.

First submitted: 24 August 2025

Author: MinnazRehman

Compatible Nuke versions: 7.0 or later

Compatibility: Source

Installing SetFrameAs.py in Nuke

This guide explains how to install the SetFrameAs.py script in your Nuke setup and add it to a custom menu bar in the .nuke folder.

Installation Steps

  1. Locate or Create the .nuke Folder

    • The .nuke folder is Nuke's user configuration directory, typically located in your home directory:

      • Windows: C:\Users\<YourUsername>\.nuke

      • MacOS: /Users/<YourUsername>/.nuke

      • Linux: /home/<YourUsername>/.nuke

  2. Place the Script in the .nuke Folder

    • Copy the SetFrameAs.py script.

    • Place SetFrameAs.py directly in the .nuke folder.

    • Ensure the file name is exactly SetFrameAs.py.

  3. Create or Edit menu.py

    • In the .nuke folder, locate or create a file named menu.py.

    • Open menu.py in a text editor.

  4. Add the Custom Menu Bar Entry

    • Add the following code to menu.py to create a "Custom Tools" menu and add the SetFrameAs command:

      import nuke
      # Create or access the Custom Tools menu
      Custom_Tools = nuke.menu('Nuke').addMenu('Custom Tools')
      # Add Set Frame As command, referencing the function in SetFrameAs.py
      Custom_Tools.addCommand('Set Frame As', 'set_frame_as.set_frame_as()')
      
    • Note: The command assumes SetFrameAs.py defines the set_frame_as function. The set_frame_as.set_frame_as() syntax works because Nuke automatically loads Python scripts from the .nuke folder, making the module and function available.

  5. Save and Test in Nuke

    • Save the menu.py file.

    • Launch Nuke or restart it if already open.

    • In Nuke's menu bar, navigate to Custom Tools > Set Frame As.

    • Select one or more Read nodes, then select the menu item to open a dialog where you can set the start frame.

Notes

  • Ensure SetFrameAs.py is in the .nuke folder, as Nuke automatically loads Python scripts from this directory.

  • If the menu item doesn't appear, verify the menu.py syntax and ensure SetFrameAs.py is correctly named and placed.

  • The script's pop-up dialog box will automatically load the first frame from project settings and you can change that to custom frame number.

Sign in or register to download or rate.