PDA

View Full Version : Easy Preview


Sparkle
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 closeQT.app 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("closeQT.app"); // closeQT.app is the compiled apple script
GeExecuteFile(filename);
CallCommand(1000974);

The apple script is:

tell application "Quicktime Player"
quit
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 closeQT.app.

Cheers,
Sparkle

Sparkle
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.

*edit*
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.

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

Sparkle
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.

http://www.sendspace.com/file/zme5rj

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 preview.mov window. I wrote anothe script that goes like this:

tell application "QuickTime Player"
if exists window "preview.mov" then close window "preview.mov"
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.

Greets,
Sparkle

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.