Skip to content

video

VideoNode

Bases: WorkflowTaskNode

Define a video path (existing or not).

Source code in client/ayon_workflow/plugins/workflow/essentials/video.py
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
class VideoNode(WorkflowTaskNode):
    """Define a video path (existing or not)."""

    name = "Video"
    version = "0.0.1"
    inputs = [
        InputAttribute(
            name="path",
            description="The path to the video.",
            widget={
                "name": "filepath",
                "select": "file",
                "caption": "Select a video file.",
            },
        ),
        InputAttribute(
            name="frame_range",
            description="An optional frame_range.",
        ),
    ]
    outputs = [
        OutputAttribute(
            name="video",
            description="The video object.",
        ),
    ]

    def execute(
        self,
        path: str,
        frame_range: Optional[FrameRange] = None,
    ) -> Video:
        """ Returns a Video object.
        """
        directory = os.path.dirname(path)
        basename = os.path.basename(path)
        directory = check_parent_directory(directory)

        return Video(
            path=os.path.join(directory, basename),
            frame_range=frame_range
        )

execute(path, frame_range=None)

Returns a Video object.

Source code in client/ayon_workflow/plugins/workflow/essentials/video.py
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
def execute(
    self,
    path: str,
    frame_range: Optional[FrameRange] = None,
) -> Video:
    """ Returns a Video object.
    """
    directory = os.path.dirname(path)
    basename = os.path.basename(path)
    directory = check_parent_directory(directory)

    return Video(
        path=os.path.join(directory, basename),
        frame_range=frame_range
    )