Compare commits
3 Commits
v2.0.0-bet
...
dev
Author | SHA1 | Date |
---|---|---|
Jack | 708ed2dd40 | |
Jack | 946e0b6005 | |
Jack | 9b0821c32e |
12
tinyblast.py
12
tinyblast.py
|
@ -15,9 +15,6 @@ from PySide6.QtWidgets import QMainWindow, QFileDialog
|
|||
from PySide6.QtCore import QCoreApplication, QSettings
|
||||
import shiboken6
|
||||
|
||||
# Global variable to store the scriptJob ID
|
||||
playblast_job_id = None
|
||||
original_playblast = cmds.playblast
|
||||
tinyblast_instance = None
|
||||
|
||||
def get_plugin_directory():
|
||||
|
@ -27,7 +24,7 @@ def get_plugin_directory():
|
|||
return os.path.dirname(plugin_path)
|
||||
|
||||
def custom_button_action(*args):
|
||||
cmds.playblast()
|
||||
tinyblast_instance.custom_playblast()
|
||||
|
||||
class Tinyblast(ompx.MPxCommand):
|
||||
def __init__(self):
|
||||
|
@ -78,7 +75,7 @@ class Tinyblast(ompx.MPxCommand):
|
|||
|
||||
def doIt(selfself, args):
|
||||
print("Tinyblasting...")
|
||||
cmds.playblast()
|
||||
tinyblast_instance.tinyblast()
|
||||
|
||||
@staticmethod
|
||||
def cmdCreator():
|
||||
|
@ -90,7 +87,7 @@ class Tinyblast(ompx.MPxCommand):
|
|||
kwargs['quality'] = 100
|
||||
kwargs['widthHeight'] = self.resolution
|
||||
|
||||
result = original_playblast(*args, **kwargs)
|
||||
result = cmds.playblast(*args, **kwargs)
|
||||
|
||||
if result and self.save:
|
||||
self.blastIt(result)
|
||||
|
@ -469,11 +466,10 @@ def initializePlugin(mobject):
|
|||
global tinyblast_instance
|
||||
tinyblast_instance = Tinyblast()
|
||||
try:
|
||||
mplugin = ompx.MFnPlugin(mobject, "Jack Christensen", "2.0.0", "Any")
|
||||
mplugin = ompx.MFnPlugin(mobject, "Jack Christensen", "2.0.0-beta", "Any")
|
||||
mplugin.registerCommand("tinyblast", Tinyblast.cmdCreator)
|
||||
mplugin.registerCommand("openTinyblastOptions", cmdCreator)
|
||||
om.MGlobal.displayInfo("Tinyblast plugin loaded.")
|
||||
cmds.playblast = tinyblast_instance.custom_playblast
|
||||
except Exception as e:
|
||||
om.MGlobal.displayError(f"Failed to initialize plugin: {str(e)}")
|
||||
raise
|
||||
|
|
Loading…
Reference in New Issue