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