forked from shotgunsoftware/tk-multi-starterapp
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathapp.py
55 lines (38 loc) · 1.72 KB
/
app.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
# Copyright (c) 2013 Shotgun Software Inc.
#
# CONFIDENTIAL AND PROPRIETARY
#
# 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
# not expressly granted therein are reserved by Shotgun Software Inc.
# The code was taken from the documentation here: https://support.shotgunsoftware.com/hc/en-us/articles/219032918-Shotgun-Integration#Developing%20Apps%20for%20Shotgun
from sgtk.platform import Application
import sgtk
logger = sgtk.platform.get_logger(__name__)
class HelloWorld(Application):
def init_app(self):
"""
Register menu items with Shotgun
"""
params = {
"title": "Hello, World!",
}
self.engine.register_command("hello_world_cmd", self.do_stuff, params)
params2 = {
"title": "Hello, Universe!",
}
self.engine.register_command("hello_universe_cmd", self.do_stuff2, params2)
def do_stuff(self, entity_type, entity_ids):
# this message will be displayed to the user
self.engine.log_info("Hello, World!")
# self.print_context()
def do_stuff2(self, entity_type, entity_ids):
# this message will be displayed to the user
self.engine.log_info("Hello, Universe!")
# def print_context(self):
# whereami = self.print_context
# logger.debug("RA: whereami is %s" % whereami)
# # logger.debug("RA: entity_type is %s" % entity_type)
# # logger.debug("RA: entity_ids is %s" % entity_ids)