本文整理汇总了Python中shotgun_api3.Shotgun类的典型用法代码示例。如果您正苦于以下问题:Python Shotgun类的具体用法?Python Shotgun怎么用?Python Shotgun使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Shotgun类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。
示例1: submitShotgunTicket
def submitShotgunTicket(output, jobList):
currentuser = str(User.currentUser().name())
title = "AtS - %s"%currentuser
desc = []
desc.append(output+"\n")
desc.append("JOBLIST:")
for job in jobList:
desc.append(str(job.key())+" - "+str(job.name()))
sg = Shotgun(SERVER_PATH, SCRIPT_USER, SCRIPT_KEY)
id = sg.find("HumanUser",[['login','is',currentuser]],['id'])
userid = id[0]
ticket_data = {
'created_by': {'type':'HumanUser','id':userid['id']},
'title': title,
'description': "\n".join(desc),
'addressings_to':[{'type':'Group', 'id':19}, {'type':'HumanUser','id':userid['id']}],
'project': {'type':'Project', 'id':178},
'sg_service': {'type':'CustomNonProjectEntity01', 'id':27},
}
sg_ticket = sg.create('Ticket', ticket_data, ['id'])
new_ticket_url = SERVER_PATH + "/detail/Ticket/" + str(sg_ticket['id'])
QDesktopServices.openUrl( QUrl(new_ticket_url) )
开发者ID:attila3d,项目名称:arsenalsuite,代码行数:28,代码来源:shotgunPlugin.py
示例2: main
def main(notebookName):
#Get your developer token here: https://www.evernote.com/api/DeveloperToken.action and put it here
dev_token = 'yourEvernoteDevKey'
#Put your Shotgun script details here
sg = Shotgun('https://yourSite.shotgunstudio.com','evernote-shotgun','yourScriptKey')
#Put the Shotgun HumanUser ID here for the person you want to appear as the Note's author in Shotgun
sgUserId = 45
sgUser = sg.find_one("HumanUser",[['id', 'is', sgUserId]])
#Establish a connection to Evernote and store note and user data
client = EvernoteClient(token=dev_token, sandbox=False)
userStore = client.get_user_store()
user = userStore.getUser()
noteStore = client.get_note_store()
#Check if the supplied notebook exists, and if it does, send to processNotebook()
print('\nFinding notebook')
notebooks = noteStore.listNotebooks()
notebookNames = [notebook.name for notebook in notebooks]
if notebookName not in notebookNames:
print('\nSorry, there are no notebooks in your account named {0}'.format(notebookName))
else:
for notebook in notebooks:
if notebook.name == notebookName:
print('\nProcessing notebook - BEGIN')
processNotebook(noteStore, notebook, sg, sgUser)
print('\nProcessing notebook - DONE\n')
else:
continue
开发者ID:benhadden,项目名称:evernote-shotgun,代码行数:34,代码来源:evernote-shotgun.py
示例3: getProjects
def getProjects():
site = 'https://chimneypot.shotgunstudio.com'
scriptName = 'AssetBrowser'
scriptKey = 'c35ab5f5322d4b1e8b6488bb315c03e5f38881ea'
repo = '/mnt/karramba/'
rootList = ['film', 'out', 'ref', 'src', 'temp']
filmList = ['assets', 'sequences']
assetList = ['light', 'material', 'mattepaint', 'model', 'rig', 'shader', 'textures']
shotList = ['anim', 'comp', 'data', 'fx', 'light', 'out', 'src', 'tmp']
sqList = ['anim', 'comp', 'data', 'fx', 'light', 'out', 'shots']
dataList = ['cache', 'geo', 'render', 'shadowmap', 'sim', 'track', 'photonmap']
outList = ['dailies', 'hires']
prName = raw_input('Print project name:')
prPath = repo + prName
if not os.path.exists(prPath):
os.mkdir(prPath)
for i in rootList:
os.makedirs(prPath + os.sep + i)
for i in filmList:
os.makedirs(prPath + os.sep + 'film' + os.sep + i)
for i in assetList:
os.makedirs(prPath + os.sep + 'film' + os.sep + 'assets' + os.sep + i)
for i in outList:
os.makedirs(prPath + os.sep + 'out' + os.sep + i)
sg = Shotgun(site, scriptName, scriptKey)
sg.create('Project', {'name':prName})
开发者ID:horitin,项目名称:pipeline,代码行数:33,代码来源:asset_browser_functions.py
示例4: addSrc
def addSrc():
repo = '/mnt/karramba'
shotFoldList = ['anim', 'comp', 'data', 'fx', 'light', 'out', 'src', 'tmp']
seqFoldList = ['anim', 'comp', 'data', 'fx', 'light', 'out', 'shots']
dataFoldList = ['cache', 'geo', 'render', 'shadowmap', 'sim', 'track', 'photonmap']
outFoldList = ['dailies', 'hires']
site = 'https://chimneypot.shotgunstudio.com'
scriptName = 'addSrc'
scriptKey = 'd7dac4e2c55faf486875dfb944ffc9d8e49a0c44'
sg = Shotgun(site, scriptName, scriptKey)
projList = sg.find('Project', [], ['name'])
for i in projList:
print 'id:' + str(i['id']) + ' ' + i['name']
prId = int(raw_input('Print project id:'))
proj = sg.find_one('Project', [['id','is',prId]], ['name'])
if not [x for x in os.listdir(repo) if x==proj['name']]:
print "Project doesn't exist in repository"
return
s = os.sep
prPath = repo + s + proj['name']
seqPath = prPath + s + 'film' + s + 'sequences'
seqList = os.listdir(prPath + s + 'src')
for i in seqList:
sequenceFold = prPath + s + 'film' + s + 'sequences'
os.makedirs(sequenceFold + s + i)
for j in seqFoldList:
os.makedirs(sequenceFold + s + i + s + j)
for d in dataFoldList:
os.makedirs(sequenceFold + s + i + s + 'data' + s + d)
for o in outFoldList:
os.makedirs(sequenceFold + s + i + s + 'out' + s + o)
shList = os.listdir(prPath + s + 'src' + s + i)
for sh in shList:
shFold = sequenceFold + s + i + s + 'shots'
os.makedirs(shFold + s + sh)
for f in shotFoldList:
os.makedirs(shFold + s + sh + s + f)
for ds in dataFoldList:
os.makedirs(shFold + s + sh + s + 'data' + s + ds)
for ot in outFoldList:
os.makedirs(shFold + s + sh + s + 'out' + s + ot)
shutil.move(prPath + s + 'src' + s + i + s + sh, shFold + s + sh + s + 'src')
os.system('ln -sf ' + shFold + s + sh + s + 'src ' + prPath + s + 'src' + s + i + s + sh)
开发者ID:horitin,项目名称:pipeline,代码行数:60,代码来源:addSrc.py
示例5: __init__
def __init__(self, base_url, script_name, api_key, convert_datetimes_to_utc=True,
http_proxy=None, ensure_ascii=True, connect=True, host=None, port=None):
'''
We will initialize the Shotgun object, but will not connect right away.
Instead it will will attempt to create a socket connection using the
Shotgun object and the host and port data provided or generated. If we do
not have a host and port specified, or do not find a connection, we will
fall back and connect to the actual Shotgun server instead.
'''
Shotgun.__init__(self, base_url, script_name, api_key,
convert_datetimes_to_utc=convert_datetimes_to_utc,
http_proxy=http_proxy, ensure_ascii=ensure_ascii,
connect=False)
# If a host is not specified, attempt using the local machine.
if not host:
host = socket.gethostname()
# If a port is not specified, generate a port from the app key.
if not port:
port = common.appKeyToPort(self.config.api_key)
self._sgclient = None
self._host = host
self._port = port
if connect:
self.connect()
开发者ID:Mathieson,项目名称:DoubleBarrel,代码行数:28,代码来源:wrapper.py
示例6: createProject
def createProject():
site = 'https://chimneypot.shotgunstudio.com'
scriptName = 'createProject'
scriptKey = '90699580e396b61d3acfb71e0595adde7458dfd4'
repo = '/mnt/karramba/'
rootList = ['film', 'out', 'ref', 'src', 'temp']
filmList = ['assets', 'sequences']
assetList = ['light', 'material', 'mattepaint', 'model', 'rig', 'shader', 'textures']
shotList = ['anim', 'comp', 'data', 'fx', 'light', 'out', 'src', 'tmp']
sqList = ['anim', 'comp', 'data', 'fx', 'light', 'out', 'shots']
dataList = ['cache', 'geo', 'render', 'shadowmap', 'sim', 'track', 'photonmap']
outList = ['dailies', 'hires']
prName = raw_input('Print project name:')
prPath = repo + prName
if not os.path.exists(prPath):
os.mkdir(prPath)
for i in rootList:
os.makedirs(prPath + os.sep + i)
for i in filmList:
os.makedirs(prPath + os.sep + 'film' + os.sep + i)
for i in assetList:
os.makedirs(prPath + os.sep + 'film' + os.sep + 'assets' + os.sep + i)
for i in outList:
os.makedirs(prPath + os.sep + 'out' + os.sep + i)
sg = Shotgun(site, scriptName, scriptKey)
sg.create('Project', {'name':prName})
开发者ID:horitin,项目名称:pipeline,代码行数:33,代码来源:addProject.py
示例7: _moveFilesToPublish
def _moveFilesToPublish(self):
base_url = "http://bubblebathbay.shotgunstudio.com"
script_name = 'playBlastPublisher'
api_key = '718daf67bfd2c7e974f24e7cbd55b86bb101c4e5618e6d5468bc4145840e4558'
sgsrv = Shotgun(base_url = base_url , script_name = script_name, api_key = api_key, ensure_ascii=True, connect=True)
selectedShots = [item.text(0) for item in self.treeWidgetItems if item.checkState(0)]
if selectedShots:
for each in selectedShots:
episode = each.split('sh')[0]
shotName = '%s_sh%s' % (each.split('sh')[0], each.split('sh')[1].split('Lay')[0])
self.publishPath = self.publishingPath(episode, shotName)
for root, dirs, files in os.walk(self.shFldPath):
for fl in sorted(files):
if fl.endswith('.mov') and fl == '%s.mov' % each:
srcPath = os.path.join(root,fl)
self.playblastName = fl
while os.path.exists(os.path.join(self.publishPath, fl)):
allFiles= os.listdir(self.publishPath)
publishFiles = []
if allFiles:
for allFile in allFiles:
if allFile.endswith('.mov'):
publishFiles.append(allFile)
versionNumber = int(sorted(publishFiles)[-1].split('.v')[1].split('.mov')[0])
versionNumber += 1
if versionNumber < 10:
publishFileName = '%sLayout.v%03d.mov' % (shotName.replace('_', ''), versionNumber)
self.publishPath = os.path.join(self.publishPath, publishFileName)
self.playblastName = os.path.basename(self.publishPath)
else:
publishFileName = '%sLayout.v%02d.mov' % (shotName.replace('_', ''), versionNumber)
self.publishPath = os.path.join(self.publishPath, publishFileName)
self.playblastName = os.path.basename(self.publishPath)
shutil.copy2(srcPath, self.publishPath)
publishMovPath = os.path.join(self.publishingPath(episode, shotName), self.playblastName)
getShotTasks = sgsrv.find_one('Shot', filters = [["code", "is", shotName]], fields=['id', 'tasks'])
for key, values in getShotTasks.iteritems():
if key == 'tasks':
for value in values:
if value['name'] == 'Layout':
self.taskId = value['id']
if self.publishPath.endswith('review'):
self.publishPath = os.path.join(self.publishPath,fl)
self.playblastName = fl
data = { 'project': {'type':'Project','id': 66},
'code': self.playblastName,
'description': 'Layout playblast published',
'sg_path_to_movie': publishMovPath,
'sg_status_list': 'rev',
'entity': {'type':'Shot', 'id':getShotTasks['id']},
'sg_task': {'type':'Task', 'id':self.taskId},
'user': {'type':'HumanUser', 'id':92} }
result = sgsrv.create('Version', data)
result2 = sgsrv.upload("Version", result['id'], publishMovPath, "sg_uploaded_movie")
print "Done"
开发者ID:vipul-rathod,项目名称:AppleTree,代码行数:58,代码来源:test_v002.py
示例8: _pubBttn
def _pubBttn(self):
base_url = "http://bubblebathbay.shotgunstudio.com"
script_name = 'playBlastPublisher'
api_key = '718daf67bfd2c7e974f24e7cbd55b86bb101c4e5618e6d5468bc4145840e4558'
sgsrv = Shotgun(base_url = base_url , script_name = script_name, api_key = api_key, ensure_ascii=True, connect=True)
selectedShots = sorted([item.text(0) for item in self.shotTreeWidgetItems if item.checkState(0)])
for shot in selectedShots:
if shot in self.srcPath.keys():
destPath = self._getPublishPath(shot)
srcPath = self.srcPath[str(shot)]
ext = os.path.splitext(srcPath)[-1]
# print os.path.basename(srcPath)
# while os.path.exists(os.path.join(str(destPath), os.path.basename(srcPath))):
# print "In Loop"
# print os.path.basename(srcPath)
# allFiles= os.listdir(destPath)
# publishFiles = []
# if allFiles:
# for allFile in allFiles:
# if allFile.endswith(ext):
# print allFile
# publishFiles.append(allFile)
# versionNumber = int(sorted(publishFiles)[-1].split('.v')[1].split(ext)[0])
# versionNumber += 1
# if versionNumber < 10:
# publishFileName = '%sLayout.v%03d%s' % (shotName.replace('_', ''), versionNumber, ext)
# self.publishPath = os.path.join(self.publishPath, publishFileName)
# self.playblastName = os.path.basename(self.publishPath)
# else:
# publishFileName = '%sLayout.v%02d%s' % (shotName.replace('_', ''), versionNumber, ext)
# self.publishPath = os.path.join(self.publishPath, publishFileName)
# self.playblastName = os.path.basename(self.publishPath)
# shutil.copy2(srcPath, destPath)
shotName = '%s_%s' % (self._getEpisodeName(shot), self._getShotName(shot))
getShotTasks = self.tk.shotgun.find_one('Shot', filters = [["code", "is", shotName]], fields=['id', 'tasks'])
taskName = self.comboBox.currentText()
self.playblastName = os.path.basename(srcPath)
publishMovPath = os.path.join(destPath, self.playblastName).replace('\\', '/')
shutil.copy2(srcPath, destPath)
for task in getShotTasks['tasks']:
if task['name'] == taskName:
taskId = task['id']
data = { 'project': {'type':'Project','id': 66},
'code': self.playblastName,
'description': 'Playblast published',
'sg_path_to_movie': publishMovPath,
'sg_status_list': 'rev',
'entity': {'type':'Shot', 'id':getShotTasks['id']},
'sg_task': {'type':'Task', 'id':taskId},
'user': {'type':'HumanUser', 'id':92} }
result = sgsrv.create('Version', data)
result2 = sgsrv.upload("Version", result['id'], publishMovPath, "sg_uploaded_movie")
print "Published %s" % self.playblastName
开发者ID:vipul-rathod,项目名称:AppleTree,代码行数:56,代码来源:genericPublishPlayblast.py
示例9: AppServerSvc
class AppServerSvc(win32serviceutil.ServiceFramework):
_svc_name_ = "timelog"
_svc_display_name_ = "shotgun time log"
def __init__(self, args):
win32serviceutil.ServiceFramework.__init__(self, args)
SetConsoleCtrlHandler(lambda x: True, True)
self.hWaitStop = win32event.CreateEvent(None, 0, 0, None)
self.count = 0
self.estinmins = 0
self.isAlive = True
self.envv = ""
self.prlist = []
def SvcStop(self):
self.ReportServiceStatus(win32service.SERVICE_STOP_PENDING)
win32event.SetEvent(self.hWaitStop)
self.run = False
def SvcDoRun(self):
servicemanager.LogMsg(
servicemanager.EVENTLOG_INFORMATION_TYPE, servicemanager.PYS_SERVICE_STARTED, (self._svc_name_, "")
)
self.sg = Shotgun(
"https://xxxxxxxxxxxxxxxx.shotgunstudio.com", "timelogservice", "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
)
self.main()
def updateProject(self, projectid):
servicemanager.LogWarningMsg(unicode(projectid))
filters = [["project.Project.id", "is", projectid]]
fields = ["time_logs_sum", "est_in_mins"]
for eventTimeLog in self.sg.find("Task", filters, fields):
self.count = self.count + eventTimeLog["time_logs_sum"]
if eventTimeLog["est_in_mins"] is not None:
self.estinmins = self.estinmins + eventTimeLog["est_in_mins"]
data = {"sg_artisttimelog": self.count / 600}
asset = self.sg.update("Project", projectid, data)
data = {"sg_total_bid": self.estinmins / 600}
asset = self.sg.update("Project", projectid, data)
def main(self):
while self.isAlive:
filters = [["sg_status", "is", "active"]]
fields = ["id"]
for f in self.sg.find("Project", filters, fields):
self.prlist.append(f["id"])
for prid in self.prlist:
self.updateProject(prid)
self.count = 0
self.estinmins = 0
if win32event.WaitForSingleObject(self.hWaitStop, 3000) == win32event.WAIT_OBJECT_0:
break
开发者ID:teddygo,项目名称:codha,代码行数:56,代码来源:artist+timelog+svc.py
示例10: connect
def connect(self):
'''
Attempts to connect to a Double Barrel Server first, then connects
directly to Shotgun if failed.
'''
# Attempt to open a socket at the host and port.
sgclient = DoubleBarrelClient(self, self.host(), self.port())
if sgclient.connect():
self._sgclient = sgclient
if not self._sgclient:
Shotgun.connect(self)
开发者ID:Mathieson,项目名称:DoubleBarrel,代码行数:12,代码来源:wrapper.py
示例11: _get_projects_list
def _get_projects_list():
sg = Shotgun('http://yoursite.com', 'your_api', '123456')
filters = [['sg_status', 'is', 'Active'], ['tank_name', 'is_not', '']]
fields = ['name']
order = [{'field_name': 'name', 'direction': 'asc'}]
projectsDic = sg.find('Project', filters, fields, order)
newProjectsDic = []
for project in projectsDic:
newProjectsDic.append(project['name'].replace(' ', ''))
return newProjectsDic
开发者ID:aricalde,项目名称:sgtkConfigReplicator,代码行数:14,代码来源:get_projects_list.py
示例12: __init__
def __init__(self):
sgSite = 'https://chimneypot.shotgunstudio.com'
scriptName = 'dBase'
scriptKey = '729a76955455909c79f6d90262bb9fbe9186b92b'
self.db = Shotgun(sgSite, scriptName, scriptKey)
开发者ID:horitin,项目名称:pipeline,代码行数:7,代码来源:dBase.py
示例13: SvcDoRun
def SvcDoRun(self):
servicemanager.LogMsg(
servicemanager.EVENTLOG_INFORMATION_TYPE, servicemanager.PYS_SERVICE_STARTED, (self._svc_name_, "")
)
self.sg = Shotgun(
"https://xxxxxxxxxxxxxxxx.shotgunstudio.com", "timelogservice", "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
)
self.main()
开发者ID:teddygo,项目名称:codha,代码行数:8,代码来源:artist+timelog+svc.py
示例14: getAllProjects
def getAllProjects():
site = 'https://chimneypot.shotgunstudio.com'
scriptName = 'AssetBrowser'
scriptKey = 'c35ab5f5322d4b1e8b6488bb315c03e5f38881ea'
sg = Shotgun(site, scriptName, scriptKey)
fields = ['id','name','type']
projects= sg.find("Project",[],fields)
if len(projects) < 1:
print "couldn't find any projects"
#exit(0)
else:
print "Found "+str(len(projects))+" projects"
# pprint (projects)
return projects
开发者ID:horitin,项目名称:pipeline,代码行数:19,代码来源:asset_browser_functions.py
示例15: Button_Callback
def Button_Callback():
print ""+SCRIPT_NAME+" "+VERSION+"\n"
print "Connecting to %s..." % (SERVER_PATH),
sg = Shotgun(SERVER_PATH, SCRIPT_NAME, SCRIPT_KEY)
print "\n\nConnected\n\n"
# ---------------------------------------------------------------------------------------------
# Testing Block BEGIN
# ---------------------------------------------------------------------------------------------
result = sg.schema_entity_read()
pprint(result)
print ""+SERVER_PATH+"\n ... completed\n"
pass
开发者ID:animate1978,项目名称:BlenderPyShotgun,代码行数:19,代码来源:widvertu_0_3.py
示例16: getShotsBySeqId
def getShotsBySeqId(seq_id):
site = 'https://chimneypot.shotgunstudio.com'
scriptName = 'AssetBrowser'
scriptKey = 'c35ab5f5322d4b1e8b6488bb315c03e5f38881ea'
sg = Shotgun(site, scriptName, scriptKey)
fields = ['id','type','code']
filters = [['sg_sequence','is',{'type':'Sequence','id':seq_id}]]
shots= sg.find("Shot",filters,fields)
if len(shots) < 1:
print "couldn't find any shots"
#exit(0)
else:
None
return shots
开发者ID:horitin,项目名称:pipeline,代码行数:19,代码来源:asset_browser_functions.py
示例17: get_app_store_credentials
def get_app_store_credentials(connection):
""" Return the validated script for this site to connect to the app store """
(script, key) = __get_app_store_key(connection)
# get the proxy string from the connection
proxy = get_proxy_from_connection(connection)
# connect to the app store
try:
sg_app_store = Shotgun(constants.SGTK_APP_STORE, script, key, http_proxy=proxy)
# pull down the full script information
app_store_script = sg_app_store.find_one(
"ApiUser",
[["firstname", "is", script]],
fields=["type", "firstname", "id", "salted_password"])
except Exception:
return None
return app_store_script
开发者ID:adriankrupa,项目名称:tk-framework-desktopstartup,代码行数:20,代码来源:shotgun.py
示例18: __init__
def __init__(self, parent = None):
# set up the UI and variable here - don't forget to call updateUI at end
super(dMFXsubmitterDialog,self).__init__(parent)
self.acceptDrops()
self.setupUi(self) # generic call to setup the Ui provided by Qt
self.password = ''
self.version_file_path = ''
self.user = ''
self.user_id = ''
self.user_name = ''
self.user_initials = ''
self.submit_movie = False
self.movie_file_path = ''
self.description = ''
self.login_status = False
self.allOK = True
self.submit_call_track = True
self.version_type = 'Shot'
self.created_version_id = None
self.sg = Shotgun(SERVER_PATH, SCRIPT_USER, SCRIPT_KEY)
self.sgu = Shotgun(SERVER_PATH, SCRIPT_USER, SCRIPT_KEY)
self.users_with_initals = INITIALS_LIST
self.user_list = []
self.lineEdit_versionFile.dragEnterEvent = types.MethodType(dragEnterEvent,self.lineEdit_versionFile)
self.lineEdit_versionFile.dropEvent = types.MethodType(dropEvent,self.lineEdit_versionFile)
self.lineEdit_versionFile.setAcceptDrops(True)
self.lineEdit_versionFile.setDragEnabled(True)
self.lineEdit_forReview.dragEnterEvent = types.MethodType(dragEnterEvent,self.lineEdit_forReview)
self.lineEdit_forReview.dropEvent = types.MethodType(dropEvent,self.lineEdit_forReview)
self.lineEdit_forReview.setAcceptDrops(True)
self.lineEdit_forReview.setDragEnabled(True)
# start things happening... get the users from sg and populate them into the drop-down
self.update_user_list()
self.connect(self,SIGNAL('update'),self.updateUI)
self.new_value = 'this is not a new value'
#self.emit(SIGNAL("update"))
self.updateUI()
开发者ID:ProjectGuerilla,项目名称:Code-Samples,代码行数:39,代码来源:dMFXsubmitter.py
示例19: setupLightFiles
def setupLightFiles(cb010 = True, cb020 = True, cb030 = True, cb040 = True, cb050 = True, cb060 = True, optimizeEnv = True, rippleLyr = True, bgHillLyr = True, directory = 'I:/bubblebathbay/episodes', episode = 152, shots = 1):
## Initialize Shotgun API
base_url = "http://bubblebathbay.shotgunstudio.com"
script_name = 'audioUploader'
api_key = 'bbfc5a7f42364edd915656d7a48d436dc864ae7b48caeb69423a912b930bc76a'
sgsrv = Shotgun(base_url = base_url , script_name = script_name, api_key = api_key, ensure_ascii = True, connect = True)
## Query data from Shotgun
data = sgsrv.find('Shot', filters = [["code", "contains", 'ep%s_sh' % episode]], fields = ['code', 'sg_cut_in', 'sg_cut_out', 'sg_tod', 'sg_ocean_type'])
if data:
if episode:
if shots:
for each in data:
if each['code'].split('_')[-1].strip('sh') in shots:
try:
cmds.refresh(suspend = True)
get_data_from_shotgun(cb010 = cb010, cb020 = cb020, cb030 = cb030, cb040 = cb040, cb050 = cb050, cb060 = cb060, optimizeEnv = optimizeEnv, rippleLyr = rippleLyr, bgHillLyr = bgHillLyr, directory = directory, **each)
except:
pass
finally:
cmds.refresh(suspend = False)
开发者ID:LeonLoong,项目名称:tools,代码行数:22,代码来源:createLightFiles.py
示例20: launch
def launch(progressBar, logLabel, filterDataList , app, projectContext = None, sg= None ) :
SERVER_PATH = "https://nozon.shotgunstudio.com"
SCRIPT_NAME = 'noteManager'
SCRIPT_KEY = '3fbb2a5f180457af709fcad231c96ac8a916711427af5a06c47eb1758690f6e4'
if not sg :
try :
from shotgun_api3 import Shotgun
sg = Shotgun(SERVER_PATH, SCRIPT_NAME, SCRIPT_KEY)
except :
sg = app.engine.tank.shotgun
projectId = None
if projectContext :
projectId = projectContext
else :
projectId = app.context.project
today = datetime.datetime.utcnow().strftime("%Y%m%d")
import os
try :
os.makedirs("c:/temp/EVENTLOG")
except :
pass
if not progressBar :
import glob
test = outputLogFileName = "c:/temp/EVENTLOG/eventManager_"+projectId["name"]+"_"+ "*" +".html"
outputLogFileName = "c:/temp/EVENTLOG/eventManager_"+projectId["name"]+"_"+ today +".html"
if len(glob.glob(test)) :
print "skiped"
return
f = open(outputLogFileName, 'w')
f.write("<!DOCTYPE html><html><head><title>Page Title</title></head><body><dir>")
def cout(text) :
text = text.replace(" "," ")
text = text.replace("\n","<br>")
text = text.replace("<font color=","<font color=")
f.write(str(text)+"<br>\n")
eventFilter_List=[]
if not filterDataList :
filterEvent = event_filter()
filterEvent.massTest = 60.0
eventFilter_List.append( filterEvent )
for filterData in filterDataList :
eventFilter_List.append( event_filter(*filterData))
if progressBar :
progressBar.setFormat("Querying database")
textLineList=["<font color='#000000'>Results : </font>"]
cout("Retrieving project workstation list : " + str(projectId) )
eventFilterList = ['version_up','save_file_as', 'open_file', 'file_publish', 'new_file','open_file','open_file_snapshot' ]
filters = [ ["project", "is", projectId], ["event_type", "in", eventFilterList ] ]
wsDictList=[]
firstEventLog = None
lastEventLog = None
eventLogList = sg.find("EventLogEntry", filters, [ "meta" , "created_at"] )
cout("got It ! ")
for eventLog in eventLogList :
if eventLog["meta"].has_key("ws") :
if not eventLog["meta"]["ws"] in wsDictList :
wsDictList.append(eventLog["meta"]["ws"])
if not firstEventLog :
firstEventLog = eventLog
elif firstEventLog["id"] > eventLog["id"] :
firstId = eventLog
if not lastEventLog :
#.........这里部分代码省略.........
开发者ID:cyrilclavaud,项目名称:EventTrackingManager,代码行数:101,代码来源:processor.py
注:本文中的shotgun_api3.Shotgun类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论