Merge branch 'develop' of github.com:pypeclub/OpenPype into chore/site_sync_expose_sites_skeleton

This commit is contained in:
Petr Kalis 2022-04-06 13:12:51 +02:00
commit d23c6287ea
141 changed files with 3404 additions and 1355 deletions

View file

@ -27,6 +27,7 @@ class NukeSubmitDeadline(pyblish.api.InstancePlugin):
# presets
priority = 50
chunk_size = 1
concurrent_tasks = 1
primary_pool = ""
secondary_pool = ""
group = ""
@ -149,11 +150,16 @@ class NukeSubmitDeadline(pyblish.api.InstancePlugin):
pass
# define chunk and priority
chunk_size = instance.data.get("deadlineChunkSize")
chunk_size = instance.data["deadlineChunkSize"]
if chunk_size == 0 and self.chunk_size:
chunk_size = self.chunk_size
priority = instance.data.get("deadlinePriority")
# define chunk and priority
concurrent_tasks = instance.data["deadlineConcurrentTasks"]
if concurrent_tasks == 0 and self.concurrent_tasks:
concurrent_tasks = self.concurrent_tasks
priority = instance.data["deadlinePriority"]
if not priority:
priority = self.priority
@ -177,6 +183,8 @@ class NukeSubmitDeadline(pyblish.api.InstancePlugin):
"Priority": priority,
"ChunkSize": chunk_size,
"ConcurrentTasks": concurrent_tasks,
"Department": self.department,
"Pool": self.primary_pool,

View file

@ -509,8 +509,8 @@ class ProcessSubmittedJobOnFarm(pyblish.api.InstancePlugin):
most cases, but if not - we create representation from each of them.
Arguments:
instance (pyblish.plugin.Instance): instance for which we are
setting representations
instance (dict): instance data for which we are
setting representations
exp_files (list): list of expected files
Returns:
@ -528,6 +528,11 @@ class ProcessSubmittedJobOnFarm(pyblish.api.InstancePlugin):
# preview video rendering
for app in self.aov_filter.keys():
if os.environ.get("AVALON_APP", "") == app:
# no need to add review if `hasReviewableRepresentations`
if instance.get("hasReviewableRepresentations"):
break
# iteratre all aov filters
for aov in self.aov_filter[app]:
if re.match(
aov,
@ -724,7 +729,9 @@ class ProcessSubmittedJobOnFarm(pyblish.api.InstancePlugin):
"resolutionWidth": data.get("resolutionWidth", 1920),
"resolutionHeight": data.get("resolutionHeight", 1080),
"multipartExr": data.get("multipartExr", False),
"jobBatchName": data.get("jobBatchName", "")
"jobBatchName": data.get("jobBatchName", ""),
"hasReviewableRepresentations": data.get(
"hasReviewableRepresentations")
}
if "prerender" in instance.data["families"]:

View file

@ -286,21 +286,6 @@ def from_dict_to_set(data, is_project):
return result
def get_avalon_project_template(project_name):
"""Get avalon template
Args:
project_name: (string)
Returns:
dictionary with templates
"""
templates = Anatomy(project_name).templates
return {
"workfile": templates["avalon"]["workfile"],
"work": templates["avalon"]["work"],
"publish": templates["avalon"]["publish"]
}
def get_project_apps(in_app_list):
""" Application definitions for app name.

View file

@ -35,6 +35,7 @@ class IntegrateFtrackInstance(pyblish.api.InstancePlugin):
"image": "img",
"reference": "reference"
}
keep_first_subset_name_for_review = True
def process(self, instance):
self.log.debug("instance {}".format(instance))
@ -168,7 +169,47 @@ class IntegrateFtrackInstance(pyblish.api.InstancePlugin):
# Change asset name of each new component for review
is_first_review_repre = True
not_first_components = []
extended_asset_name = ""
multiple_reviewable = len(review_representations) > 1
for repre in review_representations:
# Create copy of base comp item and append it
review_item = copy.deepcopy(base_component_item)
# get asset name and define extended name variant
asset_name = review_item["asset_data"]["name"]
extended_asset_name = "_".join(
(asset_name, repre["name"])
)
# reset extended if no need for extended asset name
if (
self.keep_first_subset_name_for_review
and is_first_review_repre
):
extended_asset_name = ""
else:
# only rename if multiple reviewable
if multiple_reviewable:
review_item["asset_data"]["name"] = extended_asset_name
else:
extended_asset_name = ""
# rename all already created components
# only if first repre and extended name available
if is_first_review_repre and extended_asset_name:
# and rename all already created components
for _ci in component_list:
_ci["asset_data"]["name"] = extended_asset_name
# and rename all already created src components
for _sci in src_components_to_add:
_sci["asset_data"]["name"] = extended_asset_name
# rename also first thumbnail component if any
if first_thumbnail_component is not None:
first_thumbnail_component[
"asset_data"]["name"] = extended_asset_name
frame_start = repre.get("frameStartFtrack")
frame_end = repre.get("frameEndFtrack")
if frame_start is None or frame_end is None:
@ -184,8 +225,6 @@ class IntegrateFtrackInstance(pyblish.api.InstancePlugin):
if fps is None:
fps = instance_fps
# Create copy of base comp item and append it
review_item = copy.deepcopy(base_component_item)
# Change location
review_item["component_path"] = repre["published_path"]
# Change component data
@ -200,18 +239,16 @@ class IntegrateFtrackInstance(pyblish.api.InstancePlugin):
})
}
}
# Create copy of item before setting location or changing asset
src_components_to_add.append(copy.deepcopy(review_item))
if is_first_review_repre:
is_first_review_repre = False
else:
# Add representation name to asset name of "not first" review
asset_name = review_item["asset_data"]["name"]
review_item["asset_data"]["name"] = "_".join(
(asset_name, repre["name"])
)
# later detection for thumbnail duplication
not_first_components.append(review_item)
# Create copy of item before setting location
src_components_to_add.append(copy.deepcopy(review_item))
# Set location
review_item["component_location"] = ftrack_server_location
# Add item to component list
@ -249,6 +286,14 @@ class IntegrateFtrackInstance(pyblish.api.InstancePlugin):
continue
# Create copy of base comp item and append it
other_item = copy.deepcopy(base_component_item)
# add extended name if any
if (
not self.keep_first_subset_name_for_review
and extended_asset_name
):
other_item["asset_data"]["name"] = extended_asset_name
other_item["component_data"] = {
"name": repre["name"]
}

View file

@ -27,11 +27,11 @@ class LogsWindow(QtWidgets.QWidget):
self.setStyleSheet(style.load_stylesheet())
self._frist_show = True
self._first_show = True
def showEvent(self, event):
super(LogsWindow, self).showEvent(event)
if self._frist_show:
self._frist_show = False
if self._first_show:
self._first_show = False
self.logs_widget.refresh()