mirror of
https://github.com/ynput/ayon-core.git
synced 2025-12-24 21:04:40 +01:00
Merge branch 'develop' into enhancement/OP-6020_Nuke-custom-setFrameRange-script
This commit is contained in:
commit
7eedc622c1
10 changed files with 64 additions and 29 deletions
|
|
@ -103,8 +103,8 @@ class CollectRenderInstances(pyblish.api.InstancePlugin):
|
|||
new_instance.data["representations"] = []
|
||||
|
||||
repr = {
|
||||
'frameStart': s.get('frame_range')[0],
|
||||
'frameEnd': s.get('frame_range')[1],
|
||||
'frameStart': instance.data["frameStart"],
|
||||
'frameEnd': instance.data["frameEnd"],
|
||||
'name': 'png',
|
||||
'ext': 'png',
|
||||
'files': frames,
|
||||
|
|
|
|||
|
|
@ -31,8 +31,8 @@ class ValidateSequenceFrames(pyblish.api.InstancePlugin):
|
|||
frames = list(collection.indexes)
|
||||
|
||||
current_range = (frames[0], frames[-1])
|
||||
required_range = (data["frameStart"],
|
||||
data["frameEnd"])
|
||||
required_range = (data["clipIn"],
|
||||
data["clipOut"])
|
||||
|
||||
if current_range != required_range:
|
||||
raise ValueError(f"Invalid frame range: {current_range} - "
|
||||
|
|
|
|||
|
|
@ -196,7 +196,7 @@ class ProcessEventHub(SocketBaseEventHub):
|
|||
{"pype_data.is_processed": False}
|
||||
).sort(
|
||||
[("pype_data.stored", pymongo.ASCENDING)]
|
||||
)
|
||||
).limit(100)
|
||||
|
||||
found = False
|
||||
for event_data in not_processed_events:
|
||||
|
|
|
|||
|
|
@ -39,6 +39,7 @@ from .lib import (
|
|||
|
||||
apply_plugin_settings_automatically,
|
||||
get_plugin_settings,
|
||||
get_publish_instance_label,
|
||||
)
|
||||
|
||||
from .abstract_expected_files import ExpectedFiles
|
||||
|
|
@ -85,6 +86,7 @@ __all__ = (
|
|||
|
||||
"apply_plugin_settings_automatically",
|
||||
"get_plugin_settings",
|
||||
"get_publish_instance_label",
|
||||
|
||||
"ExpectedFiles",
|
||||
|
||||
|
|
|
|||
|
|
@ -30,6 +30,8 @@ from .contants import (
|
|||
TRANSIENT_DIR_TEMPLATE
|
||||
)
|
||||
|
||||
_ARG_PLACEHOLDER = object()
|
||||
|
||||
|
||||
def get_template_name_profiles(
|
||||
project_name, project_settings=None, logger=None
|
||||
|
|
@ -866,3 +868,33 @@ def add_repre_files_for_cleanup(instance, repre):
|
|||
for file_name in files:
|
||||
expected_file = os.path.join(staging_dir, file_name)
|
||||
instance.context.data["cleanupFullPaths"].append(expected_file)
|
||||
|
||||
|
||||
def get_publish_instance_label(instance, default=_ARG_PLACEHOLDER):
|
||||
"""Try to get label from pyblish instance.
|
||||
|
||||
First are checked 'label' and 'name' keys in instance data. If are not set
|
||||
a default value is returned. Instance object is converted to string
|
||||
if default value is not specific.
|
||||
|
||||
Todos:
|
||||
Maybe 'subset' key could be used too.
|
||||
|
||||
Args:
|
||||
instance (pyblish.api.Instance): Pyblish instance.
|
||||
default (Optional[Any]): Default value to return if any
|
||||
|
||||
Returns:
|
||||
Union[Any]: Instance label or default label.
|
||||
"""
|
||||
|
||||
label = (
|
||||
instance.data.get("label")
|
||||
or instance.data.get("name")
|
||||
)
|
||||
if label:
|
||||
return label
|
||||
|
||||
if default is _ARG_PLACEHOLDER:
|
||||
return str(instance)
|
||||
return default
|
||||
|
|
|
|||
|
|
@ -43,6 +43,7 @@ from openpype.pipeline.load import (
|
|||
get_contexts_for_repre_docs,
|
||||
load_with_repre_context,
|
||||
)
|
||||
|
||||
from openpype.pipeline.create import (
|
||||
discover_legacy_creator_plugins,
|
||||
CreateContext,
|
||||
|
|
@ -1246,6 +1247,16 @@ class PlaceholderLoadMixin(object):
|
|||
|
||||
loader_items = list(sorted(loader_items, key=lambda i: i["label"]))
|
||||
options = options or {}
|
||||
|
||||
# Get families from all loaders excluding "*"
|
||||
families = set()
|
||||
for loader in loaders_by_name.values():
|
||||
families.update(loader.families)
|
||||
families.discard("*")
|
||||
|
||||
# Sort for readability
|
||||
families = list(sorted(families))
|
||||
|
||||
return [
|
||||
attribute_definitions.UISeparatorDef(),
|
||||
attribute_definitions.UILabelDef("Main attributes"),
|
||||
|
|
@ -1272,11 +1283,11 @@ class PlaceholderLoadMixin(object):
|
|||
" field \"inputLinks\""
|
||||
)
|
||||
),
|
||||
attribute_definitions.TextDef(
|
||||
attribute_definitions.EnumDef(
|
||||
"family",
|
||||
label="Family",
|
||||
default=options.get("family"),
|
||||
placeholder="model, look, ..."
|
||||
items=families
|
||||
),
|
||||
attribute_definitions.TextDef(
|
||||
"representation",
|
||||
|
|
|
|||
|
|
@ -23,7 +23,10 @@ from openpype.lib.transcoding import (
|
|||
convert_input_paths_for_ffmpeg,
|
||||
get_transcode_temp_directory,
|
||||
)
|
||||
from openpype.pipeline.publish import KnownPublishError
|
||||
from openpype.pipeline.publish import (
|
||||
KnownPublishError,
|
||||
get_publish_instance_label,
|
||||
)
|
||||
from openpype.pipeline.publish.lib import add_repre_files_for_cleanup
|
||||
|
||||
|
||||
|
|
@ -203,17 +206,8 @@ class ExtractReview(pyblish.api.InstancePlugin):
|
|||
|
||||
return filtered_defs
|
||||
|
||||
@staticmethod
|
||||
def get_instance_label(instance):
|
||||
return (
|
||||
getattr(instance, "label", None)
|
||||
or instance.data.get("label")
|
||||
or instance.data.get("name")
|
||||
or str(instance)
|
||||
)
|
||||
|
||||
def main_process(self, instance):
|
||||
instance_label = self.get_instance_label(instance)
|
||||
instance_label = get_publish_instance_label(instance)
|
||||
self.log.debug("Processing instance \"{}\"".format(instance_label))
|
||||
profile_outputs = self._get_outputs_for_instance(instance)
|
||||
if not profile_outputs:
|
||||
|
|
|
|||
|
|
@ -20,6 +20,7 @@ import pyblish.api
|
|||
|
||||
from openpype.client import get_versions
|
||||
from openpype.client.operations import OperationsSession, new_thumbnail_doc
|
||||
from openpype.pipeline.publish import get_publish_instance_label
|
||||
|
||||
InstanceFilterResult = collections.namedtuple(
|
||||
"InstanceFilterResult",
|
||||
|
|
@ -133,7 +134,7 @@ class IntegrateThumbnails(pyblish.api.ContextPlugin):
|
|||
|
||||
filtered_instances = []
|
||||
for instance in context:
|
||||
instance_label = self._get_instance_label(instance)
|
||||
instance_label = get_publish_instance_label(instance)
|
||||
# Skip instances without published representations
|
||||
# - there is no place where to put the thumbnail
|
||||
published_repres = instance.data.get("published_representations")
|
||||
|
|
@ -248,7 +249,7 @@ class IntegrateThumbnails(pyblish.api.ContextPlugin):
|
|||
|
||||
for instance_item in filtered_instance_items:
|
||||
instance, thumbnail_path, version_id = instance_item
|
||||
instance_label = self._get_instance_label(instance)
|
||||
instance_label = get_publish_instance_label(instance)
|
||||
version_doc = version_docs_by_str_id.get(version_id)
|
||||
if not version_doc:
|
||||
self.log.warning((
|
||||
|
|
@ -339,10 +340,3 @@ class IntegrateThumbnails(pyblish.api.ContextPlugin):
|
|||
))
|
||||
|
||||
op_session.commit()
|
||||
|
||||
def _get_instance_label(self, instance):
|
||||
return (
|
||||
instance.data.get("label")
|
||||
or instance.data.get("name")
|
||||
or "N/A"
|
||||
)
|
||||
|
|
|
|||
|
|
@ -40,6 +40,7 @@ from openpype.pipeline.create.context import (
|
|||
CreatorsOperationFailed,
|
||||
ConvertorsOperationFailed,
|
||||
)
|
||||
from openpype.pipeline.publish import get_publish_instance_label
|
||||
|
||||
# Define constant for plugin orders offset
|
||||
PLUGIN_ORDER_OFFSET = 0.5
|
||||
|
|
@ -346,7 +347,7 @@ class PublishReportMaker:
|
|||
def _extract_instance_data(self, instance, exists):
|
||||
return {
|
||||
"name": instance.data.get("name"),
|
||||
"label": instance.data.get("label"),
|
||||
"label": get_publish_instance_label(instance),
|
||||
"family": instance.data["family"],
|
||||
"families": instance.data.get("families") or [],
|
||||
"exists": exists,
|
||||
|
|
|
|||
|
|
@ -310,7 +310,7 @@ class PublishFrame(QtWidgets.QWidget):
|
|||
self._set_success_property()
|
||||
self._set_progress_visibility(True)
|
||||
|
||||
self._main_label.setText("Hit publish (play button)! If you want")
|
||||
self._main_label.setText("")
|
||||
self._message_label_top.setText("")
|
||||
|
||||
self._reset_btn.setEnabled(True)
|
||||
|
|
@ -331,6 +331,7 @@ class PublishFrame(QtWidgets.QWidget):
|
|||
self._set_success_property(3)
|
||||
self._set_progress_visibility(True)
|
||||
self._set_main_label("Publishing...")
|
||||
self._message_label_top.setText("")
|
||||
|
||||
self._reset_btn.setEnabled(False)
|
||||
self._stop_btn.setEnabled(True)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue