|
![]() |
Batch Rendering on Windows: Part 2May 12th, 2010In the previous post, we’ve discussed the simplest batch rendering that takes a series of front images and render a series of shapes. But what if you need to assign images for both front and, for example, left sides? Here are some solutions: Method #1: Two foldersI assume that you already created a “batch” folder from the previous post, so now copy it to “batch2″. Then rename “images” subfolder to the “front” one and create another subfolder, called “left”. Now you need to place files for the left side to the second subfolder, and files should have exactly the same names. I.e. if you have file1.jpg, file2.jpg and file3.jpg in the “front” folder, you should place left side images with names file1.jpg, file2.jpg, file3.jpg as well. Box Shot 3D will render the project using the pairs: front\file1.jpg + left\file1.jpg and so on. Now open the script file “go.cmd” and change the second line, so the whole file looks like below:
Do not forget to add “-q 1″ parameters for the testing purposes. Remove it when you see that everything works fine. The idea behind the script is quite simple. %%p from the previous script means “the whole name of the file”. %%~np means “just a name, without path and extension”. So we iterate through the contents of the “front” subfolder, find all JPEGs there and then build paths to the same files in the “left” subfolder. Method #2: A separate subfolder for each jobAnother method is to create subfolders for each rendering. For example create subfolders job1, job2, job3, .. , jobN each containing side images for a single rendering: front.jpg, left.jpg and top.jpg. You should get something like this:
Now open the “go.cmd” file and change it according the following example:
This code is a bit more complex, because FOR instruction doesn’t allow to iterate folders directly, so we have to call DIR with some switches to get the list of “job*” subfolders. The rest is quite simple, we even don’t need to use %%~np, because our DIR command returns clean names without paths. ConclusionMore complex scenarios are possible as well. For example, you may name files like: [job_id]_front.jpg, [job_id]_left.jpg and so on. But such names are too complex to parse by CMD files. This can be done using JavaScript and Windows Scripting Host and if anyone interested, I will post a simple example. Your Comments:
Leave A Comment: |
© 2005-2010 BoxShot3D.com |