Sequential Batch Render

#1
Sequential Batch Render

It is possible to render more than one file at a time, but the files render simultaneously. Is there any way to render a sequence of files one at a time, in a given order? The most recent mention of this I could find on the forum was a Wish List request from 2010. Are there any newer tools available to enable someone with coding skills (i.e. not me) to make a script or something?

It would be great to keep C3D churning away all night on a folder of large files, maybe animations or super-high resolution pictures, without unduly taxing the hard drive. RAM, etc.

I suppose this relates to network rendering, but my request is mainly to optimize productivity on a single Mac. This is a feature, like partial rendering, that seems long overdue. These things were possible on Bryce 20 years ago.
 
#2
Can be done

It is possible to create a workflow in Automator to do this. Not the easiest or cleanest way to achieve it, but I've been using it for years to render multiple files for me overnight in Cheetah3D and it does the job.

The workflow for illustrations (not animations) goes like this:
1) Find .jas files to be rendered (tag them appropriately, so that Automator can find them)
2) pick one
3) open it (and wait/pause for a bit, complex models can take some time to open)
4) hit render (via keyboard shortcut - you can set it up in Cheetah preferences)
5)* wait until render is finished (this is a tricky bit, see below)
6) when rendered, close Cheetah3D
6) find the latest image in your render history folder
7) copy it where you want it to appear, rename it.
8) Go back to beginning (kill the workflow if there is no .jas file to be rendered left)

5* - one way to test if the render is finished or not is to observe the size of "Render History" folder (it is in Library/Application support/Cheetah3D). Cheetah3D saves the image in here once the rendering is finished. So using applescript, test in given interval (let's say every minute), if the size of the folder increased. If it didn't increase, wait and test the size again. If the size did increase, it means the render was saved, which means Cheetah3D is done with rendering and you can save it and close it. The latest .png image in render history is your new render.

I am not a programmer by any means and there are certainly neater ways to do subsequent renderings, but the workflow works for me.
 
#4
I have one for animations too :)

Only change point 5 - wait for render to finish:
-After hitting "render animation" button, wait for few seconds and then press "command-w" with applescript. This will close the renderer window (render continues, only render window is closed).
- Now hit "Render" button via keyboard shortcut (the normal one, not illustration). You'll get a dialog box warning that rendering is in progress and the new render won't start. Hit Enter to close the dialog box. Repeat this in intervals (like every minute). After the animation is actually finished, it will let you create the "normal render" - this will be your prove that animation rendering is finished.
- While the previous runs, let another applescript check for Number of Folders in your "Render History". Create loop where you keep repeating while the number of folder stays the same and let it finish and proceed to next step when number of folder increases (it increases when the last extra "normal render" is created - which means that the animation is finished).

Then continue as normal, only don't save latest .png, but latest .mov :smile:

As I was saying, it is not a very neat way. For example, you'll have to disable screensaver or it will not work (you can turn the screen off). But it does the job until we see render queues or network rendering in Cheetah3D.

Nice hack! Won't quite work for animations, I fear.
 
#5
More?

Thank you Tomas. This is great news.

An Automator Workflow is simple, like a QuickTime screen recording; it records everything in real time. The only way a rendering queue Workflow can avoid mistiming/skipping/overlapping renders is to incorporate an Applescript which detects if the current render is done, so it can then start the next one.

It sounds simple in concept, but you are the only person to actually figure out how to put it together and make it work.

Could you provide a “Fool-Proof” version of your technique with the actual Automator Workflow and Applescript? I kinda/sorta understood steps 1—4, but you lost me at “So using applescript ....” I doubt most C3D users know how to do this, otherwise we might have had this capability ten years ago. Please attach the complete scripts (Zip, text, PDF, pictures, screenshots, whatever).

This will be a valuable gift to all C3D users.

I personally only need the still-image version, but maybe you can also attach a separate version for animations.

Thanks again,

Joel
 

podperson

Active member
#6
This topic came up in one of the scripting forums, and I have a solution that is simpler and more robust than this "trick" but it involves more than scripting (I plan to add it to C3D Buddy as s feature) because it needs to see how much CPU C3D is using to figure out when to kick off a render.
 
#7
Script for automated renders


Could you provide a “Fool-Proof” version of your technique with the actual Automator Workflow and Applescript? I kinda/sorta understood steps 1—4, but you lost me at “So using applescript ....” I doubt most C3D users know how to do this, otherwise we might have had this capability ten years ago. Please attach the complete scripts (Zip, text, PDF, pictures, screenshots, whatever).
Below you can find attached the 3 key steps to make it work. These are the 3 steps with applescript. You can tweak it in any way you want to achieve the results you require.

Before you run this, there are couple of things you need to tweak:
1) change the username inside the scripts here (it appears twice in the scripts):
on run {input, parameters}

set x to "Macintosh HD:Users:tomasgriger:Library:Application Support:Cheetah3D:Render History" as alias


Change the highlighted username to your username on your mac.

2)The script needs a shortcut in Cheetah3D to run a render. A shortcut to run the render that the script uses is simple "1". Go to Cheetah3D/Preferences/Keyboard and assign number "1" to Render. See attached screenshot.
If you want to use a different shortcut, you can change it in the script. Up to you.

Everything else should be ok.

Let me know if you have any problems.

