Add shelf and button to open Tinyblast Options window and update README

This commit is contained in:
Jack 2024-09-18 11:17:23 -04:00
parent 979c809d5a
commit cb143e7981
3 changed files with 19 additions and 6 deletions

View File

@ -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.

View File

@ -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: