
I have written a file browser for the production I'm currently working on. It allows the compositors to click on the episode, sequence, shots and render version to quickly import the renders.

It has been working fine but a little slow, because I have been using javascript to scan through all the renders in a folder (getFiles function seems really slow), and find out if the there are file sequences in that folder, then put the files into the end panel so a compositor can select them, then import.
So to speed it up I used command prompt to get a directory listing instead, and its a lot faster. The issue now is that when I go to import the file, I am getting an error saying Unable to set "file". Path is not valid" I can't see the full error because the extend script cuts it off. So the full path its trying to access doesn't appear. But if I do an alert of the path its a valid path and works fine.
I have been trying everything I can think of with no success.
This is the section of code giving me issues:
Code: Select all
var selectedFiles = (win.grp.mainBody.filesPnl.fileslistBox.selection);
var selectedFilesLength = selectedFiles.length;
for (var f=0; f<selectedFilesLength; f++)
{
var selectedFilesIndex = (win.grp.mainBody.filesPnl.fileslistBox.selection[f].index);
var theSeq = new ImportOptions()
theSeq.file = new File("H:/Episodes/"+ win.grp.mainBody.epPnl.eplistBox.selection.text + "/" + win.grp.mainBody.sqPnl.sqlistBox.selection.text + "/" + win.grp.mainBody.shPnl.shlistBox.selection.text + "/3d/maya/images/" + win.grp.mainBody.imgPnl.imglistBox.selection.text +"/" + firstFilesOriginal[selectedFilesIndex]);
var importedFile = app.project.importFile(theSeq);
Code: Select all
theSeq.file = new File("H:/Episodes/"+ win.grp.mainBody.epPnl.eplistBox.selection.text + "/" + win.grp.mainBody.sqPnl.sqlistBox.selection.text + "/" + win.grp.mainBody.shPnl.shlistBox.selection.text + "/3d/maya/images/" + win.grp.mainBody.imgPnl.imglistBox.selection.text +"/" +" LL02_S03_SH03_LITV04_RGB.0001.tif");
I would really appreciate some help because I am stumped!