mirror of
https://github.com/ynput/ayon-core.git
synced 2025-12-24 21:04:40 +01:00
Merge branch 'develop' into bugfix/OP-5944_nuke_few_fixes
This commit is contained in:
commit
f833bf4f04
7 changed files with 56 additions and 19 deletions
|
|
@ -855,12 +855,13 @@ def get_output_link_versions(project_name, version_id, fields=None):
|
|||
return conn.find(query_filter, _prepare_fields(fields))
|
||||
|
||||
|
||||
def get_last_versions(project_name, subset_ids, fields=None):
|
||||
def get_last_versions(project_name, subset_ids, active=None, fields=None):
|
||||
"""Latest versions for entered subset_ids.
|
||||
|
||||
Args:
|
||||
project_name (str): Name of project where to look for queried entities.
|
||||
subset_ids (Iterable[Union[str, ObjectId]]): List of subset ids.
|
||||
active (Optional[bool]): If True only active versions are returned.
|
||||
fields (Optional[Iterable[str]]): Fields that should be returned. All
|
||||
fields are returned if 'None' is passed.
|
||||
|
||||
|
|
@ -899,12 +900,21 @@ def get_last_versions(project_name, subset_ids, fields=None):
|
|||
if name_needed:
|
||||
group_item["name"] = {"$last": "$name"}
|
||||
|
||||
aggregate_filter = {
|
||||
"type": "version",
|
||||
"parent": {"$in": subset_ids}
|
||||
}
|
||||
if active is False:
|
||||
aggregate_filter["data.active"] = active
|
||||
elif active is True:
|
||||
aggregate_filter["$or"] = [
|
||||
{"data.active": {"$exists": 0}},
|
||||
{"data.active": active},
|
||||
]
|
||||
|
||||
aggregation_pipeline = [
|
||||
# Find all versions of those subsets
|
||||
{"$match": {
|
||||
"type": "version",
|
||||
"parent": {"$in": subset_ids}
|
||||
}},
|
||||
{"$match": aggregate_filter},
|
||||
# Sorting versions all together
|
||||
{"$sort": {"name": 1}},
|
||||
# Group them by "parent", but only take the last
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@ from operator import attrgetter
|
|||
|
||||
import json
|
||||
|
||||
from openpype.host import HostBase, IWorkfileHost, ILoadHost, INewPublisher
|
||||
from openpype.host import HostBase, IWorkfileHost, ILoadHost, IPublishHost
|
||||
import pyblish.api
|
||||
from openpype.pipeline import (
|
||||
register_creator_plugin_path,
|
||||
|
|
@ -28,7 +28,7 @@ CREATE_PATH = os.path.join(PLUGINS_DIR, "create")
|
|||
INVENTORY_PATH = os.path.join(PLUGINS_DIR, "inventory")
|
||||
|
||||
|
||||
class MaxHost(HostBase, IWorkfileHost, ILoadHost, INewPublisher):
|
||||
class MaxHost(HostBase, IWorkfileHost, ILoadHost, IPublishHost):
|
||||
|
||||
name = "max"
|
||||
menu = None
|
||||
|
|
|
|||
|
|
@ -364,6 +364,17 @@ class ValidateRenderSettings(pyblish.api.InstancePlugin):
|
|||
cmds.setAttr("defaultRenderGlobals.animation", True)
|
||||
|
||||
# Repair prefix
|
||||
if renderer == "arnold":
|
||||
multipart = cmds.getAttr("defaultArnoldDriver.mergeAOVs")
|
||||
if multipart:
|
||||
separator_variations = [
|
||||
"_<RenderPass>",
|
||||
"<RenderPass>_",
|
||||
"<RenderPass>",
|
||||
]
|
||||
for variant in separator_variations:
|
||||
default_prefix = default_prefix.replace(variant, "")
|
||||
|
||||
if renderer != "renderman":
|
||||
node = render_attrs["node"]
|
||||
prefix_attr = render_attrs["prefix"]
|
||||
|
|
|
|||
|
|
@ -487,7 +487,22 @@ or updating already created. Publishing will create OTIO file.
|
|||
)
|
||||
|
||||
# get video stream data
|
||||
video_stream = media_data["streams"][0]
|
||||
video_streams = []
|
||||
audio_streams = []
|
||||
for stream in media_data["streams"]:
|
||||
codec_type = stream.get("codec_type")
|
||||
if codec_type == "audio":
|
||||
audio_streams.append(stream)
|
||||
|
||||
elif codec_type == "video":
|
||||
video_streams.append(stream)
|
||||
|
||||
if not video_streams:
|
||||
raise ValueError(
|
||||
"Could not find video stream in source file."
|
||||
)
|
||||
|
||||
video_stream = video_streams[0]
|
||||
return_data = {
|
||||
"video": True,
|
||||
"start_frame": 0,
|
||||
|
|
@ -500,12 +515,7 @@ or updating already created. Publishing will create OTIO file.
|
|||
}
|
||||
|
||||
# get audio streams data
|
||||
audio_stream = [
|
||||
stream for stream in media_data["streams"]
|
||||
if stream["codec_type"] == "audio"
|
||||
]
|
||||
|
||||
if audio_stream:
|
||||
if audio_streams:
|
||||
return_data["audio"] = True
|
||||
|
||||
except Exception as exc:
|
||||
|
|
|
|||
|
|
@ -825,7 +825,8 @@ class ProcessSubmittedJobOnFarm(pyblish.api.InstancePlugin):
|
|||
).format(source))
|
||||
|
||||
family = "render"
|
||||
if "prerender" in instance.data["families"]:
|
||||
if ("prerender" in instance.data["families"] or
|
||||
"prerender.farm" in instance.data["families"]):
|
||||
family = "prerender"
|
||||
families = [family]
|
||||
|
||||
|
|
|
|||
|
|
@ -446,6 +446,7 @@ class SubsetsModel(BaseRepresentationModel, TreeModel):
|
|||
last_versions_by_subset_id = get_last_versions(
|
||||
project_name,
|
||||
subset_ids,
|
||||
active=True,
|
||||
fields=["_id", "parent", "name", "type", "data", "schema"]
|
||||
)
|
||||
|
||||
|
|
|
|||
|
|
@ -123,10 +123,14 @@ class VersionDelegate(QtWidgets.QStyledItemDelegate):
|
|||
project_name = self.dbcon.active_project()
|
||||
# Add all available versions to the editor
|
||||
parent_id = item["version_document"]["parent"]
|
||||
version_docs = list(sorted(
|
||||
get_versions(project_name, subset_ids=[parent_id]),
|
||||
key=lambda item: item["name"]
|
||||
))
|
||||
version_docs = [
|
||||
version_doc
|
||||
for version_doc in sorted(
|
||||
get_versions(project_name, subset_ids=[parent_id]),
|
||||
key=lambda item: item["name"]
|
||||
)
|
||||
if version_doc["data"].get("active", True)
|
||||
]
|
||||
|
||||
hero_versions = list(
|
||||
get_hero_versions(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue