I use scons to process a directory containing models in 3d studio max form.
Example:
#Assume a builder called ToASE
env.ToASE(“model.ase”,“model.max”)
Scons is smart enough to cache the results so that if I ever try to convert the same model to ascii scene format again, it will pull the ASE output from the cache and return instantly.
The hypothetical ToASE builder also accepts lists of inputs
env.ToASE([“model1.ase”,“model2.ase”],[“model1.max”,“model2.max”])
If it ever gets the exact same request, “convert models 1 and 2 into ase”, it will pull the output files from the cache.
The way I have the builder implemented, it is cheaper to convert multiple max models at the same time if a cached version is unavailable. If the list of models stays constant, even better, since the whole pack can be pulled from the cache.
But what if I add another model, say model3.max
If i’ve been lumping all my models together, it will look like this
env.ToASE([“model1.ase”,“model2.ase”,“model3.ase”],[“model1.ase”,“model2.max”,“model3.max”])
The problem is that the cached statement is the one containing just the two models, so my system will proceed to convert them ALL again. Because of the overhead associated with converting every model whenever I add a new one, I end up just specifying each conversion individually. This means that I pay only the small penalty if I add just one model, but pay a huge one if its a fresh build with no cache.
If I could tell scons that each input and output is individually cachable, this would make my life easier.
Or if I could get scons to automatically convert
env.ToASE(“model1.ase”,“model1.max”)
env.ToASE(“model2.ase”,“model2.max”)
env.ToASE(“model3.ase”,“model3.max”)
to
env.ToASE([“model1.ase”,“model2.ase”,“model3.ase”],[“model1.max”,“model2.max”,“model3.max”])
while retaining the benefits of individual file caching.
If anyone is using scons like this to process max models, please let me know if you have encountered similar problems.
Note: The reason the per model conversion time is shorter on an array of models is that I only have to launch and close 3dsmax once, where on individual conversions I have to close and reopen max once per file.