Extend view.write_image?
-
Hi,
In my plugin script I put various text and draw objects on the screen with
view.draw_text and view.draw2dWhen I export current view to 2D image with either File->Export->2D Graphic, or in script with view.write_image, text and rectangles from the screen aren't included in output images (only model entities are visible).
Is there some way to export to an image all objects visible on current screen?
Thanks in advance,
Marija -
No.
The view method graphics are temporary and intended for transient use by tools.
Once you invoke another API method they are gone...The only way you can 'capture' these in an image is to use an external 'screenshot' tool...
They are not 'objects' like entities.
You could use a @group with real geometry and text etc inside it, this will export in any image.
When you tool is done use @group.erase! in your 'exiting' methods to ensure it's tidied up... -
Thanks TIG,
As you mentioned these aren't real objects. They need to be on the screen on constant position even when user changes a view, and user chen toggle thme on/off from gui.
Idea is I import some data into model in form of false color textures for faces, and these additional things are false color legend and some comments.
So for export I definitely need them - since image with false colors without legend doesn't have much sense.
If no other solution found (beside using external screenshot programs), I'll have to use your group idea, and modify my approach to false-color legend preview.
Thanks again,
Marija -
@unknownuser said:
(referring to Windows ALT+PrintScreen manual workaround.)
..., but I needed some to write a code to save and image from my plugin.You may on Windows only, use Win32OLE.so and the SendKeys() function.
Advertisement