OGRE 14.3
Object-Oriented Graphics Rendering Engine
Loading...
Searching...
No Matches

Convenience functions for python. More...

Functions

 Python.Numpy.AsDataStream (arr)
 copy numpy array to Ogre.MemoryDataStream that can be used in Ogre
 
 Python.HighPy.camera_intrinsics (str window_name, K, imsize)
 set camera intrinsics
 
 Python.HighPy.imshow (str window_name, str|os.PathLike img_path)
 show an image in the window
 
 Python.HighPy.mesh_hide (str window_name, str|os.PathLike mesh_path)
 hide a mesh in the window
 
 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
 
 Python.HighPy.point_light (str window_name, position=(0, 0, 0))
 create a point light in the window
 
 Python.Numpy.view (o)
 writable numpy view to the ogre data types
 
 Python.HighPy.window_compositor (str window_name, str compositor_name)
 set a compositor for the window
 
 Python.HighPy.window_create (str window_name, window_size, int flags=AXES_ZBACKWARD_YUP)
 create a window
 
int Python.HighPy.window_draw (str window_name)
 draw the window
 
 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
 
 Python.HighPy.window_use_imgui (str window_name, callback)
 enable imgui for the window
 

Variables

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

Detailed Description

Convenience functions for python.

Function Documentation

◆ AsDataStream()

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()

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()

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()

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()

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()

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()

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()

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()

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()

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()

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 "."