Batch Loader

75 votes
Version: 
2.0
Date Updated: 
10/26/2012
Author Name: 
Anubis

Quick Merge/Import multiple files.

UI v.1.7

Features:

  • Merge multiple .MAX files
  • Import multiple .* files (ie all that can be imported)!
  • Log all files where failed to load to Listener (if any)
  • Multiple history for recent used paths available
  • Limit count of recent paths to keep in history added
  • Group option available
  • Layer option available
  • Attach option available
  • "Auto" option (if is checked no prompt for Merge/Import) *
  • Dialog window is resizeable
  • Auto rename duplicated objects on import

[*] If "Auto" is unchecked then default Max Merge/Import dialog appear for each file.
It is slower alternative, but it is important and useful in some cases.

Additional Info: 

I noticed that there is interest in scripts like "Batch Merge".
I also read the comments and requests, so here's what I created.

Version history:

  • 1.0 - initial version
  • 1.1 - minor code polish up
  • 1.2 - INI file previously saved to Scripts folder, now saved within script source file location
  • 1.3 - added minimal dialogue size when the dialogue is resized
  • 1.4 - suppress the name conflict dialogue when imports and "Auto" option is on (now auto rename)
  • 1.5 - create layer per file using it file name as label
  • 1.6 - minor fixes
  • 1.7 - attach per file as mesh or poly
  • 1.8 - suppress additional imports dialogue; browse for folder dialogue start in recent path
  • 1.9 - auto renaming rewriten (as the auto suggested name is not always correct, now append count digits)
  • 2.0 - now check (by name) for existing layer and create new only if not exist

(TodoList: Remove stored paths that no more exist)

Version Requirement: 
3ds Max 9+
AttachmentSize
batchloader_19.ms9.84 KB
batchloader_20.ms10.01 KB

Comments

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
barigazy's picture

...

I found the problem.
You need to sort "Listitems" array before load in to multilist box.

barigazy

barigazy's picture

...

Hey guys I think that this is not right place for discussion. Can someone open new threat in forum section or use threat posted below as example and we continue discussion there.
BTW sorting problem can be solved using qsort method. Take a look this EXAMPLE

barigazy

asymptote's picture

Ah I was assuming you were

Ah I was assuming you were importing 3ds files, I bow out and await the genius of Branco to solve your issue :)

edit: In fact I was going to ask the same thing if it's possible to have file sorting order as in Explorer, Name / Date / Filesize etc, I just never got round to asking.

rachka's picture

screenshots

So we have two screenshots.
http://dox.bg/files/dw?a=dac405ac49
http://dox.bg/files/dw?a=552044f957
One before your code and one after your code. On the first screenshot the script shows random listing of a bunch of .max files so I have to search through the whole list and manually select the files I want to load which in this case are from maple_cal_01.max until maple_cal_09.max. At the left we see the loaded files. No problem - the files are the same I selected.
On the second screenshot which is after your code, we see the files properly listed by their file names. When I (of course this time with no searching through the list) select again the files from maple_cal_01.max until maple_cal_09.max the script loads (as we see at the left) files that are not those I have selected. Actually the files that are loaded are those from the random list from the first screenshot which is before your code. They stay on the same lines that now are occupied by the properly listed files, namely from maple_cal_01.max until maple_cal_09. What happens is that the script now displays the files properly but still reads them (and loads them) as if they are situated in the random list before your code.

asymptote's picture

@ rachka , Are you using the

@ rachka , Are you using the attach as poly function ? If your 3ds file is made up of several parts each part will be imported separately and named accordingly.

Also, if you'd take the time to post screen shots of your issue you might get to a solution quicker ;)

rachka's picture

barigazy

well, the script listed the files randomly which was the annoying part and when I picked the files I wished to be loaded, the script loaded those exact files. after I put your code the script lists the files properly by their file names but loads them randomly i.e. loads files I didn't choose as if the script reads from the previous random list i.e. what happens now is that the script displays (lists) the files properly but loads files different from those I pick from the list.

barigazy's picture

...

Now I not unerstand you. You asked for it : "Seems like the script loads and lists files by random order instead of by name".

barigazy

rachka's picture

barigazy thank you, but...

thanks man, but now it orders them properly by their file names, and loads them randomly just like before. maybe some other code is needed?

barigazy's picture

Open Batch Loader script in

Open Batch Loader script in MaxScript Editor and change next lines (128,147,158) with this line:

mlb_files.items = sort (for f in listFiles collect (filenameFromPath f))

barigazy

rachka's picture

barigazy

barigazy, where to put this code?

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.