Maxon Developers Maxon Developers
    • Documentation
      • Cinema 4D Python API
      • Cinema 4D C++ API
      • Cineware API
      • ZBrush Python API
      • ZBrush GoZ API
      • Code Examples on Github
    • Forum
    • Downloads
    • Support
      • Support Procedures
      • Registered Developer Program
      • Plugin IDs
      • Contact Us
    • Categories
      • Overview
      • News & Information
      • Cinema 4D SDK Support
      • Cineware SDK Support
      • ZBrush 4D SDK Support
      • Bugs
      • General Talk
    • Unread
    • Recent
    • Tags
    • Users
    • Login

    sleep or wait with coffee

    Scheduled Pinned Locked Moved SDK Help
    9 Posts 0 Posters 883 Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • H Offline
      Helper
      last edited by

      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?

      1 Reply Last reply Reply Quote 0
      • H Offline
        Helper
        last edited by

        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.

        1 Reply Last reply Reply Quote 0
        • H Offline
          Helper
          last edited by

          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?

          1 Reply Last reply Reply Quote 0
          • H Offline
            Helper
            last edited by

            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()).

            1 Reply Last reply Reply Quote 0
            • H Offline
              Helper
              last edited by

              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?

              1 Reply Last reply Reply Quote 0
              • H Offline
                Helper
                last edited by

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

                1 Reply Last reply Reply Quote 0
                • H Offline
                  Helper
                  last edited by

                  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.

                  1 Reply Last reply Reply Quote 0
                  • H Offline
                    Helper
                    last edited by

                    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:

                    <[URL-REMOVED]>

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


                    [URL-REMOVED] @maxon: This section contained a non-resolving link which has been removed.

                    1 Reply Last reply Reply Quote 0
                    • H Offline
                      Helper
                      last edited by

                      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 🙂

                      1 Reply Last reply Reply Quote 0
                      • First post
                        Last post