OGRE  14.3
Object-Oriented Graphics Rendering Engine

Convenience functions for python. More...

Functions

def Python.Numpy.AsDataStream (arr)
 copy numpy array to Ogre.MemoryDataStream that can be used in Ogre More...
 
def Python.HighPy.camera_intrinsics (str window_name, K, imsize)
 set camera intrinsics More...
 
def Python.HighPy.imshow (str window_name, str|os.PathLike img_path)
 show an image in the window More...
 
def Python.HighPy.mesh_hide (str window_name, str|os.PathLike mesh_path)
 hide a mesh in the window More...
 
def Python.HighPy.mesh_show (str window_name, str|os.PathLike mesh_path, rot_mat=None, position=(0, 0, 0), str|None material_name=None)
 show a mesh in the window More...
 
def Python.HighPy.point_light (str window_name, position=(0, 0, 0))
 create a point light in the window More...
 
def Python.Numpy.view (o)
 writable numpy view to the ogre data types More...
 
def Python.HighPy.window_compositor (str window_name, str compositor_name)
 set a compositor for the window More...
 
def Python.HighPy.window_create (str window_name, window_size, int flags=AXES_ZBACKWARD_YUP)
 create a window More...
 
int Python.HighPy.window_draw (str window_name)
 draw the window More...
 
def Python.HighPy.window_pixel_data (str window_name, str|None compositor_name=None, str|None texture_name=None, int mrt_index=0)
 get the pixel data from the window or the active compositor More...
 
def Python.HighPy.window_use_imgui (str window_name, callback)
 enable imgui for the window More...
 

Variables

int Python.HighPy.AXES_ZBACKWARD_YUP = 0
 Ogre & OpenGL coordinate system More...
 
int Python.HighPy.AXES_ZFORWARD_YDOWN = 1
 OpenCV & colmap coordinate system. More...
 
 Python.HighPy.user_resource_locations = set()
 add paths here to override the default resource location "." More...
 

Detailed Description

Convenience functions for python.

Function Documentation

◆ AsDataStream()

def Python.Numpy.AsDataStream (   arr)

copy numpy array to Ogre.MemoryDataStream that can be used in Ogre

Parameters
arrsome numpy array

References Python.Numpy.view().

◆ view()

def Python.Numpy.view (   o)

writable numpy view to the ogre data types

take care that the ogre type does not get released while the view is used. e.g. this is invalid

return Ogre.Numpy.view(v)

instead do

return Ogre.Numpy.view(v).copy()

to pass numpy arrays into Ogre use AsDataStream()

References Ogre::PixelUtil.getNumElemBytes().

Referenced by Python.Numpy.AsDataStream().

◆ window_create()

def Python.HighPy.window_create ( str  window_name,
  window_size,
int   flags = AXES_ZBACKWARD_YUP 
)

create a window

Parameters
window_namename of the window
window_sizesize of the window in pixels
flagswindow create options

◆ window_draw()

int Python.HighPy.window_draw ( str  window_name)

draw the window

Parameters
window_namename of the window
Returns
last key pressed inside the window

◆ window_use_imgui()

def Python.HighPy.window_use_imgui ( str  window_name,
  callback 
)

enable imgui for the window

Parameters
window_namename of the window
callbackfunction to call for imgui rendering

◆ window_compositor()

def Python.HighPy.window_compositor ( str  window_name,
str  compositor_name 
)

set a compositor for the window

Parameters
window_namename of the window
compositor_namename of the compositor

References Ogre::CompositorManager.getSingleton().

◆ window_pixel_data()

def Python.HighPy.window_pixel_data ( str  window_name,
str | None   compositor_name = None,
str | None   texture_name = None,
int   mrt_index = 0 
)

get the pixel data from the window or the active compositor

Parameters
window_namename of the window
compositor_namename of the compositor
texture_namename of the texture
mrt_indexindex of the MRT
Return values
0bytearray holding the pixel data
1tuple (bytes per pixel, height, width, channels)

References Ogre::CompositorManager.getSingleton().

◆ imshow()

def Python.HighPy.imshow ( str  window_name,
str | os.PathLike  img_path 
)

show an image in the window

Parameters
window_namename of the window
img_pathpath to the image file

◆ camera_intrinsics()

def Python.HighPy.camera_intrinsics ( str  window_name,
  K,
  imsize 
)

set camera intrinsics

Parameters
window_namename of the window
K3x3 camera matrix
imsizeimage size in pixels

◆ mesh_show()

def Python.HighPy.mesh_show ( str  window_name,
str | os.PathLike  mesh_path,
  rot_mat = None,
  position = (0, 0, 0),
str | None   material_name = None 
)

show a mesh in the window

Parameters
window_namename of the window
mesh_pathpath to the mesh file
rot_mat3x3 rotation matrix
position3x1 translation vector
material_nameoptional material name to use instead of the default

◆ mesh_hide()

def Python.HighPy.mesh_hide ( str  window_name,
str | os.PathLike  mesh_path 
)

hide a mesh in the window

Parameters
window_namename of the window
mesh_pathpath to the mesh file

◆ point_light()

def Python.HighPy.point_light ( str  window_name,
  position = (0, 0, 0) 
)

create a point light in the window

Parameters
window_namename of the window
positionposition of the light in world coordinates

Variable Documentation

◆ AXES_ZBACKWARD_YUP

int Python.HighPy.AXES_ZBACKWARD_YUP = 0

Ogre & OpenGL coordinate system

◆ AXES_ZFORWARD_YDOWN

int Python.HighPy.AXES_ZFORWARD_YDOWN = 1

OpenCV & colmap coordinate system.

◆ user_resource_locations

Python.HighPy.user_resource_locations = set()

add paths here to override the default resource location "."