omni.kit.widget.opengl

OpenGL Widget

omni.kit.widget.opengl

omni.kit.widget.opengl module provides a way to draw with OpenGL in an omni.ui.Widget

class omni.kit.widget.opengl.OpenGLImageProvider

Bases: ImageProvider

OpenGLWidget: A simple omni.ui.ImageProvider that will draw OpenGL content.
kwargs:

initialize_gl: Callable[uint, uint, bool] draw_gl: Callable[uint, uint] … additional kwargs for omni.ui.Frame

call_draw_gl_fn(self: omni.kit.widget.opengl._opengl_widget.OpenGLImageProvider, arg0: int, arg1: int) None
Set the function that will be called to render OpenGL content.
def on_draw_gl(viewport_width: :int, viewport_height: int)
arguments:

viewport_width (int) The current width to use to fill the omni.ui.OpenGLWidget with OpenGL content. viewport_height (int) The current height to use to fill the omni.ui.OpenGLWidget with OpenGL content.

call_initialize_gl_fn(self: omni.kit.widget.opengl._opengl_widget.OpenGLImageProvider, arg0: int, arg1: int, arg2: bool) None
Set the function that will be called when the OpenGL render target is created or resized.
def on_initialize_gl(viewport_width: :int, viewport_height: int)
arguments:

viewport_width (int) The current width to use to fill the omni.ui.OpenGLWidget with OpenGL content. viewport_height (int) The current height to use to fill the omni.ui.OpenGLWidget with OpenGL content. context_init (bool): Whether or not this is the first initialization of the OpenGL context.

property color_format
property depth_format
enable_rendering(self: omni.kit.widget.opengl._opengl_widget.OpenGLImageProvider, arg0: bool) bool
Enable or disble any OpenGL rendering occuring for the OpenGLWidget.
arguments:

enable (bool): Whether to enable or disable the OpenGL rendering completely.

get_current_textures(self: omni.kit.widget.opengl._opengl_widget.OpenGLImageProvider, color: bool = True, depth: bool = True) Dict[str, omni::ui::OpenGLTextureHandle]
has_draw_gl_fn(self: omni.kit.widget.opengl._opengl_widget.OpenGLImageProvider) bool
Set the function that will be called to render OpenGL content.
def on_draw_gl(viewport_width: :int, viewport_height: int)
arguments:

viewport_width (int) The current width to use to fill the omni.ui.OpenGLWidget with OpenGL content. viewport_height (int) The current height to use to fill the omni.ui.OpenGLWidget with OpenGL content.

has_initialize_gl_fn(self: omni.kit.widget.opengl._opengl_widget.OpenGLImageProvider) bool
Set the function that will be called when the OpenGL render target is created or resized.
def on_initialize_gl(viewport_width: :int, viewport_height: int)
arguments:

viewport_width (int) The current width to use to fill the omni.ui.OpenGLWidget with OpenGL content. viewport_height (int) The current height to use to fill the omni.ui.OpenGLWidget with OpenGL content. context_init (bool): Whether or not this is the first initialization of the OpenGL context.

import_texture(self: omni.kit.widget.opengl._opengl_widget.OpenGLImageProvider, arg0: omni.gpu_foundation_factory._gpu_foundation_factory.RpResource) omni::ui::OpenGLTextureHandle
set_draw_gl_fn(self: omni.kit.widget.opengl._opengl_widget.OpenGLImageProvider, fn: Callable[[int, int], None]) None
Set the function that will be called to render OpenGL content.
def on_draw_gl(viewport_width: :int, viewport_height: int)
arguments:

viewport_width (int) The current width to use to fill the omni.ui.OpenGLWidget with OpenGL content. viewport_height (int) The current height to use to fill the omni.ui.OpenGLWidget with OpenGL content.

set_initialize_gl_fn(self: omni.kit.widget.opengl._opengl_widget.OpenGLImageProvider, fn: Callable[[int, int, bool], None]) None
Set the function that will be called when the OpenGL render target is created or resized.
def on_initialize_gl(viewport_width: :int, viewport_height: int)
arguments:

viewport_width (int) The current width to use to fill the omni.ui.OpenGLWidget with OpenGL content. viewport_height (int) The current height to use to fill the omni.ui.OpenGLWidget with OpenGL content. context_init (bool): Whether or not this is the first initialization of the OpenGL context.

texture_blit(self: omni.kit.widget.opengl._opengl_widget.OpenGLImageProvider, color: int = 0, depth: int = 0, scale: carb._carb.Float3 = carb.Float3(1, 1, 1)) None
class omni.kit.widget.opengl.OpenGLScene(widget_or_provider)

Bases: object

Simple class for an OpenGLScene object for subclassing that sets up callbacks into the omni.ui object

draw_gl(viewport_width: int, viewport_height: int)
initialize_gl(viewport_width: int, viewport_height: int, first_init: bool)
class omni.kit.widget.opengl.OpenGLWidget

Bases: Widget

OpenGLWidget: A simple omni.ui.Widget that will draw OpenGL content.
kwargs:

initialize_gl: Callable[uint, uint, bool] draw_gl: Callable[uint, uint] … additional kwargs for omni.ui.Widget

call_draw_gl_fn(self: omni.kit.widget.opengl._opengl_widget.OpenGLWidget, arg0: int, arg1: int) None
Set the function that will be called to render OpenGL content.
def on_draw_gl(viewport_width: :int, viewport_height: int)
arguments:

viewport_width (int) The current width to use to fill the omni.ui.OpenGLWidget with OpenGL content. viewport_height (int) The current height to use to fill the omni.ui.OpenGLWidget with OpenGL content.

call_initialize_gl_fn(self: omni.kit.widget.opengl._opengl_widget.OpenGLWidget, arg0: int, arg1: int, arg2: bool) None
Set the function that will be called when the OpenGL render target is created or resized.
def on_initialize_gl(viewport_width: :int, viewport_height: int)
arguments:

viewport_width (int) The current width to use to fill the omni.ui.OpenGLWidget with OpenGL content. viewport_height (int) The current height to use to fill the omni.ui.OpenGLWidget with OpenGL content. context_init (bool): Whether or not this is the first initialization of the OpenGL context.

property color_format
property depth_format
enable_rendering(self: omni.kit.widget.opengl._opengl_widget.OpenGLWidget, arg0: bool) bool
Enable or disble any OpenGL rendering occuring for the OpenGLWidget.
arguments:

enable (bool): Whether to enable or disable the OpenGL rendering completely.

get_current_textures(self: omni.kit.widget.opengl._opengl_widget.OpenGLWidget, color: bool = True, depth: bool = True) Dict[str, omni::ui::OpenGLTextureHandle]
has_draw_gl_fn(self: omni.kit.widget.opengl._opengl_widget.OpenGLWidget) bool
Set the function that will be called to render OpenGL content.
def on_draw_gl(viewport_width: :int, viewport_height: int)
arguments:

viewport_width (int) The current width to use to fill the omni.ui.OpenGLWidget with OpenGL content. viewport_height (int) The current height to use to fill the omni.ui.OpenGLWidget with OpenGL content.

has_initialize_gl_fn(self: omni.kit.widget.opengl._opengl_widget.OpenGLWidget) bool
Set the function that will be called when the OpenGL render target is created or resized.
def on_initialize_gl(viewport_width: :int, viewport_height: int)
arguments:

viewport_width (int) The current width to use to fill the omni.ui.OpenGLWidget with OpenGL content. viewport_height (int) The current height to use to fill the omni.ui.OpenGLWidget with OpenGL content. context_init (bool): Whether or not this is the first initialization of the OpenGL context.

import_texture(self: omni.kit.widget.opengl._opengl_widget.OpenGLWidget, arg0: omni.gpu_foundation_factory._gpu_foundation_factory.RpResource) omni::ui::OpenGLTextureHandle
set_draw_gl_fn(self: omni.kit.widget.opengl._opengl_widget.OpenGLWidget, fn: Callable[[int, int], None]) None
Set the function that will be called to render OpenGL content.
def on_draw_gl(viewport_width: :int, viewport_height: int)
arguments:

viewport_width (int) The current width to use to fill the omni.ui.OpenGLWidget with OpenGL content. viewport_height (int) The current height to use to fill the omni.ui.OpenGLWidget with OpenGL content.

set_initialize_gl_fn(self: omni.kit.widget.opengl._opengl_widget.OpenGLWidget, fn: Callable[[int, int, bool], None]) None
Set the function that will be called when the OpenGL render target is created or resized.
def on_initialize_gl(viewport_width: :int, viewport_height: int)
arguments:

viewport_width (int) The current width to use to fill the omni.ui.OpenGLWidget with OpenGL content. viewport_height (int) The current height to use to fill the omni.ui.OpenGLWidget with OpenGL content. context_init (bool): Whether or not this is the first initialization of the OpenGL context.

texture_blit(self: omni.kit.widget.opengl._opengl_widget.OpenGLWidget, color: int = 0, depth: int = 0, scale: carb._carb.Float3 = carb.Float3(1, 1, 1)) None