scene.capture() does not include labels
See original GitHub issueThe function scene.capture(filename)
does not consider labels.
Execute the following code in a jupyter notebook:
from vpython import *
sphere()
label(text='TEXT')
scene.capture('image.png')
Expected output | Actually saved |
---|---|
I noticed that there are two canvas
elements in the HTML, one containing the labels, and the other being a placeholder for the 3D objects:
<div class="glowscript-canvas-wrapper ui-resizable" style="display: inline-block; position: relative; float: none;">
<canvas style="position: absolute;" width="640" height="400"></canvas>
<canvas style="position: relative; background-color: transparent;" width="640" height="400"></canvas>
<div class="ui-resizable-handle ui-resizable-e" style="z-index: 90;"></div>
<div class="ui-resizable-handle ui-resizable-s" style="z-index: 90;"></div>
<div class="ui-resizable-handle ui-resizable-se ui-icon ui-icon-gripsmall-diagonal-se" style="z-index: 90;"></div>
</div>
It seems that the capturing function here only considers one of them.
Issue Analytics
- State:
- Created 2 years ago
- Comments:8 (3 by maintainers)
Top Results From Across the Web
How to capture an output image generated by the box function ...
I want to capture the output image rendered by the display() function as a .png file. I am using scene.capture('test4312'). But getting an...
Read more >When using the scenecapture2d to send a texture render ...
When using the scene capture 2d as a spout source the colours are darker as shown in the attached image. I've tried setting...
Read more >Scene Capture Component not capturing Lumen Global ...
As the title states, I can't seem to get a Scence Capture component to work with Lumen. It seems to only capture Screen...
Read more >Scene Capture 2D no longer working in 4.27 - Oculus Forum
I recently updated my project from 4.26 to 4.27 and now I cannot get any of my scene capture 2d components to capture...
Read more >Style point layers—ArcGIS Online Help | Documentation
Choose styles for points in scenes. ... Markers under Icons do not include outline options. Click Outline transparency to set the transparency with...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I tried your code with GlowScript VPython 3.2dev, and it hangs for me on this statement:
await new Promise(r => img.onload=r); // wait for image to be loaded
??
You can replace the line with
await img.decode();
, which is essentially the same (it returns a promise) but should handle either case. I added a second commit to the merge request.