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

Hotkey #33

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
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
23 changes: 9 additions & 14 deletions app.py
Original file line number Diff line number Diff line change
@@ -1,37 +1,32 @@
# Copyright (c) 2015 Shotgun Software Inc.
#
# CONFIDENTIAL AND PROPRIETARY
#
# This work is provided "AS IS" and subject to the Shotgun Pipeline Toolkit
# This work is provided "AS IS" and subject to the Shotgun Pipeline Toolkit
# Source Code License included in this distribution package. See LICENSE.
# By accessing, using, copying or modifying this work you indicate your
# agreement to the Shotgun Pipeline Toolkit Source Code License. All rights
# By accessing, using, copying or modifying this work you indicate your
# agreement to the Shotgun Pipeline Toolkit Source Code License. All rights
# not expressly granted therein are reserved by Shotgun Software Inc.

"""
A loader application that lets you add new items to the scene.
"""

from sgtk.platform.qt import QtCore, QtGui

import sgtk
import sys
import os


class MultiLoader(sgtk.platform.Application):

def init_app(self):
"""
Called as the application is being initialized
"""

tk_multi_loader = self.import_module("tk_multi_loader")

# register command
cb = lambda : tk_multi_loader.show_dialog(self)
cb = lambda: tk_multi_loader.show_dialog(self)
menu_caption = "%s..." % self.get_setting("menu_name")
menu_options = { "short_name": self.get_setting("menu_name").replace(" ", "_") }
menu_options = {"short_name": self.get_setting("menu_name").replace(" ", "_"), 'hotkey': self.get_setting('hotkey')}
self.engine.register_command(menu_caption, cb, menu_options)

@property
Expand All @@ -41,7 +36,7 @@ def context_change_allowed(self):
"""
return True

def open_publish(self, title="Open Publish", action="Open", publish_types = []):
def open_publish(self, title="Open Publish", action="Open", publish_types=[]):
"""
Display the loader UI in an open-file style where a publish can be selected and the
artist can then click the action button. This will then return the selected publish.
Expand Down