Knowing when a viewport is "capturing"

Is there any information present in a display pipeline / conduit that would let me know that a viewport is “capturing” to file or clipboard rather than drawing to the screen?

Specifically, I am updating some old grasshopper components that draw geometry at a particular location on screen (Heads-up display-style). The problem is that geometry is always scaled/positioned wrong relative to the rest of the geometry when capturing at a scale other than 1. I have access in the component draw methods to the DisplayPipeline object but cannot find anything in there that helps me correct for the “scaling” that happens. Any ideas?

@dave_stasiuk pointed me to this earlier related discussion that didn’t seem to land on any conclusions: Capture display conduit [VB.Net]

FWIW “IsPrinting” seems to be false even during these captures.

I can confirm this…when I run a ViewCaptureToFile with scaling set to 2, for example, the override for PostDrawObjects is called four times for each object, and each time IsPrinting returns as false.

Hi @andheum,

The display pipeline does have the concept of a ‘context’, which basically tells what what is being drawn (e.g. print, preview, capture, etc.). This is probably something we can exposed in the Rhino WIP.

https://mcneel.myjetbrains.com/youtrack/issue/RH-39547

– Dale

RH-39547 is fixed in the latest WIP