Skip to content
This repository has been archived by the owner on Sep 20, 2024. It is now read-only.

Nuke: Custom script to set frame range of read nodes #5039

Merged

Conversation

moonyuet
Copy link
Member

@moonyuet moonyuet commented May 26, 2023

Changelog Description

Adding option to set frame range specifically for the read nodes in Openpype Panel. User can set up their preferred frame range with the frame range dialog, which can be showed after clicking Set Frame Range (Read Node) in Openpype Tools

Additional info

Settings:
image

Dialogs:
image

make sure you always choose to use selection(whether you use selected read node or not) before inserting the number of preferred frame range, otherwises it wont work as expected,

Testing notes:

  1. Launch Nuke via Openpype
  2. Create Multiple Read Nodes
  3. Go to Openpype Tools > Set Frame Range(Read Node)
  4. It will show a frame range dialog
  5. Choose you use the selection
  6. Set your frame range
  7. Hit "Execute"
  8. Set up the frame range in the read nodes.

@ynbot
Copy link
Contributor

ynbot commented May 26, 2023

Task linked: OP-6020 Nuke: custom setFrameRange script

@ynbot ynbot added size/S Denotes a PR changes 100-499 lines, ignoring general files type: enhancement Enhancements to existing functionality host: Nuke labels May 26, 2023
@moonyuet moonyuet requested a review from jakubjezek001 May 29, 2023 09:38
@mkolar mkolar added the sponsored Client endorsed or requested label May 29, 2023
@64qam
Copy link
Member

64qam commented May 30, 2023

The changed frames are not reflected in read nodes. E.g when I change the frame to 997-1024 (original frame 997-1034) the read node stays on 997-1034.
image

@jakubjezek001
Copy link
Member

Please lets move this code outside of host api. This suppose to be a custom script run from OpenPype Tools menu. So it needs to be self contained module living in openpype\hosts\nuke\startup. It should be added to Nuke settings here project_settings/nuke/scriptsmenu/definition as new item.

Copy link
Member

@jakubjezek001 jakubjezek001 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

need to be added to OpenPype Tools items

@moonyuet moonyuet requested a review from jakubjezek001 May 30, 2023 14:13
@moonyuet
Copy link
Member Author

need to be added to OpenPype Tools items

i have updated code and changelog. and the panel is now in OP Tools in nuke

@64qam
Copy link
Member

64qam commented May 31, 2023

Now, when I hit Set frame range in Openpype Tools menu it crashes with error:

  File "C:\Users\qam\code\OpenPype\openpype\vendor\python\common\scriptsmenu\action.py", line 135, in run_command
    exec(self.process_command())
  File "<string>", line 1, in <module>
ImportError: No module named startup```

@moonyuet
Copy link
Member Author

Now, when I hit Set frame range in Openpype Tools menu it crashes with error:

  File "C:\Users\qam\code\OpenPype\openpype\vendor\python\common\scriptsmenu\action.py", line 135, in run_command
    exec(self.process_command())
  File "<string>", line 1, in <module>
ImportError: No module named startup```

can you show me your script menu definition from nuke host in Openpype setting?

@64qam
Copy link
Member

64qam commented May 31, 2023

Now, when I hit Set frame range in Openpype Tools menu it crashes with error:

  File "C:\Users\qam\code\OpenPype\openpype\vendor\python\common\scriptsmenu\action.py", line 135, in run_command
    exec(self.process_command())
  File "<string>", line 1, in <module>
ImportError: No module named startup```

can you show me your script menu definition from nuke host in Openpype setting?

    {
        "type": "action",
        "sourcetype": "python",
        "title": "OpenPype Docs",
        "command": "import webbrowser;webbrowser.open(url='https://openpype.io/docs/artist_hosts_nuke_tut')",
        "tooltip": "Open the OpenPype Nuke user doc page"
    },
    {
        "type": "action",
        "sourcetype": "python",
        "title": "Set Frame Range (Read Node)",
        "command": "from openpype.hosts.nuke.startup import custom_popup;from openpype.hosts.nuke.startup.custom_popup import get_main_window;custom_popup.CustomScriptDialog(parent=get_main_window()).show();",
        "tooltip": "Set Frame Range for Read Node(s)"
    }
]```

@moonyuet moonyuet requested a review from jakubjezek001 May 31, 2023 16:17
@moonyuet
Copy link
Member Author

Updated the changelog and the code for creating dialog through nukescripts instead of Qt.

@jakubjezek001 jakubjezek001 requested review from 64qam and BigRoy June 1, 2023 10:44
@jakubjezek001 jakubjezek001 merged commit bea6cd2 into develop Jun 1, 2023
@jakubjezek001 jakubjezek001 deleted the enhancement/OP-6020_Nuke-custom-setFrameRange-script branch June 1, 2023 19:36
@ynbot ynbot added this to the next-patch milestone Jun 1, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
host: Nuke size/S Denotes a PR changes 100-499 lines, ignoring general files sponsored Client endorsed or requested type: enhancement Enhancements to existing functionality
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

6 participants