Quantcast
Channel: Rhino Developer - McNeel Forum
Viewing all articles
Browse latest Browse all 8565

Good way to check for Views.ActiveView.Redraw() completion?

$
0
0

@mswaidan wrote:

I’m working on a c# plugin that batch captures selected named views & display modes. Pseudo code:

void CaptureViews() {
  foreach (namedView in selectedNamedViews) {
    activeView = namedView
    foreach (displayMode in selectedDisplayModes) {
      activeView.DisplayMode = displayMode
      activeView.Redraw()
      bitmap = activeView.CaptureToBitmap
      bitmap.Save()
    }
  }
}

For some of the heavier display modes (e.g. Arctic), the captured file didn’t match the display mode, so I made CaptureViews() async and added await Task.Delay(TimeSpan.FromSeconds(1)); after the Redraw(). This is working, but it doesn’t seem like a great solution. Is there a proper way to check whether Redraw() has completed?

Posts: 2

Participants: 2

Read full topic


Viewing all articles
Browse latest Browse all 8565

Trending Articles