Vizard 7 » Command Index » Vizard modules » viz » <viz>.add
7.7

<viz>.add

Add any of a number of different file or built-in resources to your world.

<viz>.add(  
what  
*args  
**kw  
)  
what
The filename of the object to be loaded
*args
Positional arguements to pass to function
**kw
Keyword arguments to pass to function

Remarks

This is a convenience function that will automatically call the necessary function based on the specified file type. See the table below for the list of file types and the associated object that will be returned.

Return Value

Object Type

Command

File Extension

Node

<viz>.addChild

WRL, 3DS, OBJ, GEO, GEM, FLT, OSG, IV, IVE, LW, LWO, LWS, 3DC, PLY, P3D, OGR, SHP, STL, TGZ, AC, MDL, PFB, TXP, DXF, DW, BSP, OSGX, X, DAE, FBX, OSGT, OSGB

Avatar

<viz>.addAvatar

CFG

Texture

<viz>.addTexture

JPG, JPEG, BMP, TIF, TIFF, GIF, PNG, RGB, RGBA, TGA, DDS, PIC, BMX, PNM, PPM, PGM, PBM, PVR, VTF, KTX, WEBP

Audio

<viz>.addAudio

WAV, MP3, MID, MIDI, AU, WMA

Video

<viz>.addVideo

AVI, MPG, MPEG, WMV, MOV, ASF

Extension

<viz>.addExtension

DLE

Example

# Add a 3D object (VRML file)
ball = viz.add('myball.wrl')

# Add a AVI movie file
movie = viz.add('mymovie.avi')

# Add a male avatar
guy = viz.add('vcc_male.cfg')