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

    detecting messages while rendering [SOLVED]

    SDK Help
    0
    5
    429
    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
      Helper
      last edited by

      On 13/05/2015 at 18:37, xxxxxxxx wrote:

      User Information:
      Cinema 4D Version:   15+ 
      Platform:   Windows  ;   
      Language(s) :     C++  ;

      ---------
      I'm creating my custom renderer, I want to detect different messages.

      1- for example when the user renders in viewport, if he clicks anything "some message is sent" , it stops the rendering.

      2- when he renders in picture viewer, to stop the rendering there is a cancel message "I wanna know which message to listen to it".

      3- what about different messages, for example when object moves, camera moves, etc...

      I know this question may seem too broad, but I just need a hint of where to start so I can manage different messages correctly.

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

        On 14/05/2015 at 06:07, xxxxxxxx wrote:

        Hello,

        you can check if the current render process should end by checking the render thread.

          
        if(vps->thread && vps->thread->TestBreak())  
        {  
         return RENDERRESULT_OK;  
        }  
        

        Moving an object or the camera is a form of user interaction and has nothing to do with rendering. Such interactions typically trigger a core message, especially EVMSG_CHANGE.

        Best wishes,
        Sebastian

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

          On 14/05/2015 at 06:18, xxxxxxxx wrote:

          thanks Sebastian, I want to listen to these messages for interactive rendering.

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

            On 04/06/2015 at 12:58, xxxxxxxx wrote:

            sorry for opening this thread again, but I tested this, and found a main problem, my render call is something similar to this:

              
            	if (vps->vp==VIDEOPOSTCALL_INNER && vps->open)
            	{  
                            //prepare data from RayObject(s)....  
                            myRender();// a blocking call!!  
                            cleanup();//  
                    }  
            
            

            so how can I do this check?? even if the GUI is showing the message and I click it, the execution of this message won't happen before myRender() function exits.

            any ideas?

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

              On 04/06/2015 at 13:14, xxxxxxxx wrote:

              nvm, I think I know now how to do it, I put "(vps->thread && vps->thread->TestBreak())" in my render cancel callback.

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