CGMatter

Render Viewport Animation (OpenGL)

Sep 11th, 2026
18
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.44 KB | Software | 0 0
  1. import bpy
  2.  
  3. def viewport_render(start=None, end=None):
  4.     scene = bpy.context.scene
  5.     original_range = scene.frame_start, scene.frame_end
  6.     if start is not None:
  7.         scene.frame_start = start
  8.     if end is not None:
  9.         scene.frame_end = end
  10.     bpy.ops.render.opengl(animation=True, view_context=True)
  11.     scene.frame_start, scene.frame_end = original_range
  12.  
  13. viewport_render()
  14. # Custom range example: viewport_render(20, 50)
Advertisement
Add Comment
Please, Sign In to add comment