Fix for Maya hanging on boot
This commit is contained in:
parent
da629d82be
commit
9b0821c32e
11
tinyblast.py
11
tinyblast.py
|
@ -15,9 +15,6 @@ from PySide6.QtWidgets import QMainWindow, QFileDialog
|
||||||
from PySide6.QtCore import QCoreApplication, QSettings
|
from PySide6.QtCore import QCoreApplication, QSettings
|
||||||
import shiboken6
|
import shiboken6
|
||||||
|
|
||||||
# Global variable to store the scriptJob ID
|
|
||||||
playblast_job_id = None
|
|
||||||
original_playblast = cmds.playblast
|
|
||||||
tinyblast_instance = None
|
tinyblast_instance = None
|
||||||
|
|
||||||
def get_plugin_directory():
|
def get_plugin_directory():
|
||||||
|
@ -27,7 +24,7 @@ def get_plugin_directory():
|
||||||
return os.path.dirname(plugin_path)
|
return os.path.dirname(plugin_path)
|
||||||
|
|
||||||
def custom_button_action(*args):
|
def custom_button_action(*args):
|
||||||
cmds.playblast()
|
tinyblast_instance.custom_playblast()
|
||||||
|
|
||||||
class Tinyblast(ompx.MPxCommand):
|
class Tinyblast(ompx.MPxCommand):
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
|
@ -78,7 +75,7 @@ class Tinyblast(ompx.MPxCommand):
|
||||||
|
|
||||||
def doIt(selfself, args):
|
def doIt(selfself, args):
|
||||||
print("Tinyblasting...")
|
print("Tinyblasting...")
|
||||||
cmds.playblast()
|
tinyblast_instance.tinyblast()
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def cmdCreator():
|
def cmdCreator():
|
||||||
|
@ -90,7 +87,7 @@ class Tinyblast(ompx.MPxCommand):
|
||||||
kwargs['quality'] = 100
|
kwargs['quality'] = 100
|
||||||
kwargs['widthHeight'] = self.resolution
|
kwargs['widthHeight'] = self.resolution
|
||||||
|
|
||||||
result = original_playblast(*args, **kwargs)
|
result = cmds.playblast(*args, **kwargs)
|
||||||
|
|
||||||
if result and self.save:
|
if result and self.save:
|
||||||
self.blastIt(result)
|
self.blastIt(result)
|
||||||
|
@ -473,7 +470,7 @@ def initializePlugin(mobject):
|
||||||
mplugin.registerCommand("tinyblast", Tinyblast.cmdCreator)
|
mplugin.registerCommand("tinyblast", Tinyblast.cmdCreator)
|
||||||
mplugin.registerCommand("openTinyblastOptions", cmdCreator)
|
mplugin.registerCommand("openTinyblastOptions", cmdCreator)
|
||||||
om.MGlobal.displayInfo("Tinyblast plugin loaded.")
|
om.MGlobal.displayInfo("Tinyblast plugin loaded.")
|
||||||
cmds.playblast = tinyblast_instance.custom_playblast
|
#cmds.playblast = tinyblast_instance.custom_playblast
|
||||||
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
|
||||||
|
|
Loading…
Reference in New Issue