Check for Interactive Render Region [SOLVED]



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



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



  • 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



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



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

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


Log in to reply