advanced_Merge2 v2.0


 
This location is for Registered Users Only.
Perhaps you need to login or register.
Contributor: Pranav Pradeep
Advanced Merge
Requirements:
11.0, 10.5, 10.0 or later
Linux, Mac, Windows
09 Jul 2019
7

Hi everyone, I just wanted  to share a small python script for nuke that I made when I was learning python for nuke.

What actually the script does is, it creates Merge Node with the operation you want rather than just creating a merge and changing the operation in the settings later.

It’s a very basic simple script and if you are just starting out learning python for Nuke it will be very helpful if you open it up and read through it.

I am a compositor who loves both compositing and programming because I see both of them as a kind of Problem solving.

In Compositing you are given a shot and you have different ways to tackle it and get a desired output. In programming too, you have a problem and you are trying to find a solution with set of instructions. So combining those could be very powerful. The new introduction of AI also seems very promising to the Visual Effects Industry. So much is going to be automated in the near future and I think as a Compositor, the knowledge of little bit of programming and AI could lead you a long away.

Those who wanted to plunge into the script and get hands on experience. I have attached the script down below. You can download it and try it out yourself. Put the “advanced_Merge.py” in your “.nuke” folder and add:

1
2
3
4
5
import advanced_Merge2
 
toolbar=nuke.menu('Nodes')
me=toolbar.addMenu('Advanced Merge','Merge.png')
me.addCommand('Advanced Merge Tool',lambda: advanced_Merge2.advanced_Merge2(),'m')

in your menu.py

Here I wanted to explain the mental process I had to come up with script.

Obstacle:

Of course having the difficulty of creating the merge and changing the operations later.

Solution:

Create Merge with the operation I want.

But how?

This is how I tackled the situation:

As you press the hotkey for merge i.e. ‘m’ a pop up box appears asking for the operation you want to create and you just have  to type the name of operation and press enter. But typing the whole operation is kind of bummer and takes away all the ease we get using the script. So what I did was, I assigned them shortcuts inside the script!

Like how?

For example

If you wanted to create a merge node with a plus operation all you have to do is press ‘m’ on your keyboard type “+” and enter. You can even type “plus” inside the box and it still works.

Likewise I have assigned shortcuts for few major operations as well

  • Over = ‘o’
  • Mask = ‘m’
  • Stencil = ‘s’
  • Minus = ’-‘
  • Plus = ’+’
  • Multiply = ’*’
  • Matte = ’a’
  • Under = ‘u’
  • From = ‘f’
  • Min = ‘–‘
  • Max = ‘++’
  • Difference = ‘d’
  • Divide = ‘/’
  • Screen = ‘r’

As you get used to it. It’s pretty much a fast process. Try it for yourself and let me know what you think and is there something we could improve over this.

Please login in order to download these files.

You have no rights to post comments

We have 2678 guests and 137 members online