Fix git merge issue

Instead of creating a 'Tinyblast' button bellow the other Playblast Options buttons, 'Playblast' button is now replaced with 'Tinyblast' and uses the custom_playblast function
This commit is contained in:
Jack 2024-09-27 23:16:23 -04:00
parent 571a600964
commit d1171829dc
1 changed files with 5 additions and 20 deletions

View File

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