diff --git a/tinyblast.py b/tinyblast.py index 115bc22..bf291d2 100644 --- a/tinyblast.py +++ b/tinyblast.py @@ -6,14 +6,11 @@ import os import subprocess import sys -<<<<<<< HEAD from shiboken6 import wrapInstance from PySide6 import QtWidgets playblast_job_id = None -======= ->>>>>>> b58b2ef4229368607d47e3706a478b303ffda410 def get_plugin_directory(): # Get the path of the currently loaded plugin plugin_name = "tinyblast" @@ -95,7 +92,6 @@ class WindowWatcher: if self.on_close_callback: self.on_close_callback() -<<<<<<< HEAD def find_button_by_label(window, label_text): for widget in window.findChildren(QtWidgets.QPushButton): if widget.text() == label_text: @@ -114,7 +110,6 @@ def override_playblast_button(): def setup_script_job(): global playblast_job_id -======= def get_window_by_title(self, title): # Check all open windows and return the one that matches the title windows = cmds.lsUI(windows=True) @@ -148,12 +143,13 @@ def get_playblast_options_window(): # Check if the Playblast Options window is open windows = cmds.lsUI(windows=True) for window in windows: - if cmds.window(window, query=True, title=True) == "Playblast Options": # Exact title match - return window + if cmds.window(window, query=True, title=True) == "Playblast Options": + window_ptr = omui.MQtUtil.findWindow(window) + return wrapInstance(int(window_ptr), QtWidgets.QWidget) return None -def setup_script_job(playblast_job_id): ->>>>>>> b58b2ef4229368607d47e3706a478b303ffda410 +def setup_script_job(): + global playblast_job_id # Kill any previously running scriptJob if playblast_job_id is not None and cmds.scriptJob(exists=playblast_job_id): cmds.scriptJob(kill=playblast_job_id, force=True) @@ -175,34 +171,23 @@ class Tinyblast(ompx.MPxCommand): ompx.MPxCommand.__init__(self) def doIt(selfself, args): -<<<<<<< HEAD print("So I started blastin'.") custom_playblast() def tinyblast_cmd(): -======= print("Executing custom playblast command.") custom_playblast() def tinyblastCmd(): ->>>>>>> b58b2ef4229368607d47e3706a478b303ffda410 return ompx.asMPxPtr(Tinyblast()) def initializePlugin(mobject): global playblast_job_id try: -<<<<<<< HEAD mplugin = ompx.MFnPlugin(mobject, "Jack Christensen", "1.1.0", "Any") mplugin.registerCommand("tinyblast", tinyblast_cmd) om.MGlobal.displayInfo("Tinyblast plugin loaded.") setup_script_job() -======= - mplugin = ompx.MFnPlugin(mobject, "Jack Christensen", "1.0.1", "Any") - mplugin.registerCommand("tinyblast", tinyblastCmd) - om.MGlobal.displayInfo("Tinyblast plugin loaded.") - playblast_job_id = None - setup_script_job(playblast_job_id) ->>>>>>> b58b2ef4229368607d47e3706a478b303ffda410 except Exception as e: om.MGlobal.displayError(f"Failed to initialize plugin: {str(e)}") raise