You also need to tell the automator, which file you want to open and render. There are predefined automator actions to do that, no scripting required. Hope it helps ;)
 

Attachments

#8
I’m not too proud to beg

Thank you Tomas for posting the Applescripts that detect when a render is complete, so that the next one can begin. That’s the key. I understand the concept, but I am still unable to make a functional Automator/Applescript C3D batch renderer. My only experience with Automator was a few months ago when I tried and failed to make a similar Workflow. My mistake was to test with a batch of simple images that rendered in 15 seconds apiece, not realizing that more complex images would have their renders stopped after 15 seconds.

You did a good job of labeling the functions of the three Applescript actions: Render, Wait, Close. You also made it clear how to change the User name from yours to mine, and change the Render keyboard shortcut. I can see how it all depends on the addition of the current completed render to the Render History folder. Excellent design.

There are a lot of deep thinkers using C3D, all of whom would love to run batch renders, but so far as I can tell you are the only person to solve this problem. I don’t know if anyone else who checks the forum followed your example and got it to work, but I did not come close. I don’t pretend to understand Applescript, but I was hopeful that Automator would be approachable by a typical Mac user. ‘Fraid not. I had difficulties just getting simple “Watch Me Do” workflows to start a single render. Very frustrating, flakey software, especially by Apple standards. I love C3D because it works like it should, without fail. I only wasted time on Automator because it promised to finally provide a long-sought batch renderer.

Would it be possible to put all the pieces together into an integrated Automator/Applescript Workflow, ready to use (after changing the User name), where any C3D user could place three files (named 1.jas, 2.jas, 3.jas) into a desktop folder (named “C3D batch files”), start Cheetah 3D, and run a Workflow that is designed specifically to render files named 1.jas, 2.jas, and 3.jas, from the “C3D batch files” folder? Then it would be simple to adapt for more than three files. Please appreciate that what seems simple or obvious to you is mysterious to me. For example, you say “Find .jas files to be rendered (tag them appropriately, so that Automator can find them).” How to tag? The “Wait” Applescript has the line “with timeout of (30 * 6000000) seconds” which is no doubt logical, but looks like five years to me.

Compare this to the Decorated Pig thread: some advanced users have provided complex materials with abstract math nodes that I don’t understand, but I can download them and either use them as-is or tweak a node to fine-tune them.

Your Applescript uses red underlining to indicate where changes are required to adapt it for a different User. That’s good. C3D users are visually oriented, so maybe add color-enhanced tips in a PDF file, or even post a video on YouTube.

It would be so great to make this tool available to all C3D users. Once done, it will be considered an essential tool, and we will wonder how we got along without it for all these years.

Thanks again.
 
#9
I had difficulties just getting simple “Watch Me Do” workflows to start a single render.
"Watch me do" is useless, don't use it, waste of time. Don't know what it is still doing there.

Applescript has the line “with timeout of (30 * 6000000) seconds
This is only to prevent time-out error. Some of my renders are quite complex and take many hours to complete. This line let the script run for longer time - actually yeah, 5 years might be an overkill :D (learned the hard way after many workflow crashes) :D

It would be so great to make this tool available to all C3D users.
I'm going to get it done for you :) Guys on this forum helped me a lot, I'll be happy to give something back. I haven't realized my Batch renderer is so precious. I though any programmer would do it in 15mins when I managed to put it together without any programming skills :D
 
#10
Batch renderer for Cheetah3D using Automator

Hey guys,

attached is the Automator workflow that will enable you to run batch renders. The workflow won't work without setting it up to run on your computer first. Read the PDF I attached with the workflow and follow the instructions and screenshots step by step. Shouldn't take you more than 10mins.

I am not a programmer and it took me a lot of trial-error tests and 5 years experience with Cheetah3D to get to this working version. All the bits of Applescript are copied and tweaked from various Applescript websites and forums. I've been using it successfully for few months, so even if it might not be the prettiest workflow in the world, it gets the job done.

Happy batch rendering :D
 

Attachments

#12
A great C3D addition — highly recommended

Tomas has done a spectacular job of making C3D more powerful and useful by automating the render process. When you look at the Automator/Applescript "actions" in detail it becomes apparent how ingenious this is. It's easy and fast to install, costs nothing, and instantly makes C3D more productive. I had to laugh at Tomas' expectation that the rest of us would figure this out on our own. No way.

The illustrated PDF makes the step-by-step set-up simple and clear. I tried it first on OS X 10.6.8 but the older Automator version was lacking newer functions; but on Yosemite it worked perfectly. (I didn't try animations.) As Tomas warned, a render that takes less than 10 seconds will stop the queue prematurely, but the whole reason why this batch rendering is necessary is because we are doing renders that take hours to complete. (Remember to disable your screensaver.)

I suggest shrinking the C3D, Render Manager, and Automator windows and arranging them on your screen so you can watch the process in action. The original xxx.jas files are even renamed "xxx Done.jas" after rendering. Very practical. Tomas is too modest: "it might not be the prettiest workflow in the world." It has to be the best C3D workflow in the world.

My advice to all C3D users: Please take a half-hour to download, set up, and try out this automatic batch renderer. It will be immediately apparent that your potential productivity has been multiplied.

Thanks Tomas. This is a great gift.
 
Top