ShotGunDropper v1.6
This location is for Registered Users Only.
Perhaps you need to login or register.
11.0, 10.5, 10.0, 9.0, 8.0, 7.1, 7.0, 6.3, 6.2, 6. or later
Linux, Mac, Windows


v1.6 fixed bugs with windows paths
v1.5 fixed bugs in v1.4 that broke the tool
v1.4 downloads the original filr frmo Shotgun if sg_path_to_frames is empty (rough and dirty as prooff of concept)
v1.3 modified to work with nukescripts.addDropDataCallback. Please see instructions below for updated info on how to get this running. Also, this verison supports drag&drop of Shots and Playlists.
v1.2 has a bit of code optimisation to avoid unnecessary Shotgun connections (as suggested by Mihall - thanks).
v1.1 also works with Shotgun's email links. Check out the new video here.
This python snippet enables you to drag Shotgun Versions from your browser straight into Nuke to create Read nodes.
For those of you who aren't familiar with the Shotgun's vfx database, check it out here.
A short demo can be found here.
- put ShotgunDropper.py into your plugin path
- make sure the path to the shotgun api is part of NUke's PYTHONPATH or NUKE_PATH (currently shotgun_api3 is used)
- add your shotgun server's name, script name and script key in lines 65-67
- in your menu.py, add this line:
1 2 |
import ShotGunDropper nukescripts.addDropDataCallback(ShotGunDropper.dropSG) |
(Re)Start Nuke and you're off...
Comments
That is something I wasn't even considering to do. Really nice idea Frank.
It opens up worlds of integration fun
cheers!
Right now a new Shotgun object is created with every drag&drop (and call to dropSGVersion(url)).
It may be better to instance Shotgun after the imports, so you have a single Shotgun object, which is created when the Nuke GUI starts and menu.py loads.
I wouldn't want to create a Shotgun object on start up (i.e. through the menu.py) cause it would slow down each nuke launch. You could play with keeping the shotgun object in memory for subsequent calls into the same session. This is why I said it's more of an example for how to do this. There is heaps of room for improvement, and when I get time I will play with it more, so keep suggestions coming.
It happens on CentOS. No such issue on a Mac.
I've had this issue with Shotgun crashing Nuke on Linux before as well.
The first time I query Shotgun from inside Nuke things are ok.
When i try to query Shotgun a second time, Nuke crashes.
I think the dropData function needs one small adjustment. I believe returning False completely bails on any dropData processing. Returning None allows the base Nuke functionality to still happen.
Besides that, Awesome!
i had some problems on windows with the path to the frames because of the backslashes. i fixed it by replacing the backslashes to slashes in the path from shotgun. nuke likes this more, too.
maybe you want to add it to your script for the windows users:
#DO THE NUKE THING
nuke.createNode ( 'Read', 'file ' + versionEnt['sg_ path_to_frames' ].replace('', '/') + ' first %(sg_first_fram e)s last %(sg_last_frame )s' % versionEnt )
https://support.shotgunsoftware.com/entries/48110-shotgun-and-nuke
And as soon as I removed the import ShotGunDropper, it came back..
Anyone know why this would happen and how to work around it.
When I drop a link in the read name's file path goes to 'None' and displays no file. Any idea why this is happening?
Thanks
I have replaced site link with 'studio'. When copied in to a text editor it is identical to the link in the browser
Or did you expect this to download the quicktime from Shotgun and pull that into Nuke? That can be done as well if it's helpful.
This doesn't work for playlists or shots yet and will probably need a progress/busy bar during the download.
Let me know if this works for you. I'm a bit busy so I just threw this together quickly.
I'm now just getting a clipboard error.. Or is that just me?
v1.5 should work
But replacing inside the quotes with a directory doesn't do the job. Do I have to change the environment variable?
So you could simply do this:
return '/path/to/folder'
instead of:
return os.environ['NUK E_TEMP_DIR']
This is a good plugin but since I change to Nuke 11 it stops working I took a look on what was the issue and it seems that the callback "addDropDataCal lback" is not working with web browser.
I just wondering if any of you have experience the same?
Thanks,
r = nuke.nodes.Read ()
path = v.get("sg_path_ to_frames")
path = path.replace("\ \","/")
#print path
r["file"].setVa lue(path)
r["first"].setV alue(v.get("sg_ first_frame"))
r["last"].setVa lue(v.get("sg_l ast_frame"))
r["origfirst"]. setValue(v.get( "sg_first_frame "))
r["origlast"].s etValue(v.get(" sg_last_frame") )
r["label"].setValue(v.get("sg_version_type"))
instead of creating it all in one line.
A couple of quick questions;
-Where need to be added these lines inside ShotGunDropper. py or menu.py?
-Is telling me: NameError: name 'v' is not defined
Many thanks!
Instead of the way it creates ReadNodes in the standard version I have changed it around so the paths can be adjusted.
Many thanks!
RSS feed for comments to this post