This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from PySide2 import QtWidgets | |
def GetNukeMainWindow(): | |
"""Finds and returns the main Nuke window. | |
Iterates through all top-level widgets, checking for the Nuke main window | |
based on its class name. | |
Returns: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sys | |
import os | |
from PyQt5 import QtWidgets, QtCore | |
def restart_app_with_new_scale_factor(scale_factor: float): | |
"""Restarts the application with a new scale factor by setting the QT_SCALE_FACTOR environment variable. | |
Args: | |
scale_factor (float): The new scale factor to apply to the application's UI. | |
""" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from PyQt5 import QtCore, QtGui, QtWidgets | |
class EffectsDemo(QtWidgets.QWidget): | |
def __init__(self): | |
super().__init__() | |
self.initUI() | |
def initUI(self): | |
self.setGeometry(300, 300, 240, 200) | |
self.setWindowTitle('PyQt5 Button Graphics Effects Demo') |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
Copyright (C) 2024 promto-c | |
Permission Notice: | |
- You are free to use, copy, modify, and distribute this software for any purpose. | |
- No restrictions are imposed on the use of this software. | |
- You do not need to give credit or include this notice in your work. | |
- Use at your own risk. | |
- This software is provided "AS IS" without any warranty, either expressed or implied. | |
Note: This code is intended primarily as an example. While you can use it freely as described above, be aware that it utilizes PyQt5, which is licensed under GPL v3. Ensure you adhere to PyQt5's licensing terms when using or distributing this code. | |
""" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
Copyright (C) 2024 promto-c | |
Permission Notice: | |
- You are free to use, copy, modify, and distribute this software for any purpose. | |
- No restrictions are imposed on the use of this software. | |
- You do not need to give credit or include this notice in your work. | |
- Use at your own risk. | |
- This software is provided "AS IS" without any warranty, either expressed or implied. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import nuke | |
import csv | |
# Constant for the number of columns per track in Tracker4 node | |
COLUMNS_PER_TRACK = 31 | |
CSV_HEADERS = ['Track Name', 'Frame', 'X', 'Y'] | |
def get_total_tracks_count(tracks_knob): | |
"""Calculate the number of tracks based on the tracks knob. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
Copyright (C) 2024 promto-c | |
Permission Notice: | |
- You are free to use, copy, modify, and distribute this software for any purpose. | |
- No restrictions are imposed on the use of this software. | |
- You do not need to give credit or include this notice in your work. | |
- Use at your own risk. | |
- This software is provided "AS IS" without any warranty, either expressed or implied. | |
""" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import re | |
from typing import Dict | |
def extract_file_details(input_string: str) -> Dict[str, str]: | |
"""Extracts directory name, file name, frame start, frame end, and extension from the input string. | |
Args: | |
input_string: A string in the format 'path/to/plates/plates_name.[1001-1017].ext' | |
Returns: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sys | |
from PyQt5 import QtWidgets, QtCore | |
import keyring | |
class LoginWidget(QtWidgets.QWidget): | |
def __init__(self): | |
super().__init__() | |
self.initUI() | |
self.load_credentials() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sys | |
from pathlib import Path | |
from PyQt5 import QtCore, QtWidgets | |
class StreamLogger: | |
"""A logger for streaming output to both the terminal and a log file. | |
Attributes: | |
terminal: A file object representing the standard output. | |
log: A file object for the log file where output is also written. |