sleep or wait with coffee



  • THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

    On 14/12/2007 at 09:13, xxxxxxxx wrote:

    User Information:
    Cinema 4D Version:   10.0 
    Platform:   Windows  ;   
    Language(s) :   C.O.F.F.E.E  ;

    ---------
    Hi guys,

    i have a little question about coffee. I'd like to render a bunch of pictures with coffee as a result of a written plugin, but the problem is, that when Cinema starts to render the first picture, I am not able to ask Cinema with Coffee if it's still rendering.
    There may be a solution with the "fileexists" command, because a picture is saved, when cinema has finished rendering, but therefore I would need to tell Ciname something like : "Look every 2 seconds if the file was saved... if so, the continue with the next.." and so on.
    My Question is : Is there anything like a sleep or wait command for Coffee or know work-around to get this working?



  • THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

    On 14/12/2007 at 10:39, xxxxxxxx wrote:

    I don't think that this is possible. In C++, there are Message() notifications using MSG_MULTI_RENDERNOTIFICATION that notify your plugin when a render is starting or ending via a RenderNotificationData class supplied with the message. Nothing even remotely similar in COFFEE. You could experiment with a plugin tag to see if Message() receives this notification (might need to use the numerical reference for the message type) with appropriate data - but I wouldn't bet on it.

    If you must go the other route, you can open a dialog and start a timer to do the file check. Checking for a file may be more difficult than expected if the file is being overwritten because it already exists. Here you might need to delete the original (or copy elsewhere and delete)) before commencing the render.



  • THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

    On 14/12/2007 at 11:11, xxxxxxxx wrote:

    thanks.. I think the timer should be the right way to go. Do you have any suggestions, how I can script this timer?



  • THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

    On 14/12/2007 at 11:55, xxxxxxxx wrote:

    If you have a dialog class already, use it. If not, you'll need to create a dialog class derived from GeDialog. Include Timer() as a method in your dialog class to react to timer messages. Then call myDialog->SetTimer(val) after opening the dialog where 'val' is the time interval in milliseconds. For your situation 2000 (for once every 2 seconds) should be more than sufficient. In Timer(), do your checks to determine when Cinema has finished rendering. Timer() will be called every 2 seconds (approximately - as noted in the COFFEE docs under SetTimer()).



  • THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

    On 14/12/2007 at 13:22, xxxxxxxx wrote:

    Sorry, but it does not want to work. Can you post a little example, how to deal with this Timer?



  • THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

    On 14/12/2007 at 13:33, xxxxxxxx wrote:

    Are you doing your COFFEE script in a COFFEE tag or Xpresso node or are you creating an actual plugin (that shows in the Plugins menu)?

    Also note that scripts in tags or nodes are forbidden to do file access:

    Note: To avoid the possibility of C4D being used to spread viruses, C.O.F.F.E.E expressions (those that are included in .c4d files) cannot use any file functions or classes.

    The only way 'round this is to make a COFFEE plugin (.cof file that resides in the Plugins folder with a unique Plugin ID obtained here).



  • THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

    On 14/12/2007 at 13:36, xxxxxxxx wrote:

    Sorry, for not mentioning that.
    I am developing a Menuplugin - it's a cof file.



  • THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

    On 14/12/2007 at 13:57, xxxxxxxx wrote:

    Check out the Clock.cof in the R9.1 COFFEE SDK zip:

    http://www.maxon.net/pages/support/plugincafe_downloads_old_e.html

    This will give you a good idea of how it works (for instance, they call SetTimer() in Init() for the dialog).



  • THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

    On 15/12/2007 at 03:08, xxxxxxxx wrote:

    thanks a lot. It works :-)


Log in to reply