mirror of
https://github.com/ynput/ayon-core.git
synced 2025-12-26 13:52:15 +01:00
fetch and display pools
This commit is contained in:
parent
42b2b653d9
commit
8e63de922b
1 changed files with 15 additions and 3 deletions
|
|
@ -1,8 +1,10 @@
|
|||
from collections import OrderedDict
|
||||
|
||||
import maya.cmds as cmds
|
||||
from maya import cmds
|
||||
|
||||
from avalon.vendor import requests
|
||||
import avalon.maya
|
||||
from avalon import api
|
||||
|
||||
|
||||
class CreateRenderGlobals(avalon.maya.Creator):
|
||||
|
|
@ -17,6 +19,16 @@ class CreateRenderGlobals(avalon.maya.Creator):
|
|||
# We won't be publishing this one
|
||||
self.data["id"] = "avalon.renderglobals"
|
||||
|
||||
# get pools
|
||||
AVALON_DEADLINE = api.Session["AVALON_DEADLINE"]
|
||||
argument = "{}/api/pools?NamesOnly=true".format(AVALON_DEADLINE)
|
||||
response = requests.get(argument)
|
||||
if not response.ok:
|
||||
self.log.warning("No pools retrieved")
|
||||
pools = []
|
||||
else:
|
||||
pools = response.json()
|
||||
|
||||
# We don't need subset or asset attributes
|
||||
self.data.pop("subset", None)
|
||||
self.data.pop("asset", None)
|
||||
|
|
@ -27,13 +39,13 @@ class CreateRenderGlobals(avalon.maya.Creator):
|
|||
data["suspendPublishJob"] = False
|
||||
data["extendFrames"] = False
|
||||
data["overrideExistingFrame"] = True
|
||||
data["includeDefaultRenderLayer"] = False
|
||||
data["useLegacyRenderLayers"] = True
|
||||
data["priority"] = 50
|
||||
data["whitelist"] = False
|
||||
data["machineList"] = ""
|
||||
data["pools"] = ""
|
||||
data["useMayaBatch"] = True
|
||||
data["primaryPool"] = pools
|
||||
data["secondaryPool"] = pools
|
||||
|
||||
self.data = data
|
||||
self.options = {"useSelection": False} # Force no content
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue