0

I'm using this answer to generate images from view port enter image description here

but is there a way to directly externally store/generate this image?
and by that I mean NOT having to manually save them through Image Editor enter image description here

cak3_lover
  • 477
  • 3
  • 11
  • What's wrong with simply rendering the viewport with bpy.ops.render.opengl()? – Martynas Žiemys Sep 15 '22 at 14:49
  • What's the context of this question? What are you trying to do and why? – Martynas Žiemys Sep 15 '22 at 14:53
  • @MartynasŽiemys I'm trying to continuously generate viewport images to show in another application, I thought it would be faster to directly generate the image file rather than having to save it – cak3_lover Sep 15 '22 at 14:57
  • I don't know much about GPU framebuffers, but the answer you link to already provides a way to get it from Blender's Python API so you only need to save it to image in Python and that sounds like something one can find online. However, it seems unlikely it would be faster to save an image to file using Python than C which I assume Blender's rendering does, so maybe you want something else than saving to file. – Martynas Žiemys Sep 16 '22 at 05:39
  • @MartynasŽiemys could you elaborate on "using python than C" ? does blender work with C as well? is that what you're hinting at? – cak3_lover Sep 16 '22 at 08:01
  • 1
    I am no expert in this, but as far as I understand Blender's internal functions and native operators are likely to be more optimized and work faster that what is written in Python. Blender has Python API and it's UI uses Python, but the main stuff is written mostly in C/C++ and that is generally way faster than Python. I have no idea how bpy.ops.render.opengl() works, but I think it's quite reasonable to expect it to be well optimised since everybody wants faster rendering. If it was possible to easily render stuff to files faster, everybody would probably be doing that already. – Martynas Žiemys Sep 16 '22 at 13:21
  • @MartynasŽiemys would you happen to be fimilar with import gpu? because this answer does exactly what I need but instead of generating the image every time some change occurs I need it to generate only when the function is invoked – cak3_lover Sep 17 '22 at 06:58

0 Answers0