def findAllSequence(all=False): from sgtkLib import tkutil, tkm tk, sgw, project = tkutil.getTk(fast=True, scriptName=_USER_) sg = sgw._sg filters = [ ['project', 'is', { 'type': 'Project', 'id': project.id }], ] seqShots = [] #get all the name of the shots and masters from the sequence for v in sg.find('Sequence', filters, ['entity', 'code', 'description']): seq = v['code'] if all: if not seq in seqShots: seqShots.append(seq) else: if int(seq[seq.find('s') + 1:]) < 9000: if not seq in seqShots: seqShots.append(seq) else: print seq + ' will not be included' seqShots = sorted(seqShots) return seqShots
def getAssets(): prod = os.environ['PROD'] tank, sgw, project = tkutil.getTk(prod, fast=True) filteredList = [] topGroupNodes = cmds.ls(assemblies=True) assetNodes = filter(lambda node: isGroup(node), topGroupNodes) envirList = [] charList = [] propList = [] for node in assetNodes: filename = cmds.referenceQuery(node, filename=True) ctx = tank.context_from_path(filename) entity = ctx.entity asset_name = str(entity['name']) asset = sgw.Asset(asset_name, project=project) asset_type = asset.sg_asset_type if asset_type == "environment": envirList.append(node) elif asset_type == "character": if "shot_cam" not in node: charList.append(node) elif asset_type == "prop": propList.append(node) assetsDict = {"ENVIR": envirList, "CHAR": charList, "PROP": propList} return assetsDict
def findShotsInSequence(seq='s1300', dict=False): from sgtkLib import tkutil, tkm tk, sgw, project = tkutil.getTk(fast=True, scriptName=_USER_) sg = sgw._sg filters = [['project', 'is', { 'type': 'Project', 'id': project.id }], ['code', 'is', seq]] res = {} seqShots = [] #get all the name of the shots and masters from the sequence for v in sg.find('Sequence', filters, ['entity', 'shots']): if not 'Shots' in res: tmp = v['shots'] for item in tmp: seqShots.append(item['name']) res['Shots'] = sorted(seqShots) if dict: return res else: return sorted(seqShots)
def getAssetList(type): prod = os.environ['PROD'] tank, sgw, project = tkutil.getTk(prod, fast=True) filteredList = [] topGroupNodes = cmds.ls(assemblies=True) assetNodes = filter(lambda node: isGroup(node), topGroupNodes) for node in assetNodes: filename = cmds.referenceQuery(node, filename=True) ctx = tank.context_from_path(filename) entity = ctx.entity asset_name = str(entity['name']) asset = sgw.Asset(asset_name, project=project) asset_type = asset.sg_asset_type if type == "ENVIR" and asset_type == "environment": filteredList.append(node) elif type == "CHAR" and asset_type == "character": filteredList.append(node) elif type == "PROP" and asset_type == "prop": filteredList.append(node) return filteredList
__author__ = "duda" __copyright__ = "Copyright 2017, Mikros Image" from PyQt5.QtGui import * from PyQt5.QtCore import * from PyQt5.QtWidgets import * from sgApi.sgApi import SgApi from sgtkLib import tkutil, tkm import os, pprint, errno, argparse, sys, math from Katana import NodegraphAPI, UI4 _USER_ = os.environ['USER'] _STARTTIME_ = 101 _USER_ = os.environ['USER'] tk, sgw, project = tkutil.getTk(fast=True, scriptName=_USER_) sg = sgw._sg sgA = SgApi(sgw=sgw, tk=tk, project=project) imageFilterConfoLayout = { 'filter_operator': 'all', 'filters': [ ['tag_list', 'name_is', 'primary'], ['published_file_type', 'name_is', 'QCRmovie'], ] } imageFilterAsset = { 'filter_operator': 'any', 'filters': [
.. module:: moduleName :platform: Unix :synopsis: module idea """ # Python built-in modules import # Third-party modules import # Mikros modules import __author__ = "duda" __copyright__ = "Copyright 2016, Mikros Image" from sgtkLib import tkutil, tkm import time, os, argparse tk, sgw, project = tkutil.getTk(fast=True, scriptName='duda') sg = sgw._sg #get the arg from user def get_args(): #Assign description to the help doc parser = argparse.ArgumentParser( description="create a wipe compare for al sequence or selected shots") #shot argument parser.add_argument('--sq', '-sq', type=str, help='seq number') parser.add_argument('--p', '-p', nargs='*', dest='shots', type=str,
def getShotgunTank(): prod = os.environ['PROD'] tank, sgw, project = tkutil.getTk(prod, fast=True) return tank, sgw, project