Ejemplo n.º 1
0
def GetOutput(node):
    import fx

    # Get the session
    session = fx.activeSession()

    if node:
        if node.type == 'OutputNode':
            # Build the current frame
            padding = int(fx.prefs['render.filename.padding'])
            startFrame = session.startFrame
            currentFrame = int(startFrame + fx.player.frame)

            # Build the file format
            formatList = ('.cin', '.dpx', '.iff', '.jpg', '.exr', '.png',
                          '.sgi', '.tif', '.tga')
            format = node.properties['format'].value
            formatFancy = formatList[format]

            # Build the filename
            path = node.properties['path'].value + '.' + str(
                currentFrame).zfill(padding) + formatFancy
            return path

    return None
Ejemplo n.º 2
0
def run():
    import fx

    # Check the current selection
    node = fx.activeNode()

    # Get the session
    session = fx.activeSession()

    print('[Affinity Photo]')
    print('\t[Node Name] ' + node.label)

    # Process a source node
    if node.type == 'SourceNode':
        # Find the active source node
        source = GetSource(node)
        if source:
            # Get the current node's filepath
            path = source.path(-1)

            # Translate #### into the current frame
            padding = int(fx.prefs['render.filename.padding'])
            startFrame = session.startFrame
            currentFrame = int(startFrame + fx.player.frame)
            path = path.replace('####', str(currentFrame).zfill(padding))

            print('\t[Image] ' + path)

            # Reveal in Finder
            Command(path)
        else:
            print('\t[Error] Select a Source or Output Node.')
    elif node.type == 'OutputNode':
        # Find the active OutputNode path
        path = GetOutput(node)
        print('\t[Image] ' + path)

        # Reveal in Finder
        Command(path)
    else:
        print('\t[Error] Select a Source or Output Node.')
def run():
    import fx

    print(
        '\n\n---------------------------------------------------------------------------------'
    )
    print('Session Explorer')
    print(
        '---------------------------------------------------------------------------------\n'
    )

    # Get the session
    session = fx.activeSession()
    print('[Session] ' + str(session.label) + '\n')

    if session is not None:
        # List all properties
        for i in range(len(session.properties.keys())):
            key = session.properties.keys()[i]
            print('\t[Propery] ' + str(key) + ' [Value] "' +
                  str(session.properties[key].value) + '"')