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

    Viewports not refreshed when updating RenderData

    Scheduled Pinned Locked Moved PYTHON Development
    3 Posts 0 Posters 479 Views 1 Watching
    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 25/08/2011 at 07:04, xxxxxxxx wrote:

      Hello,

      In a python tool I wrote, I'm setting a backgroundObject with an animation. Then the tool edits the active render data to change the width and height of the render (and the viewports).

      I use the following code:

      renderData = document.GetActiveRenderData()
       renderData[c4d.RDATA_XRES] = width
       renderData[c4d.RDATA_YRES] = height
       renderData[c4d.RDATA_FRAMERATE] = fps
       renderData[c4d.RDATA_FRAMEFROM] = c4d.BaseTime(startFrame, fps)
       renderData[c4d.RDATA_FRAMETO] = c4d.BaseTime(endFrame, fps)
       document.InsertRenderData(renderData)
       document.SetActiveRenderData(renderData)

      The problem is that, most of the times, the viewport is not refreshed with the correct width and height.
      If I open the render settings dialog, I can see the values that the tool has set but it's not the ones used in the viewports: if I  edits the values and put the same value again, then it's working! If I don't do that manual edit, I can do a lot of different actions in the application and the viewport is never refreshed with the correct width and height. There's a missing notification and nothing else than opening the dialog and entering the value manually seems to trigger that notification.
      I tried adding c4d.EventAdd(),  MSG_UPDATE, force redraw views, change the timeline, etc. but nothing fixed the problem.

      Thanks for your help,
      Benoit

      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 25/08/2011 at 11:23, xxxxxxxx wrote:

        Hi Benoit, after you set the data you can redraw the editor view by the following call:

        c4d.DrawViews(c4d.DRAWFLAGS_FORCEFULLREDRAW)

        Btw, document.InsertRenderData(...) is not necessary here, renderData is the reference to the renderdata object.
        Cheers, Sebastian

        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 30/08/2011 at 04:46, xxxxxxxx wrote:

          That's one of the things I already tried. I just tried again, and it doesn't work. Maybe because I'm on a mac?
          Thanks for the comment on InsertRenderData, I didn't put it at first but added while trying to force the refresh...

          Benoit

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