Skip to content

Commit

Permalink
Merge pull request #41 from zuokangbo/main
Browse files Browse the repository at this point in the history
Add mari support
  • Loading branch information
hannesdelbeke authored May 23, 2023
2 parents b1ddf5b + 9a01b9b commit 060ea5c
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 2 deletions.
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

0 comments on commit 060ea5c

Please sign in to comment.