<viz>.addChildFromBuffer

Load a model file from a memory buffer

 

<viz>.addChildFromBuffer(
    filename    
    buffer    
    parent = viz.WORLD    
    scene = viz.MainScene    
    rotate = viz.AUTO_COMPUTE    

)

 

filename

Filename associated with the buffer. The extension of the filename will tell Vizard what model format the buffer provides (ive, osg, etc..)


buffer

Buffer containing the model file data or one of the following buffer flags:

Buffer flags

viz.BUFFER_MMAP

Load buffer through a memory mapped file. This can be used in cluster mode to have the master transfer the file contents to the clients at runtime.


parent = viz.WORLD

viz.WORLD
viz.SCREEN
viz.HEAD
viz.ORTHO
<node3d> object


scene = viz.MainScene

If the parent is viz.WORLD, viz.SCREEN, or viz.HEAD, then the argument represents the scene to add the object to.
If the parent is viz.ORTHO, then the argument represents the window to add the object to.
If the parent is a valid node3d object, then the argument is ignored.


rotate = viz.AUTO_COMPUTE

Specifies which coordinate frame to rotate the model from. Can be one of the following values:

Rotate mode

viz.AUTO_COMPUTE

Automatically detect the coordinate frame based on the file type.

viz.ROTATE_NONE

Do not rotate the model.

viz.ROTATE_Y_UP

Rotate the model from a Y-up coordinate frame.

viz.ROTATE_Z_UP

Rotate the model from a Z-up coordinate frame.


Remarks

This command will load a model using data from memory, instead of a file. The filename must contain the same extension as the format the buffer represents.

NOTE: Currently only .ive and .osg files can be loaded from a memory buffer.

Return Value

<node3d> object