a reload all read nodes script that actually works?

Become a member of the CGSociety

Connect, Share, and Learn with our Large Growing CG Art Community. It's Free!

THREAD CLOSED
 
Thread Tools Search this Thread Display Modes
  03 March 2011
a reload all read nodes script that actually works?

I've tried all the scripts from around the interweb and none of them seem to work with Nuke 6. It's driving me crazy.
 
  03 March 2011
hmm.. have a try:


import nuke
 
nodes = nuke.allNodes()
 
for node in nodes:
	if node.Class() == "Read":
		node.knob("reload").execute()
 
__________________
"A computer program does what you tell it to do, not what you want it to do." Greer's Third Law.
 
  03 March 2011
heh - nice. That works. For some reason, none of the others do. I guess they are out of date for Nuke 6 or something.

Thanks. Where do you store scripts to load them with a single command?
 
  03 March 2011
You keep them in your .Nuke directory, and modify your menu.py to reference them.

I recommend looking to get your Nuke prefs setup in your Dropbox so they are easily backed up and easy to use on any system.

In your actual ~/.Nuke directory you just need a one line init.py referencing the DropBox location:

## andrewhake init.py

# add Dropbox nuke path
nuke.pluginAddPath('/Users/andrew/Dropbox/data/nuke')


And in your DropBox Nuke directory an init.py to properly reference its directories:

# add Dropbox nuke plugin paths
nuke.pluginAddPath('./gizmos')
nuke.pluginAddPath('./icons')
nuke.pluginAddPath('./plugins')
nuke.pluginAddPath('./python')
nuke.pluginAddPath('./tcl')

#  J_Ops
#
#  Created by Jack Binks on 14/02/2010.
#  Copyright (c) 2010 Jack Binks. All rights reserved.
nuke.pluginAddPath("./plugins/J_Ops/ndk")
nuke.pluginAddPath("./plugins/J_Ops/icons")
nuke.pluginAddPath("./plugins/J_Ops/py")


And of course your menu.py to actually make the customizations, menus, etc.

So to use this script from the toolbar, you can save the script in the proper folder if you are keeping things organized:

# Reload all ReadNodes

import nuke

def reloadRead():
	nodes = nuke.allNodes()
 
	for node in nodes:
		if node.Class() == "Read":
			node.knob("reload").execute()


And in your menu.py add something like:

# reloadRead
import reloadRead
o_O.addCommand('reloadRead', 'reloadRead.reloadRead()', icon='reloadRead.png')


(o_O) is the name of my custom menu I am adding this to.

And here is an icon

__________________
www.andrewandoru.com | reel | info | labs

Last edited by andrewhake : 03 March 2011 at 12:31 AM.
 
  03 March 2011
Thread automatically closed

This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.
__________________
CGTalk Policy/Legalities
Note that as CGTalk Members, you agree to the terms and conditions of using this website.
 
Thread Closed share thread



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
CGSociety
Society of Digital Artists
www.cgsociety.org

Powered by vBulletin
Copyright 2000 - 2006,
Jelsoft Enterprises Ltd.
Minimize Ads
Forum Jump
Miscellaneous

All times are GMT. The time now is 05:40 PM.


Powered by vBulletin
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.