Add shelf and button to open Tinyblast Options window and update README
This commit is contained in:
parent
979c809d5a
commit
cb143e7981
|
@ -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.
|
3. Access the Playblast Options window in Maya.
|
||||||
|
|
||||||
## How to Use
|
## 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:
|
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.
|
||||||
|
|
||||||
```python
|
|
||||||
import maya.cmds as cmds
|
|
||||||
cmds.openTinyblastOptions()
|
|
||||||
```
|
|
||||||
|
|
||||||
## Future Plans
|
## Future Plans
|
||||||
- Further improvements to format and codec compatibility.
|
- Further improvements to format and codec compatibility.
|
||||||
|
|
18
tinyblast.py
18
tinyblast.py
|
@ -448,6 +448,23 @@ class OpenTinyblastOptions(ompx.MPxCommand):
|
||||||
def cmdCreator():
|
def cmdCreator():
|
||||||
return ompx.asMPxPtr(OpenTinyblastOptions())
|
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):
|
def initializePlugin(mobject):
|
||||||
global tinyblast_instance
|
global tinyblast_instance
|
||||||
tinyblast_instance = Tinyblast()
|
tinyblast_instance = Tinyblast()
|
||||||
|
@ -460,6 +477,7 @@ def initializePlugin(mobject):
|
||||||
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
|
||||||
|
create_custom_shelf()
|
||||||
|
|
||||||
def uninitializePlugin(mobject):
|
def uninitializePlugin(mobject):
|
||||||
try:
|
try:
|
||||||
|
|
Binary file not shown.
Loading…
Reference in New Issue