Merge branch 'release/2.10.0' into bugfix/264-Pyblish-pype_is_too_slow_with_10_instances

This commit is contained in:
iLLiCiTiT 2020-06-17 17:30:34 +02:00
commit 6107f4c5fd
4 changed files with 35 additions and 13 deletions

View file

@ -8,12 +8,11 @@ except ImportError:
import errno
class ValidateFFmpegInstalled(pyblish.api.Validator):
class ValidateFFmpegInstalled(pyblish.api.ContextPlugin):
"""Validate availability of ffmpeg tool in PATH"""
order = pyblish.api.ValidatorOrder
label = 'Validate ffmpeg installation'
families = ['review']
optional = True
def is_tool(self, name):
@ -27,7 +26,7 @@ class ValidateFFmpegInstalled(pyblish.api.Validator):
return False
return True
def process(self, instance):
def process(self, context):
ffmpeg_path = pype.lib.get_ffmpeg_tool_path("ffmpeg")
self.log.info("ffmpeg path: `{}`".format(ffmpeg_path))
if self.is_tool(ffmpeg_path) is False:

View file

@ -60,14 +60,8 @@ class CollectShots(pyblish.api.InstancePlugin):
# options to be more flexible.
asset_name = asset_name.split("_")[0]
shot_number = 10
instances = []
for track in tracks:
self.log.info(track)
if "audio" in track.name.lower():
continue
instances = []
for child in track.each_child():
# Transitions are ignored, because Clips have the full frame
@ -75,10 +69,13 @@ class CollectShots(pyblish.api.InstancePlugin):
if isinstance(child, otio.schema.transition.Transition):
continue
# Hardcoded to expect a shot name of "[name].[extension]"
child_name = os.path.splitext(child.name)[0].lower()
name = f"{asset_name}_{child_name}"
frame_start = child.range_in_parent().start_time.value
frame_end = child.range_in_parent().end_time_inclusive().value
name = f"{asset_name}_sh{shot_number:04}"
label = f"{name} (framerange: {frame_start}-{frame_end})"
instances.append(
instance.context.create_instance(**{
@ -96,8 +93,6 @@ class CollectShots(pyblish.api.InstancePlugin):
})
)
shot_number += 10
visual_hierarchy = [asset_entity]
while True:
visual_parent = io.find_one(

View file

@ -0,0 +1,23 @@
import pyblish.api
import pype.api
class ValidateShots(pyblish.api.ContextPlugin):
"""Validate there is a "mov" next to the editorial file."""
label = "Validate Shots"
hosts = ["standalonepublisher"]
order = pype.api.ValidateContentsOrder
def process(self, context):
shot_names = []
duplicate_names = []
for instance in context:
name = instance.data["name"]
if name in shot_names:
duplicate_names.append(name)
else:
shot_names.append(name)
msg = "There are duplicate shot names:\n{}".format(duplicate_names)
assert not duplicate_names, msg

View file

@ -307,6 +307,11 @@ class Controller(QtCore.QObject):
"%s was inactive, skipping.." % instance
)
continue
# Stop if was stopped
if self.stopped:
self.stopped = False
yield IterationBreak("Stopped")
yield (plugin, instance)
else:
families = util.collect_families_from_instances(