Load Folder (recursiveLoad) v1.0
This location is for Registered Users Only.
Perhaps you need to login or register.
6.2, 6.3, 7.0 or later
Linux, Mac, Windows


Uses the normal Nuke file browser and loads all img sequences and geo found inside the top folder - recursively working through to load everything inside.
If you have a set up with stereo rendered as separate passes and use a standard convention for right and left file paths (eg /path/left/filename_left.###.dpx, /path/right/filename_right.###.dpx) you can add the search parameters (in this case /right/', '/left' and '_right', _left' ) at the top of the file where indicated and it will auto join all right and left eyes.
It will also load .nk files etc as loads everything in the top folder so you may get a set of error reads which you would just delete.
(Might work in Nuke7.0 who knows - just like the forward optimism of nukepedia)
From menu.py (note named Load Folder in nuke)
1 2 |
m = toolbar.addMenu("Image", "ToolbarDraw.png") m.addCommand('Load Folder', 'nuke.load("recursiveLoad"), recursiveLoad()', 'alt+r', icon='Read.png') |
Comments
I've been trolling through the code, but I'm not as familiar with Nuke Python at the moment. I'm hoping maybe someone else found a solution.
Code:
readsList=imgSeq2NukeFormat(filesFound)
newReadsList=[]
for i in readsList:
i=i[2:]
newReadsList.append(i)
if verbose: print (newReadsList)
createReads(newReadsList)
There may be a better way, but this essentially takes the list created by the script and removes the first 2 characters of each line. As James pointed out the drive letter is repeated in the file name.
Thanks, this is a very helpful tool.
any chance you could post your amendments?
I've been trying to get this to work for a while, seems to only load
the first sequence. I'm using Nuke 9X 9.04 on Windows
Download the recursiveLoad.p y and open it in an editor (might I recommend notepad++).
Jump to the end and find these lines:
Code:
readsList=imgSeq2NukeFormat(filesFound)
if verbose: print (readsList)
createReads(readsList)
Then amend it so it says:
Code:
readsList=imgSeq2NukeFormat(filesFound)
newReadsList=[]
for i in readsList:
i=i[2:]
newReadsList.append(i)
if verbose: print (newReadsList)
createReads(newReadsList)
BUT its very important that you get the leading spaces correct! Your choice to use spaces or tabs (1 tab = 4 spaces). Here is the spacing you need:
Code:
1 TAB readsList=imgSeq2NukeFormat(filesFound)
1 TAB newReadsList=[]
1 TAB for i in readsList:
2 TABS i=i[2:]
2 TABS newReadsList.append(i)
1 TAB if verbose: print (newReadsList)
1 TAB createReads(newReadsList)
Let me know if that helps!
I found 2 issues with this script. First, it doesn't allow underscores between file name and frame number (_#####.exr), also it doesn't really play nice with periods separating parts of the file name (file.pass.left .#####.exr).
I think I can fix this, but it won't happen til next week. In the mean time you could use a renaming utility, but that's also a pain. Let me know if one of those issues I described applies to you.
All the best.
Code:
import nuke
import string
import nukescripts
import sys
import os, glob, time, ctypes
class OpenLastCompGUI(nukescripts.PythonPanel):
def OpenLastCompGUI_dialog(self):
self.prj_base_path = 'X:\ProjectPath'
nukescripts.PythonPanel.__init__(self, 'Load All Reads By chosen Plan', '')
self.episode = nuke.String_Knob('frame', 'Episode No: ', '100')
self.addKnob(self.episode)
self.shot = nuke.String_Knob('frame', 'Shot No: ', '001A')
self.addKnob(self.shot)
result = nukescripts.PythonPanel.showModalDialog(self)
if result == True:
episode = self.episode.value()
shot = self.shot.value()
RDRPath = self.prj_base_path+ '\' +'EP' + episode+ '\*\' +shot+ '\' +'RenderFolder\'
print 'RDRPath: ', RDRPath
## Load All Reads By chosen Plan :
class OpenLastComp():
def OpenLastComp_gui(self, *args):
OpenLastCompGUI().OpenLastCompGUI_dialog()
def main():
OpenLastComp().OpenLastComp_gui()
'''
Updated the ReadGeo to ReadGeo2 (So you can read in Ambelic files)
'''
readGeo = nuke.createNode ('ReadGeo2')
readGeo['file'] .fromUserText(r )
sceneView = readGeo['scene_ view']
allItems = sceneView.getAl lItems() # get a list of all nodes stored in the abc file
sceneView.setIm portedItems(all Items) # import all items into the ReadGeo node
Also add '.abc' to the if statement on line 93
There are 2 lines that are trickier to fix, they both say:
if verbose: print >> sys.stderr,' 'failed here %s\n' % lineno()
but you can change it to:
if verbose: print ('>> sys.stderr,' 'failed here %s\n' % lineno() )
Also, if you follow ALL of the instructions listed in the comments, it will work, even with an image sequence.
@Johan. Could you send your code with all of the necessary corrections?
RSS feed for comments to this post