ROBOCHEETAH — Render Queue for C3D 6.2.1

ROBOCHEETAH — Render Queue for C3D 6.2.1

Edit: This is not working consistently. It is intended to allow time for a render to complete before starting the next render, but it might have more than one going at a time, defeating the purpose. If you have a suggestion, please post it. Better yet, make something that works properly. Maybe insert a "monitor" action.

I apologize upfront for such a gigantic forum post, but I have tried to make every step clear, easy, and foolproof. Much trial and error, plus Googling, went into this.

You can use the Mac's built-in Automator app to render a queue of C3D jas files one after another. You only have to make it once, and then you can use it over and over for any files. It is super simple and maximizes your productivity by keeping C3D working when the Mac would otherwise be inactive or shut down -- like overnight -- but probably not in the background when other programs are in use. I don't see a need for automatically printing a queue in the background because you are there to monitor render progress and start the next render. Also, I don't do animations, but I assume it can render those also. Any newbie can make this tiny app, but it might be most useful to professionals with time-consuming projects. You can change file names or render settings. It opens the files in the designated folder from first to last, regardless of name, and takes as much time as required to complete each render before proceeding to the next file.

I am posting detailed directions for making it, (it's EASY), because an Automator app needs to run in the same C3D/Mac set-up it was made in. It's like teaching a robot to push a physical button -- you can't move the button.

Although Automator can incorporate AppleScript and Shell scripts, you only need the "Watch Me Do" function which records what you do in C3D, step-by-step, both keyboard and mouse clicks. For example, like a QuickTime Screen Recording, it records the movement of the cursor to click the Render button, but it also records the render command. Because the button might move after you change the C3D layout, keyboard shortcuts are used. The only action for which I could not figure out how to use a shortcut instead of mouse click was when selecting the next file. Probably an Applescript would do, but it works fine as is, even if the Open File pane is moved around.

I have run it on two MacBook Pros: first with OS X 10.6.8/Core 2 Duo/13" built-in screen, and second with OS X 10.10/i5/19" separate monitor. In both cases I ran C3D 6.2.1 and used a wired mouse, not the trackpad. The following directions will note any differences between the two set-ups, so it should work out if you have any OS X from 10.5 up. To demonstrate the concept and keep it simple, this example only has three files.


SYSTEM PREFERENCES:
OS X 10.6: Universal Access — Mouse and Trackpad — check "Enable access for assistive devices"
OS X 10.10: Security and privacy -- Accessibility -- Privacy -- (unlock) -- click + -- add Automator -- (lock)

Put the Automator icon in the Dock

C3D:
Preferences: Keyboard: Render = command + R
(There is a second "Render" for the Render Tag properties, so test the shortcut to start a render).

1) Make a folder named "queue 3" (set for List View, list by name/alphanumeric). The folder can be anywhere you prefer.
2) Launch C3D. Make the layout full screen with the Menu Bar visible.
3) Make a simple test file with a box object in it, and set the camera for 100 X 100, save it as 1.jas in the "queue 3" folder. Save two similar files named 2.jas and 3.jas in the "queue 3" folder.
4) Close any C3D file that may still be open.
5) Test the Don't Save keyboard shortcut: open a file, change it, Close it, to get the Save Changes? prompt. Depending on your system, it may be either command + D or command + delete, or both. Note which works.
6) IMPORTANT: Use the File menu to select Open and navigate to the "queue 3" folder. and open it. This tells Automator where the "queue 3" folder is. Note that 1.jas is the first file, per step #1. Open 1.jas.

AUTOMATOR:
7) With 1.jas still open, click the Automator icon in the Dock. (If necessary, start a new Automator file). Choose Application.
To begin, there is no need to drag any "Actions" into the open pane. Just click the Record button. Automator disappears, leaving a Stop recording button floating over C3D. Click on the C3D menu bar to bring C3D to the front, and do the following sequence. It doesn't matter how fast or slow you record the steps, so take your time. (Automator has a "Timeout" set for a default 2 seconds, which will pause each event for a couple of seconds to ensure smooth operation).

command + R (renders 1.jas)
command + W (close Render Manager)
command + W (close 1.jas)
command + D (or command + delete -- refer to step 5 above) (Don't Save changes)
command + O (Opens "queue 3" folder; refer to step 6 above)
mouse click on jas.2
command + O (Opens jas.2)

Repeat the sequence for the remaining files, in this example, 2.jas and 3.jas. Refer to the attached picture of a three file version as an example. It is not possible to copy and paste within the Watch Me Do pane to duplicate steps, so you need to record the steps for each file.

9) After closing 3.jas click the Automator Stop Recording button. Automator reappears with a Watch Me Do pane containing the recorded "events." Note in particular that the description of "Type '2.jas' into the text field" is misleading. It actually selects whatever file is in the second row. (In OS X 10.6 the line reads "Select the row that contains "2.jas").

10) I dragged a Quit Application/Cheetah3D.app action pane after the Watch Me Do pane. It seemed to work better than recording a final command + Q in C3D.

Save as Q 3.app. Put the Q 3.app icon in the Dock.

SYSTEM PREFERENCES:
OS X 10.6: (no change is needed)
11) OS X 10.10: Security and privacy -- Accessibility -- Privacy -- (unlock) -- click + -- add Q 3.app -- (lock)

TEST THE APP:
12) In the "queue 3" folder. change the name of 1.jas to a.jas, 2.jas to b.jas, and 3.jas to c.jas
13) Open a.jas in C3D, full screen layout with Menu Bar visible, per step #2
14) Click the Q 3.app icon in the dock
15) Hopefully, there is no error message and C3D proceeds to render the a.jas file, followed by b.jas and c.jas, quitting when all done. Notice that files are opened from first to last, top to bottom, regardless of the name change. There is a 2 second pause between actions.

If the Q 3.app works OK, use the same process to make another one for as many files as you want. Then load the folder with a bunch of files to render and let it work while you do something else.

If you put fewer than 3 files into "queue 3," it will report an error when it looks for the next file and there's no file. It actually works as you would want, stopping when through, but this simple app has no IF — THEN logic, so it gets stuck. Use command + option + escape to quit. Alternatively, use some files of blank scenes (z.jas, zz.jas, etc.) to add up to 3 files. It will only add a few seconds to the process and avoid crashing the app.

Finally, open the app in Automator to see its simplicity, and to see all the specific "actions" available should you choose to automate something in another program. It's great for people like me who just want to automate a repetitive task. Maybe someone can add an AppleScript or Shell script action to improve or add functions to this app and post it on the forum. In particular, it would be better if it could work in the background while other apps are active. I am posting it in the General forum because anyone can use it and it's not really a script.

 

Attachments

  • q3.jpg
    q3.jpg
    99.7 KB · Views: 460
  • q3.pdf
    32.6 KB · Views: 336
Last edited:
Probably should be posted in the tutorial section ;-)

You could also post the automator document, couldn't you?

How do you avoid rendering everything at once (usually a bad idea)?

I think what you need is a shell script that can tell if your Mac is idle, and another shell script that can parse the C3D render cache. (C3D Buddy has one of the latter.)

So now you could create a script that:

  1. Sits in the background until computer is idle
  2. Check the Render Queue folder for the oldest scene that doesn't have a corresponding completed render that is more recent that the last changes to the source scene.
  3. Start rendering
  4. Go back to 1.

Actually, I think I've just designed C3D Buddy's next feature.
 
Last edited:
Mistimed renders

Hi Pod,

I have long wished C3D had a render queue, and understood that there were technical reasons why there wasn't. It seemed like Automator might suffice to make a tiny app that worked on my combination of Mac and C3D set-up, but would need to be re-created for any different Mac/C3D set-up. Close enough. The whole point is to render one after another, not simultaneously (which C3D does anyway). My initial tests seemed to work fine when I substituted files that took longer to render than the 1.jas, 2.jas etc.

Unfortunately, such has not been the case on subsequent tests. Sometimes it works, sometimes it doesn't allow time for one render to finish before starting another (and another, and another). I don't know why — this is the product of trial-and error experimentation by a non-coder.

As mentioned previously, I posted it in the hope that it would work as advertised, but could be improved with added functions by anyone with the requisite skills. I did not post the Automator document because it would fail if your layout (OS X version, screen size, window placement) varied from mine. Hence the tedious directions and picture. I also thought there was value in demonstrating Automator to others like me who have never tried it.

Thank you for the specific suggestions and link to a possible javascript fix. However, "now you could create a script" is incorrect. I have no such skills. Even the most rudimentary Automator app is challenging to me. I would welcome anything you can make that serves the purpose.

In response to my earlier request, Hiroto has offered to make a queue that would work in Yosemite. That would be great. I gave it a shot, but you guys are in a different league — please make something that knows when a render is complete before starting the next one. It would be invaluable to most C3D users.

http://www.cheetah3d.com/forum/showthread.php?t=11774
 
Last edited:
I'll add the feature to C3D buddy when I have time. (The other things I want to add are script management and editing, material management, and possibly some kind of cloud integration (e.g. sync multiple render folders to the cloud).)
 
Back
Top