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

    SceneHook detecting render vs viewport

    SDK Help
    0
    5
    468
    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 26/06/2014 at 04:12, xxxxxxxx wrote:

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

      ---------
      I have a scenehook plugin with is "Executed()" whenever redraw occurs. Is there a way to detect whether the the redraw is a "Render to Viewport" or a full render as opposed to an editor viewport redraw?

      I also have a tool plugin which receives the start / stop render notifications. However they are only received if the tool plugin is the currently active tool. This means if some other tool is active, I do not get the start / stop render notifications.

      My aim is to detect start of render and end of render so I can manipulate aspects of the scene.

      How should I best achieve this?

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

        On 26/06/2014 at 09:47, xxxxxxxx wrote:

        MSG_MULTI_RENDERNOTIFICATION is sent to your SceneHook when the scene is about to be rendered.
        It's not safe to do scene structure modifications in that context, though.

        Best,
        -Niklas

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

          On 26/06/2014 at 10:53, xxxxxxxx wrote:

          Thanks Niklas.

          Understood re not making scene modifications at that time.

          Is there a suitable time when I can make scene mods prior to and post render?

          If not I can probably work around it however I was trying to minimise the scene footprint that the renderer has to deal with.

          If not, I'm thinking that two objects, one for editor version and one for render version would work. That way the normal SetEditorMode() and SetRenderMode() controls will automatically take care of the switch between light detail and full detail for me.

          Any thoughts?

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

            On 26/06/2014 at 10:58, xxxxxxxx wrote:

            Thinking about it further...

            In a future plugin, I may need to move an existing object between frames. This may be just moving points in an object, or it may mean moving the whole object.

            Would you not do that in the execute() animate phase? Does that count as a unsafe scene modification? If so, when should you make such changes?

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

              On 26/06/2014 at 11:04, xxxxxxxx wrote:

              Hi Derek,

              it is safe to do in SceneHookData::Execute() whatever you are allowed to do from
              TagData::Execute() or ObjectData::Execute(). You can of course only do the processing
              when actually rendering. But this is rarely used because one usually wants to see the
              changes in the Viewport, too 🙂

              Cheers,
              -Niklas

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