Nuke – ZDefocus Edge Errors

Has anyone had this problem with the ZDefocus Node?

I get very weird artefacts when I defocus a monitor graphic that I’m tracking into a shot.  It looks fine straight out of the ZDefocus node but when I gamma up to 10 I can see artefacts around my element.

I’ve uploaded the script to dropbox.

Any thoughts would be greatly appreciated!

My conversation on The Foundry Nuke forum.

error

Advertisements

Nuke – Disabling All Motion Blur in Your Script

In Shake you used to be able to disable all motion blur that was being added in your script.  It was super useful as it meant you could turn the motion blur off to do colour work etc and then turn it back on when it came time to render.  Sadly Nuke does not have this function.  However you can run the following piece of code from the Script Editor and it will set all motion blur in your Transform nodes to ‘0’.

Be careful with this however… as when you come to turn the motion blur back on it will set ‘1’ in ALL your Transform nodes that have a motion blur setting… which you possibly didn’t want!

To turn all motion blur off…

x=nuke.allNodes()
for n in x:
     try:
          n['motionblur'].setExpression("0")
     except:
          pass

To turn all motion blur on…

x=nuke.allNodes()
for n in x:
     try:
          n['motionblur'].setExpression("1")
     except:
          pass

**UPDATE**mb

Thinking on this a little further I feel I’ve come up with a better solution and most importantly a much simpler one.

Create a Switch node and then expression link it to the motion blur knob in your Transform nodes (Switch1.which for example). Just change the Switch from ‘0’ to ‘1’ to turn the motion blur on and vice versa to turn it off. That way you can be a lot more selective about which motion blur settings your changing.

**UPDATE 15/01/16**

Today I came up with an even simpler way to achieve this.  Link the motion blur knob to the disable knob in the Switch.  Just disabling the Switch in the gui will turn the motion blur off.  Place the following in the motion blur expression window…

!Switch1.disable

The ‘!’ is needed to invert the result as ‘1’ is returned when the Switch is disabled.

Nuke – The Amazing AutoWrite Node by Tim Bowman

I thought I’d share this beauty with you all.

I’m currently working as part of a two man comp team and as such we are missing so many of the lovely scripts and buttons you get when you work in a large facility. Finding this little beauty is going to save us a lot of time. It wasn’t completely plain sailing to install so I thought I would share my findings here.

The node automatically creates and names the folders to render to based on your script name.  Genius!  And a huge time saver.

The Autowrite node is written by Tim Bowman and can be downloaded from Nukepedia.

AutoWrite v1.0

autowrite1

It takes the existing write node and adds Python to it that works out your directory structure based on your current Nuke script location. The numbers in the window above are changed to suit your pipeline.  The node has a read out in the node graph – this gives you feedback on where the write node is going to render to.  This is a very useful feature.

The tricky part of using the node comes when you want Nuke to create the directories when they don’t already exist. Also in our two man team we wanted the write node to overwrite anything that’s there already (this last part proved difficult to find the code for).

Add the following to your init.py file and all will be well with the world… and your Autowrite node.

def createWriteDir():
#Create dir callack
def createWriteDir():
import nuke, os, errno
file = nuke.filename(nuke.thisNode())
dir = os.path.dirname( file )
osdir = nuke.callbacks.filenameFilter( dir )
# cope with the directory existing already by ignoring that exception
try:
os.makedirs( osdir )
except OSError, e:
if e.errno != errno.EEXIST:
raise
nuke.addBeforeRender(createWriteDir)

It took me a while to work out this part of the puzzle.  It uses the callback Python function ‘beforeRender’.  This is run before a render is executed.  It checks if the directory structure for the write node exists and if it doesn’t it creates it.

Nuke Callbacks

Happy rendering.

Nuke – Framehold Using Current Frame

When I create a FrameHold node I’m normally on frame I want to… well… frame hold.  Therefore wouldn’t it be great if Nuke held the frame you created the FrameHold on?  Well now it can with this simple piece of Python.  Just pop it in to your menu.py file in your home/.nuke folder and off you go.

# FrameHold creation frame
nuke.menu('Nodes').addCommand( "Time/FrameHold", "nuke.createNode('FrameHold')['first_frame'].setValue( nuke.frame() )", icon='FrameHold.png')

framehold

It uses the nuke.frame() function which calls the current frame.

Happy frame holding!

Thanks to David Emney for the heads up on this.
FrameHold default to current frame

Nuke – Backdrop Utility by Geoffroy Givry

backdrop1 Nukes backdrop feature promises to keep your scripts neat and tidy and in order… but it seems to always want to pick bright pink or fluro orange! 18% grey please Nuke!

Luckily Geoffroy Givry has come up with a nifty little python script that replaces the backdrop feature with a far superior utility.  A name can be added to the group, the font size can be adjusted and the colour always defaults to… grey!  Other muted tones can also be selected.

The python script can be downloaded from Nukepedia.

labelAutobackdrop v1.0

Place the labelAutobackdrop.py file in your home/.nuke folder.  Then add the following to your ‘menu.py’ file which should be in same location (or create a ‘menu.py’ file if you don’t see one)…

# setup autoBackdrop in toolbar
import labelAutobackdrop
menuToolbar = nuke.toolbar('Nodes') 
menuToolbar.addCommand('Other/Backdrop', 'labelAutobackdrop.autoBackdrop()', 'Alt+m')

backdrop2There’s a script on the Nukepedia page that Givry suggests putting in to the ‘menu.py’ file.  When I tried it I couldn’t get it to work.  Anyone out there have an idea as to why?

Geoffroy Givry’s website.  Click on Python Corner to see his other scripts.
http://www.geoffroygivry.com

On a side note – here’s a great tutorial from David Windhorst about how to install custom menus and adjust your ‘menu.py’ file.
DW// Tutorial 01: Nuke – Install Scripts/Custom Menus

Thank you to Jason Evans for the pointers on this!

Into Film

When I was at Primary School having a career in film seemed impossible and never really crossed my mind (well of course… I was going to be an astronaut!).

Into-FilmBut now there is an organisation that helps young children realise it’s not an unattainable dream.

Into Film are taking this idea of working in the film industry to children all around the UK. They are inspiring the minds of the next generation of film makers. Last year I was lucky enough to be invited by Into Film to Kingswood Academy in Hull to talk about my career and meet some of the visual effects artists of the future! It was a great experience and I’d recommend it to anyone.

Click below to read about the visit and find out more about Into Film.

Digital Compositor Jack Hughes visits Kingswood Academy, Hull

Ant Man – The Russian Movie Poster

img_3840

This week as I wandered around Saint Petersburg I came across this beauty.

The Russian poster for Ant Man has got to be the hippest released. It has the look and feel of an old Polish film poster from the 80’s – very bold and a little left field. It’s a striking concept that I’ve not seen in the UK. 

There’s a nice use of Captain America’s shield design around the outside and then a very abstract picture within a picture going to infinity in the centre. Oddly, Paul Rudd has his helmet on in his second depiction. I guess he has to have his helmet on to miniaturise?

After seeing this poster I wonder whether Ant Man might actually be a Marvel film with a mind of it’s own?

Congratulations to anyone that worked on the project.