Legend2D ViewCaptureToFile Bug

I’d like to report this graphical bug when using the [ViewCaptureToFile] command in Rhino with the 2D legend enabled. When capturing screenshots, the built-in View capture in rhino glitches both while previewing and upon export. Using Ladybug’s Built-in [LB Capture View] component doesn’t do this, which is my workaround for the moment. Using Latest version of Ladybug (1.6).

1 Like

Please see attached images:


Hi @realrhino1,

I can confirm I get the same issue when scale is set to 2. When scale is set to 1 I get an image that reflects the viewport:
Scale 2


Scale 1

I’m also finding that transparent background causes problems:
Scale 1 with transparent background ticked

@chris - hope you don’t mind me tagging for bug reporting. I’ve just run the versioner to make sure I’m fully up to date

For the sake of completeness, here’s Scale 2 without the leg_par2d_ input

Hi @chris,
Just to see if this is an issue that is on your TODO list?
We have the same behaviour on our side: The hourly plot (for instance) is fine, but the 2D Text/Legend

Thanks,
-A.

Hi @AbrahamYezioro , @charlie.brooker , and @realrhino1 ,

Thanks for bringing this to my attention and I’m sorry that I missed seeing it 3 months ago.

I don’t really have control over how the native Rhino commands run so I don’t think that I will be able to do anything about the native Rhino ViewCaptureToFile command unless someone from the McNeel team believes that it can be addressed (CC: @wim and @piac ). The issue fundamentally results from how the Rhino DisplayPipeline renders the Sprite and 2dText objects on the screen. Because these objects are specified in 2D screen coordinates, this results in them getting repeated whenever a view is captured, which is larger than the current viewport.

Granted, I may be able to get the LB Capture View component to work correctly because we fully control the code that is running there. I’ll also note, @charlie.brooker , that the transparent_ option on that component does not have the issue that you cite there and I remember revising the code in the component towards this end. So I generally recommend using that component if you want the best compatibility with how we make the graphics in Ladybug Tools.

Let me see if I can figure something out to get the Ladybug Capture View component to work and I’ll post back here if I find a solution.

1 Like

Ok, so I have realized that both the Sprite and the 2dText objects have an option to be drawn in World3D coordinates and, when I use this, they stay in one place instead of being duplicated across the view capture. So, if I can figure out how to translate the 2D screen coordinates to world coordinates during each frame render, I might be able to prevent the legends and 2D text from being duplicated during screen capture.

Let me see if RhinoCommon has anything for this.

1 Like

A post was split to a new topic: How does the View Capture Width and Height Work?

I have a correction to what I said earlier. It seems that the use of the World 3D point is only a viable solution when the point is NOT being recalculated for each frame that is being drawn. In other words, it only works when there is a static 3D world point that stays in one place as you navigate around.

This means that there is no way to have the Legend be BOTH a 2D screen-oriented legend that remains in the plane of the screen as you navigate AND also have it not be repeated during larger screen captures. This fact seems to be designed into the way the Rhino DisplayPipeline works so I’m a bit doubtful that there’s anything that can be done on McNeel’s end to change this.

The only thing I can offer is a workaround with the 3D legend, which is a little bit more work to set up but it will look excellent in whatever screen capture that you make. All that you have to do is NOT use the 2D legend parameters and instead plug in a base_plane for the LB Legend Parameters. You can use the LB Orient to Camera component to get a plane that is oriented to the screen like so:


visualization_set_3D_screen_orient.gh (37.2 KB)

Your legend won’t stay in one place as you navigate around (you’ll have to re-compute the “Orient to Camera” component for it to get the latest screen orientation). However, it will not be repeated when you use and of the “Screen Capture” workflows (either with the Ladybug component or with the native Rhino command).

I hope this solution is good enough for your purposes since you’re hopefully only need to export such high res images when you’re putting together your final production-level deliverables. For quicker studies, you can just keep the viewport extents as they are and you’ll never see the legend repeated.

1 Like