diff --git a/README.md b/README.md index 755fe56..d96f821 100644 --- a/README.md +++ b/README.md @@ -28,12 +28,7 @@ Tinyblast is a custom playblast tool for Maya, designed to offer more flexible c 3. Access the Playblast Options window in Maya. ## How to Use -Currently, there is no menu button to open Tinyblast. You will need to run the following command in Maya's script editor: - -```python -import maya.cmds as cmds -cmds.openTinyblastOptions() -``` +The plugin creates a custom shelf called Tinyblast in Maya with a button that opens the Tinyblast Options window where you can choose settings and create a playblast. Use Tinyblast as you would the regular Maya playblast. ## Future Plans - Further improvements to format and codec compatibility. diff --git a/tinyblast.py b/tinyblast.py index d7e389b..84baef4 100644 --- a/tinyblast.py +++ b/tinyblast.py @@ -448,6 +448,23 @@ class OpenTinyblastOptions(ompx.MPxCommand): def cmdCreator(): return ompx.asMPxPtr(OpenTinyblastOptions()) +def create_custom_shelf(): + # Check if the shelf already exists + shelf_name = "Tinyblast" + if cmds.shelfLayout(shelf_name, exists=True): + cmds.deleteUI(shelf_name) # Delete the existing shelf (if you want to reset it) + + # Create a new shelf + cmds.shelfLayout(shelf_name, parent="ShelfLayout") + + # Add a button to the shelf (this will call your UI function) + cmds.shelfButton( + label="Tinyblast", + annotation="Open Tinyblast UI", # Tooltip text + image="pythonFamily.png", # You can replace this with any icon you want + command="cmds.openTinyblastOptions()" # Command to open your UI + ) + def initializePlugin(mobject): global tinyblast_instance tinyblast_instance = Tinyblast() @@ -460,6 +477,7 @@ def initializePlugin(mobject): except Exception as e: om.MGlobal.displayError(f"Failed to initialize plugin: {str(e)}") raise + create_custom_shelf() def uninitializePlugin(mobject): try: diff --git a/ui/__pycache__/tinyblast_options.cpython-311.pyc b/ui/__pycache__/tinyblast_options.cpython-311.pyc index 059b06d..16badc7 100644 Binary files a/ui/__pycache__/tinyblast_options.cpython-311.pyc and b/ui/__pycache__/tinyblast_options.cpython-311.pyc differ