Skip to content
This repository has been archived by the owner on Sep 20, 2024. It is now read-only.

Commit

Permalink
[Automated] Merged develop into main
Browse files Browse the repository at this point in the history
  • Loading branch information
ynbot authored Jul 3, 2021
2 parents f2fb988 + af62e10 commit 5349e8e
Show file tree
Hide file tree
Showing 9 changed files with 593 additions and 411 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,10 @@ def process(self, instance):
self.log.warning("Cannot check for extension {}".format(ext))
return

frames = len(instance.data.get("representations", [None])[0]["files"])
files = instance.data.get("representations", [None])[0]["files"]
if isinstance(files, str):
files = [files]
frames = len(files)

err_msg = "Frame duration from DB:'{}' ". format(int(duration)) +\
" doesn't match number of files:'{}'".format(frames) +\
Expand Down
2 changes: 2 additions & 0 deletions openpype/lib/editorial.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
import opentimelineio as otio
from opentimelineio import opentime as _ot
except ImportError:
if not os.environ.get("AVALON_APP"):
raise
otio = discover_host_vendor_module("opentimelineio")
_ot = discover_host_vendor_module("opentimelineio.opentime")

Expand Down
25 changes: 17 additions & 8 deletions openpype/modules/deadline/plugins/publish/submit_nuke_deadline.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ class NukeSubmitDeadline(pyblish.api.InstancePlugin):
department = ""
limit_groups = {}
use_gpu = False
env_allowed_keys = []
env_search_replace_values = {}

def process(self, instance):
instance.data["toBeRenderedOn"] = "deadline"
Expand Down Expand Up @@ -242,19 +244,19 @@ def payload_submit(self,
"PYBLISHPLUGINPATH",
"NUKE_PATH",
"TOOL_ENV",
"OPENPYPE_DEV",
"FOUNDRY_LICENSE"
]
# add allowed keys from preset if any
if self.env_allowed_keys:
keys += self.env_allowed_keys

environment = dict({key: os.environ[key] for key in keys
if key in os.environ}, **api.Session)
# self.log.debug("enviro: {}".format(pprint(environment)))
for path in os.environ:
if path.lower().startswith('pype_'):
environment[path] = os.environ[path]
if path.lower().startswith('nuke_'):
environment[path] = os.environ[path]
if 'license' in path.lower():
environment[path] = os.environ[path]

for _path in os.environ:
if _path.lower().startswith('openpype_'):
environment[_path] = os.environ[_path]

clean_environment = {}
for key, value in environment.items():
Expand Down Expand Up @@ -285,6 +287,13 @@ def payload_submit(self,
environment = clean_environment
# to recognize job from PYPE for turning Event On/Off
environment["OPENPYPE_RENDER_JOB"] = "1"

# finally search replace in values of any key
if self.env_search_replace_values:
for key, value in environment.items():
for _k, _v in self.env_search_replace_values.items():
environment[key] = value.replace(_k, _v)

payload["JobInfo"].update({
"EnvironmentKeyValue%d" % index: "{key}={value}".format(
key=key,
Expand Down
2 changes: 2 additions & 0 deletions openpype/settings/defaults/project_settings/deadline.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@
"group": "",
"department": "",
"use_gpu": true,
"env_allowed_keys": [],
"env_search_replace_values": {},
"limit_groups": {}
},
"HarmonySubmitDeadline": {
Expand Down
6 changes: 5 additions & 1 deletion openpype/settings/entities/base_entity.py
Original file line number Diff line number Diff line change
Expand Up @@ -894,7 +894,11 @@ def schema_validations(self):

def create_schema_object(self, *args, **kwargs):
"""Reference method for creation of entities defined in RootEntity."""
return self.root_item.create_schema_object(*args, **kwargs)
return self.schema_hub.create_schema_object(*args, **kwargs)

@property
def schema_hub(self):
return self.root_item.schema_hub

def get_entity_from_path(self, path):
return self.root_item.get_entity_from_path(path)
Expand Down
12 changes: 11 additions & 1 deletion openpype/settings/entities/dict_immutable_keys_entity.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import copy
import collections

from .lib import (
WRAPPER_TYPES,
Expand Down Expand Up @@ -138,7 +139,16 @@ def _add_children(self, schema_data, first=True):
method when handling gui wrappers.
"""
added_children = []
for children_schema in schema_data["children"]:
children_deque = collections.deque()
for _children_schema in schema_data["children"]:
children_schemas = self.schema_hub.resolve_schema_data(
_children_schema
)
for children_schema in children_schemas:
children_deque.append(children_schema)

while children_deque:
children_schema = children_deque.popleft()
if children_schema["type"] in WRAPPER_TYPES:
_children_schema = copy.deepcopy(children_schema)
wrapper_children = self._add_children(
Expand Down
Loading

0 comments on commit 5349e8e

Please sign in to comment.