-
Notifications
You must be signed in to change notification settings - Fork 0
Description
Hi @BigRoy and @morganloomis!
Let's have a conversation about the requirements of our tools and what a platform such as Maya Control would need to facilitate for our tools to flourish.
If you could take a moment to look at the tools you've built already, and think about what they need.
For example, I know my tools will require at least:
- A Python module to be accessible on
sys.path - An (optional) hotkey to be associated with the module/part of the module
- An (optional) menu item, either an independent menu, and an item within an existing menu, such as "Deformers".
In Sublime, their superclass also supports getting notified of events, such as when a new document is opened, when the user is scrolling, or when the window is resized.
class MyPlugin(sublime_plugin.EventPlugin):
def onWindowResized(self):
print("Window resizing..")Could this be interesting to us as well? Perhaps provide an interface to the callbacks provided by the Maya API and scriptJob's?
Perhaps equally important, what shouldn't a plug-in do?
I know for one thing that every plug-in must be self-contained; no dependencies. A plug-in should not block or cause a deadlock and not contain any absolute paths. We could automatically test for some of these upon accepting a new project into the channel.
What do your tools need?
Summary
Here I'll be updating with what we've gathered from the conversation below.
API
From the highest level perspective, if we're following the Sublime model, we'll want to define three disparate APIs that talk to each other, along with one separate.
| Name | Description | Reference |
|---|---|---|
| Tool API | Entrypoint for our tool(s) | |
| Key Binding API | Custom hotkeys | .sublime-keymap |
| Menu API | Custom menus | .sublime-menu |
| Theme API | A CSS file (basically) | Color Scheme |
A package does not necessarily need a tool to be considered a package, examples include themes, hotkey reassignments (perhaps for some particular workflow) or custom menus, but they will need to use at least one of these before being added into the channel.
Tool API
The interface for the tool itself.
Key Binding API
I want to enable tool authors to include hotkeys, but we can't use native Maya functionality here, because it (1) relies on a single file (so no overriding) and (2) the file is automatically written to at shutdown (by default) which makes it brittle.
We need something robust. Something that takes precedence over whatever Maya already does, something we control.
So my idea was to install QShortcuts and manage them ourselves.
That way we are called first, and can choose to pass it on to Maya if we wanted to.
Menu API
Similar to the Key Binding API, I'd like this to also exist isolated and separate from Maya's internal menu API. Simply because it is terrible in that it loads them dynamically and without any pre-defined order or timing, making it difficult to make changes to.
So my idea was to install QMenus and manage them ourselves.
Theme API
We could package a simple CSS file to be activated/deactivated at will. An interesting aspect of Sublime is that it supports themes from another well known Editor - TextMate. That way, all existing themes developed for that works for Sublime which gives it an starting point for available themes.
We could potentially do that too, and if not, define some scheme that others may eventually adopt from us.