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

    Check for Interactive Render Region [SOLVED]

    SDK Help
    0
    5
    487
    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 01/10/2015 at 19:48, xxxxxxxx wrote:

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

      ---------
      Hi all,

      I have looked but did not find an answer to this one. How can one check whether the Interactive Render Region is being used?
      I know of CheckIsRunning(CHECKISRUNNING_EDITORRENDERING) and CheckIsRunning(CHECKISRUNNING_EXTERNALRENDERING) but did not find a check for the IRR.
      Any help would be appreciated.

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

        On 02/10/2015 at 05:27, xxxxxxxx wrote:

        Hi,

        this depends a bit, which information you are actually looking for.
        If it's enough, to find out if the IRR is generally activated, you can use the following (for example in Execute() of a CommandData), you need to include "osniper.h" for the IRR description IDs:

        BaseSceneHook *sh = doc->FindSceneHook(430000000);  // ID_SNIPER_SCENE_HOOK is missing in SDK
        if (!sh)
          return false;
        BaseContainer* bc = sh->GetDataInstance();
        if (bc->GetBool(IRR_ENABLE))
          GePrint("IRR is enabled");
        else
          GePrint("IRR is disabled");
        

        If, on the other hand, you need to find out if IRR is actually rendering, you'd need to evaluate MSG_MULTI_RENDERNOTIFICATION (in its RenderNotoficationData see the RENDERFLAGS), which is for example send to all elements in a scene (like all NodeData derived plugin types). The start member in RenderNotificationData tells you, if the render gets started or ended. And the flag RENDERFLAGS_IRR in the flags tells you, if it's an IRR.

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

          On 02/10/2015 at 05:47, xxxxxxxx wrote:

          Thank you for the reply Andreas.

          I am checking from GetVirtualObjects, the first method didn't seem to work.

          For the MSG_MULTI_RENDERNOTIFICATION, can you please provide a snippet on how to use it? I couldn't find any example on RenderNotoficationData  and setting its RENDERFLAGS.

          Thanks

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

            On 02/10/2015 at 06:22, xxxxxxxx wrote:

            Hi,

            here it's working fine in GVO as well.
            But I realize I forgot to tell you, that you need to include "osniper.h" to get the IRR_ENABLE define. Sorry, edited above post.

            And for the message part, here you go:

            Bool AnyNodeDataPlugin::Message(GeListNode* node, Int32 type, void* data)
            {
              switch(type)
              {
                case MSG_MULTI_RENDERNOTIFICATION:
                {
                  RenderNotificationData* const rnd = static_cast<RenderNotificationData*>(data);
                  if (!rnd)
                    break;
                  if (rnd->flags & RENDERFLAGS_IRR)
                  {
                    if (rnd->start)
                      GePrint("IRR render started");
                    else
                      GePrint("IRR render ended");
                  }
                  break;
                }
              }
            }
            

            I probably should stress, that this is a different information than in the previous post. Here you get the information, that IRR is actually rendering, while in the previous post's code you get the information, if the user enabled IRR.

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

              On 02/10/2015 at 07:25, xxxxxxxx wrote:

              It works now. Thank you Andreas, you've been a great help!

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