Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add mari support #41

Merged
merged 2 commits into from
May 23, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ If you use Blender, you can try the [unimenu_addon](https://github.com/hannesdel

<img src="samples/menu_screen_maya.jpg" width="400"/> <img src="samples/menu_screen_unreal5.jpg" width="400"/> <img src="samples/menu_screen_krita.jpg" width="400"/> <img src="samples/menu_screen_substance_painter.jpg" width="400"/>
<img src="samples/menu_screen_nuke.jpg" width="400"/> <img src="samples/menu_screen_katana.jpg" width="400"/>

<img src="samples/menu_screen_mari.jpg" width="400"/>
# how to use

### load from config (YAML & JSON)
Expand Down Expand Up @@ -88,7 +88,7 @@ unimenu was tested in the following versions, and might work in other versions.
- Nuke 13 (minimum)
- Hiero 13 (minimum)
- Katana 5 (minimum)

- Mari 6.0 (minimum)

python 3.7+ due to f-strings and pathlib

Expand Down
Binary file added samples/menu_screen_mari.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions unimenu/apps/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ class SupportedApps:
NUKE = App(name="nuke", module="nuke")
HIERO = App(name="hiero", module="hiero")
KATANA = App(name="katana", module="katana")
MARI = App(name="mari", module="mari")

QT = App("qt", None)

Expand Down
29 changes: 29 additions & 0 deletions unimenu/apps/mari.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
from unimenu.apps._abstract import MenuNodeAbstract
import mari


class MenuNodeMari(MenuNodeAbstract):

def setup(self, parent_app_node=None, backlink=False):
super().setup(parent_app_node=parent_app_node, backlink=backlink)

@property
def _default_root_parent(self):
return "MainWindow"

def _setup_sub_menu(self, parent_app_node=None):
if parent_app_node:
return f"{parent_app_node}/{self.label}"

def _setup_menu_item(self, parent_app_node=None):
if parent_app_node:
action = mari.actions.create(f"{parent_app_node}/{self.label}", self.command or "")
mari.menus.addAction(action, parent_app_node)

def _setup_separator(self, parent_app_node=None):
if parent_app_node:
mari.menus.addSeparator(parent_app_node)

def teardown(self):
"""remove from menu"""
pass