PostageStamp Copy/Paste Fix v1.1


 
This location is for Registered Users Only.
Perhaps you need to login or register.
Contributor: Cameron Carson
A script to tweak Nuke's Copy/Paste function so that Postage Stamps, when copied, connect to the source's input.
Requirements:
6.3, 7.0 or later
Linux, Mac, Windows
26 Mar 2013
207

This simple Nuke script was written in Python to solve the small issue of PostageStamp copy pasting. It forces PostageStamps nodes to connect to the input of the the one copied upon pasting. Also works on multiple PostageStamps and Groups of nodes, as long as all the postage stamps are connected to the same root.


It was really written because we tend to use a lot of postage stamps for linking but could easily be adapted to any other node you wish to do this with.


You can run this by droping the script in your .nuke folder or anywhere else Nuke's Pathing looks. And putting something like the below lines in Nuke’s menu.py file.

 

#PostageStamp Copy Paste
import poststampCopyPaste
menubar.addMenu( '&Edit' ).addCommand( 'Copy', poststampCopyPaste.copyHijack, 'Ctrl+C', icon='')
menubar.addMenu( '&Edit' ).addCommand( 'Paste', poststampCopyPaste.pasteHijack, 'Ctrl+V')

 

v1.1 - Fixed bug that would cause postage stamps to not connect to their proper inputs when copied with said input.

Please login in order to download these files.

Comments   

 
# Chris Forrester 2014-04-11 18:04
Just downloading this now. This has bugged me for ages and was something I hoped to try and fix also in my learning of python. Looking forward to making this part of my utility belt I bring with me whilst freelancing. Thank you for sharing, and no more dragging those postage stamps across vast areas of screen space!
-Chris
 
 
# Sebastian Braende 2014-07-02 15:45
Thank you very much for the script. It works great, however it would be amazing if the CTRL+C command would duplicate the Postage Stamp properly as well. I would add the code myself, but I am not very familiar with Python.

Thanks again for the great little script.
- Sebastian
 
 
# Jed Smith 2015-04-22 17:55
Thank you! This is something that has bothered me for years as well.

Unfortunately this solution only supports a single PostageStamp at a time, since if you copy / paste more than one that are connected to different inputs, the result will all end up connected to the same node.

I might take what you've done and try to fix this and add cut / paste support if I have some spare time.
 
 
# ASIF HAQUE 2015-05-29 15:57
This is fantastic. Saves time and keeps me sane when navigating a massive script. Thank you very much! I have one suggestion - would you possibly be able to have the postage stamp copy the file name too?

Cheers!
 
 
# Jed Smith 2015-09-14 23:53
If anyone is curious to check it out, I wrote a replacement for this script called postageStampTools.

It overrides the cut/copy/paste functionality to handle postageStamps. It overcomes the problem of tracking what node each postageStamp is linked to by creating a knob on the node that contains that information. When one or multiple postageStamps are pasted, the script knows what node it should be connected to.

I also put in a helper function to create postageStamp nodes that contain a python knob to connect the input, and a label that displays the connected topnode's file knob or label knob or node-name.

Hope it's useful!
https://gist.github.com/jedypod/29187fa8c82bbbf4bf5e
 

You have no rights to post comments

We have 2657 guests and 74 members online