コード例 #1
0
def run():
    import fx
    from tools.sequenceBuilder import SequenceBuilder

    # Grab the current project
    project = fx.activeProject()

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

    print('[Output To Source]')
    print('\t[Node Name] ' + node.label)

    # Process a source node
    if node.type == 'OutputNode':
        # Find the active OutputNode path
        path = GetOutput(node)
        print('\t[Image] ' + path)

        # Create an image sequence from the url
        builder = SequenceBuilder(path)

        # Load the media into the project
        src = fx.Source(builder.path)

        # Add the other image types
        project.addItem(src)
    else:
        print('\t[Error] Select a Source or Output Node.')
コード例 #2
0
def runRevealInFinder():
    import fx

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

    print('[Reveal in Finder]')
    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)
            print('\t[Image] ' + path)

            # Reveal in Finder
            OpenCommand(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
        OpenCommand(path)
    else:
        print('\t[Error] Select a Source or Output Node.')
コード例 #3
0
 def available(self):
     node = fx.activeNode()
     try:
         assert node.isType(
             "PaintNode") and node is not None, "Paint node not active"
     except Exception:
         pass
def run():
    import fx

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

    print('[Reveal Actions in Finder]')
    print('\t[Node Name] ' + node.label)

    # Reveal Scripts in Finder
    Command()
コード例 #5
0
	def execute(self,**kwargs):
		beginUndo("KMFX|Change Paint Opacity") 
		node = fx.activeNode()
		mode = kwargs["mode"] if "mode" in kwargs.keys() else "increase"
		if node.isType("PaintNode"):
			
			increment = 10 if mode == "increase" else -10
			x = fx.paint.opacity
			i = (x + increment) / 100
			fx.paint.opacity = i
		else:
			fx.viewer.viewMode = 0 if mode == "increase" else 1 ### this is only needed because the bind is made on keys 1 and 2
		endUndo()
コード例 #6
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.')
コード例 #7
0
    def execute(self):

        fx.beginUndo("Cycle_Paint_Presets")

        direction = 1
        node = fx.activeNode()

        num_presets = fx.prefs["KMFX.Paint Presets maximum cycle"]

        if node.type == "PaintNode":

            current = fx.paint.preset
            if current < 0:
                return
            index = current
            nextp = True
            while nextp == True:
                index = index + direction
                # handle wraparound
                if index < 0:
                    index = num_presets - 1
                elif index >= num_presets:
                    index = 0

                # avoid infinite loop if only one preset
                if index == current:
                    break

                # check for a preset
                try:
                    preset = node.state["preset%d" % (index)]
                    fx.paint.preset = index
                    nextp = False
                except:
                    # e = sys.exc_info()
                    # print('Error on line {}'.format(sys.exc_info()[-1].tb_lineno), type(e).__name__, e)
                    pass

        fx.endUndo()
コード例 #8
0
def runDJV():
    import fx
    import subprocess

    node = fx.activeNode()

    # Find the active source node
    source = GetSource(node)
    if source:
        # Get the current node's filepath
        path = source.path(-1)
        print("[Image] " + path)

        # Build the DJV_View launching command
        cmd = "/Applications/DJV.app/Contents/Resources/bin/djv_view.sh"
        args = [cmd, path]
        print("[Launching DJV] " + str(args))

        # Run DJV_View
        #subprocess.call(args)
        subprocess.Popen(args)
    else:
        print("[Error] Select a media object.")
コード例 #9
0
def run():
    import fx

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

    print('[Encode Movie MP4]')
    print('\t[Node Name] ' + node.label)

    # Start the undo operation
    fx.beginUndo('Encode Movie')

    # 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)
            print('\t[Image] ' + path)

            # Generate the movie
            EncodeMovie(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)

        # Generate the movie
        EncodeMovie(path)
    else:
        print('\t[Error] Select a Source or Output Node.')

    # Finish the Undo operation
    fx.endUndo()
コード例 #10
0
 def available(self):
     node = fx.activeNode()
     assert node != None and node.isType(
         "PaintNode"), "Paint node not active"