mirror of
https://github.com/alicevision/Meshroom.git
synced 2025-05-18 19:46:26 +02:00
Merge pull request #2163 from alicevision/dev/keyframeVideoOutput
KeyframeSelection: Flag `outputExtension` attribute when it is set to "none" for video inputs
This commit is contained in:
commit
2bea35d00d
3 changed files with 10 additions and 2 deletions
|
@ -196,6 +196,7 @@ class Attribute(BaseObject):
|
|||
self.requestNodeUpdate()
|
||||
|
||||
self.valueChanged.emit()
|
||||
self.validValueChanged.emit()
|
||||
|
||||
def upgradeValue(self, exportedValue):
|
||||
self._set_value(exportedValue)
|
||||
|
|
|
@ -303,13 +303,15 @@ class FloatParam(Param):
|
|||
class ChoiceParam(Param):
|
||||
"""
|
||||
"""
|
||||
def __init__(self, name, label, description, value, values, exclusive, uid, group='allParams', joinChar=' ', advanced=False, semantic='', enabled=True):
|
||||
def __init__(self, name, label, description, value, values, exclusive, uid, group='allParams', joinChar=' ', advanced=False, semantic='',
|
||||
enabled=True, validValue=True, errorMessage=""):
|
||||
assert values
|
||||
self._values = values
|
||||
self._exclusive = exclusive
|
||||
self._joinChar = joinChar
|
||||
self._valueType = type(self._values[0]) # cast to value type
|
||||
super(ChoiceParam, self).__init__(name=name, label=label, description=description, value=value, uid=uid, group=group, advanced=advanced, semantic=semantic, enabled=enabled)
|
||||
super(ChoiceParam, self).__init__(name=name, label=label, description=description, value=value, uid=uid, group=group, advanced=advanced,
|
||||
semantic=semantic, enabled=enabled, validValue=validValue, errorMessage=errorMessage)
|
||||
|
||||
def conformValue(self, val):
|
||||
""" Conform 'val' to the correct type and check for its validity """
|
||||
|
|
|
@ -3,6 +3,9 @@ __version__ = "5.0"
|
|||
import os
|
||||
from meshroom.core import desc
|
||||
|
||||
# List of supported video extensions (provided by OpenImageIO)
|
||||
videoExts = [".avi", ".mov", ".mp4", ".m4a", ".m4v", ".3gp", ".3g2", ".mj2", ".m4v", ".mpg"]
|
||||
|
||||
class KeyframeSelectionNodeSize(desc.DynamicNodeSize):
|
||||
def computeSize(self, node):
|
||||
inputPathsSize = super(KeyframeSelectionNodeSize, self).computeSize(node)
|
||||
|
@ -299,6 +302,8 @@ You can extract frames at regular interval by configuring only the min/maxFrameS
|
|||
value="none",
|
||||
values=["none", "exr", "jpg", "png"],
|
||||
exclusive=True,
|
||||
validValue=lambda node: not (any(ext in input.value.lower() for ext in videoExts for input in node.inputPaths.value) and node.outputExtension.value == "none"),
|
||||
errorMessage="A video input has been provided. The output extension should be different from 'none'.",
|
||||
uid=[0],
|
||||
),
|
||||
desc.ChoiceParam(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue