You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
However the studio and user could customize the Deadline Webservice URL and the deadline pools would be a dynamic result.
For example this logic is used in maya:
try:
default_servers=deadline_settings["deadline_urls"]
project_servers= (
self._project_settings["deadline"]["deadline_servers"]
)
self.deadline_servers= {
k: default_servers[k]
forkinproject_serversifkindefault_servers
}
ifnotself.deadline_servers:
self.deadline_servers=default_serversexceptAttributeError:
# Handle situation were we had only one url for deadline.# get default deadline webservice url from deadline moduleself.deadline_servers=self.deadline_module.deadline_urls
Be able to delay the query of e.g. deadline_module.get_deadline_pools(deadline_url) to when it'd be needed - e.g. so that it updates the Pools list when clicking on the Enum for the first time.
Be able to "update" the available pool list e.g. another attribute definition would be changed, like the Deadline URL
Here's some pseudocode:
@classmethoddefget_attribute_defs(cls):
fromopenpype.libimportEnumDeffromfunctoolsimportpartialurl_def=EnumDef("url",
label="Webservice URL",
items=project_deadline_urls)
defget_pools(_url_def):
"""Return pool list based on value of url EnumDef"""url=_url_def.valuemanager=ModulesManager()
deadline_module=manager.modules_by_name["deadline"]
pools=deadline_module.get_deadline_pools(url)
return {key: keyforkeyinpools}
fn_get_pools=partial(get_pools, url_def)
primary_pool_def=EnumDef("primaryPool",
label="Primary Pool",
default=cls.primary_pool,
itemgetter=fn_get_pools)
secondary_pool_def=EnumDef("secondaryPool",
label="Secondary Pool",
default=cls.secondary_pool,
itemgetter=fn_get_pools)
url_def.valueChanged.connect(primary_pool_def.updateItems)
url_def.valueChanged.connect(secondary_pool_def.updateItems)
return [
url_def,
primary_pool_def,
secondary_pool_def
]
Describe alternatives you've considered
Not sure what other approaches there are for the new publisher to expose this.
The text was updated successfully, but these errors were encountered:
iLLiCiTiT
changed the title
New Publisher: Support dynamic/cached attribute definitions
Publisher: Support dynamic/cached attribute definitions
Feb 24, 2023
Is your feature request related to a problem? Please describe.
I'd like to expose the
primaryPool
andsecondaryPool
to the user in the New Publisher.I thought of adding this to Collect Deadline Pools:
However the studio and user could customize the Deadline Webservice URL and the deadline pools would be a dynamic result.
For example this logic is used in maya:
Source
Describe the solution you'd like
deadline_module.get_deadline_pools(deadline_url)
to when it'd be needed - e.g. so that it updates the Pools list when clicking on the Enum for the first time.Here's some pseudocode:
Describe alternatives you've considered
Not sure what other approaches there are for the new publisher to expose this.
Additional context
Also mentioned on discord
[cuID:OP-4827]
The text was updated successfully, but these errors were encountered: