LC #42 Pipers Alley

View Full Version : Easy Preview

12-15-2006, 10:04 AM
Maybe you know this Problem: You preview a scene, look at it and then continue to work in Cinema without closing Quicktime. Next time you want to preview you get an errormessage saying that the preview can't be written because the file is still in use (or something similar to this). If you are anything like me (and use Cinema 4d on a daily basis) you'll see this error message about 20 times a day. Annoying!
Of course you could just close the preview window everytime after you're done, but wouldn't it be nice if Cinema did that for you? To do that I wrote a little script. It currently only works on a mac because I'm using apple script to close Quicktime but I think something similar is possible on a PC. The only unresolved issue is, that I have to put the in the root directory of Cinema 4D (in the MAXON folder), which I feel is rather "unclean".

The (extremely basic) scribt goes like this:

var filename = GeGetStartupPath();
filename->SetLastString(""); // is the compiled apple script

The apple script is:

tell application "Quicktime Player"
end tell

Now every time you start a preview the script first closes quicktime ant then starts the new preview.
If you have improvements for the script or a way to adapt this for a PC please feel free to post them.
My ideal way of this working would be as compiled .cob in a subfolder in the plugins directory, where according to the os (checked with GeGetCurrentOS()) the appropriate application for closing qt is called from within that subdirectory. I tried GeGetRootFilename() but it somehow didn't give me a useful path to the


12-16-2006, 11:43 AM
Good news! I firgured out how to do it on PC too. Now I'm working on making a little plugin out of it. I'll post it when its ready.

Even better news! I just finished the plugin. Now I only have to register it at the Maxon page and then release it. Because I'm working on a PC at home I will have to test it at my G5 at work first, but its looking good. I hope it will proove useful for anyone.

12-18-2006, 01:32 AM
Great work here! Thanks!

12-18-2006, 01:24 PM
Here is my first working version of the plugin. Hope to get some feedback if it works for you.

A thing that I'm still working on it the fact that the compiled apple script always closes Quicktime completely instead of just closing the window. I wrote anothe script that goes like this:

tell application "QuickTime Player"
if exists window "" then close window ""
end tell

This works fine in closing the preview window, but somehow thats not enough for Cinema. After switching to QT and then back to C4D it works fine. Odd.
If you can help out please do so.


CGTalk Moderation
12-18-2006, 01:24 PM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.