Idk what I did, forgot to commit
This commit is contained in:
parent
d1171829dc
commit
fbe1a339e1
|
@ -2,6 +2,7 @@ import maya.OpenMaya as om
|
||||||
import maya.OpenMayaMPx as ompx
|
import maya.OpenMayaMPx as ompx
|
||||||
import maya.OpenMayaUI as omui
|
import maya.OpenMayaUI as omui
|
||||||
import maya.cmds as cmds
|
import maya.cmds as cmds
|
||||||
|
import maya.utils as utils
|
||||||
import os
|
import os
|
||||||
import subprocess
|
import subprocess
|
||||||
import sys
|
import sys
|
||||||
|
@ -38,10 +39,11 @@ def custom_playblast(*args, **kwargs):
|
||||||
input_file = result # The file output by playblast
|
input_file = result # The file output by playblast
|
||||||
#output_directory = os.path.dirname(result) # Get the directory path
|
#output_directory = os.path.dirname(result) # Get the directory path
|
||||||
output_directory = os.path.dirname(cmds.file(query=True, sceneName=True))
|
output_directory = os.path.dirname(cmds.file(query=True, sceneName=True))
|
||||||
|
scene_name = os.path.basename(cmds.file(query=True, sceneName=True))
|
||||||
input_filename = os.path.basename(result) # Get the filename with extension
|
input_filename = os.path.basename(result) # Get the filename with extension
|
||||||
|
|
||||||
# Change the extension to .mp4
|
# Change the extension to .mp4
|
||||||
output_filename = os.path.splitext(input_filename)[0] + ".mp4"
|
output_filename = os.path.splitext(scene_name)[0] + ".mp4"
|
||||||
|
|
||||||
# Define the full path for the converted output file
|
# Define the full path for the converted output file
|
||||||
output_file = os.path.join(output_directory, output_filename)
|
output_file = os.path.join(output_directory, output_filename)
|
||||||
|
@ -148,6 +150,9 @@ def get_playblast_options_window():
|
||||||
return wrapInstance(int(window_ptr), QtWidgets.QWidget)
|
return wrapInstance(int(window_ptr), QtWidgets.QWidget)
|
||||||
return None
|
return None
|
||||||
|
|
||||||
|
def open_script_job():
|
||||||
|
cmds.scriptJob(event=["SceneOpened", setup_script_job])
|
||||||
|
|
||||||
def setup_script_job():
|
def setup_script_job():
|
||||||
global playblast_job_id
|
global playblast_job_id
|
||||||
# Kill any previously running scriptJob
|
# Kill any previously running scriptJob
|
||||||
|
@ -187,7 +192,7 @@ def initializePlugin(mobject):
|
||||||
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()
|
open_script_job()
|
||||||
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