Modify existing script to batch import all files in a folder to the scene

Basically, the script I have forces me to open every single file in a folder one by one with it, so it takes forever to import all the files to the scene. Don't know why the person who made it didn't add batch functionality to it though. I basically want the script to batch import everything in a folder to the scene.

AttachmentSize
dead_space_3_pc_upd3a_boneswithweights.ms13.56 KB

Comments

Comment viewing options

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

.

I doubt that anyone would register on a random forum just to have a look at the script.

_MaZ_TeR_'s picture

updated the thread

updated the thread

jahman's picture

.

Changes:

...
directory = getSavePath() -- select a folder where *.rcb.win and *.GEO files are located
if directory != undefined do -- if path exists
(
 
	gnames = getFiles (directory+"\\*.rcb.win") -- get all *.rcb.win file names
	fnames = getFiles (directory+"\\*.GEO") -- get all *.GEO filenames
 
	for i = 1 to amax gnames.count fnames.count do -- iterate over filenames and do everything that was in the original script
	(
		gname = gnames[i]
		fname = fnames[i]
 
		g = fopen gname "rb"
		f = fopen fname "rb"
...

Since you didn't provide any additional info on how this supposed to work I assumed that directory contains equal amounts of *.rcb.win & *.GEO files. If it's not the case or if you need to select pairs of corresponding *.rcb.win & .GEO files then this probably won't work as expected.

AttachmentSize
dead_space_3_pc_upd3a_boneswithweights_batch_folder.ms 14.31 KB
_MaZ_TeR_'s picture

*

Oh right, the script is supposed to first pick an individual .rcb.win file of your choosing and then import all the .geo files inside a folder of your choosing to the scene, as in the .rcb is the model's skeleton and the .geo files are the mesh files. The script basically pulls the model's skeleton and weight data into the meshes.

Comment viewing options

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