PDA

View Full Version : automating subD conversion



Sven
03-29-2004, 07:23 AM
Hi there!

Does anybody of you know of a way to convert letz say 400 poly objects into metanurbs in an automatted way?

Are there scripts, tools etc. which perhaps can operate such a tab switching function onto complete folders or such?

Thanks in advance!

Sven Dreesbach
Filmakademie Baden-Wuerttemberg

Suricate
03-31-2004, 10:17 AM
I put together a little LScript which should do the job.

Copy the following text to some file with the extension ".ls" and execute it as an LScript.
You have to enter the name of the folder, then it will open all files in the folder, toggle the subpatches, save and close the file.

Make sure to make a backup of your folder before, as your original objects will be overwritten.

Hope that helps.




//-----------------------------------------
// DirectorySubPatch.ls
//
// Scans a directory and toggles subpatch mode for all files
//
// !! IMPORTANT !!
// Before using this script, make a backup of your original files !!
//
// (c) Christopher Lutz 2004
//
// www.AnimationSnippets.com
//
//----------------------------------------

@version 2.2
@warnings
@script modeler

main
{

// create requester
reqbegin( "Directory SubPatch" );

// add string control
cDirectory = ctlstring( "Directory", "(none)" );

// return if user cancels requester
return if !reqpost();

// retrieve directory name
sDirectory = getvalue( cDirectory );

// destroy requester
reqend();

selmode( GLOBAL );

aFiles = matchfiles( sDirectory, "*.lwo" ); // find LWO files in directory
for( i = 1; i <= aFiles.size(); i++ ) // iterate through all files
{
sFullName = sDirectory + "\\" + aFiles[ i ] + ""; // create full file name
load( sFullName ); // load file
togglepatches(); // toggle subpatches
save( sFullName ); // save file
close(); // close active object
}
}