<viz>.add

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

 

<viz>.add(
    what    
    [option1]    
    [option2]    

)

 

what

A file to be loaded or a keyword specifying what built-in primitive to create.


[option1]

Depends on resource type. See table below.


[option2]

Depends on resource type. See table below.

Target types Option 1 Option 2
3D models viz.WORLD, viz.HEAD, viz.SCREEN Scene number

Animation path

n/a

n/a

Avatars

viz.WORLD, viz.HEAD, viz.SCREEN

Scene number

Bitmaps

viz.TEX_2D, viz.TEX_1D, viz.TEX_3D, viz.TEX_CUBE, viz.TEX_RECT

n/a

Button

Scene number

n/a

Checkbox

Scene number

n/a

Controlpoint

n/a

n/a

Draw Custom

[command, message, x, y, z, q], [parent], [scene]

n/a

Dynamic Texture

[command, message, x, y, z, q]

n/a

Environment Map

base file (e.g., _posx, _posy, etc. added automatically)

n/a

Face / Morph

viz.WORLD, viz.HEAD, viz.SCREEN

Scene number

Fragment Program

n/a

n/a

Group

viz.WORLD, viz.HEAD, viz.SCREEN

Scene number

Light

viz.WORLD, viz.HEAD, viz.SCREEN

Scene number

Modifier

n/a

n/a

Movies

n/a

n/a

Network

Computer name

n/a

Scene

n/a

n/a

Sensor device

n/a

n/a

Slider

Scene number

n/a

Radio

Group number

n/a

Texture Quad

viz.WORLD, viz.HEAD, viz.SCREEN

Scene number

Text3D

initial message, viz.WORLD, viz.HEAD, viz.SCREEN

Scene number

Vertex Program

n/a

n/a

Viewpoint

n/a

n/a

Window

n/a

n/a


Remarks

This is a general command to add any of several kinds of objects. For instance, this is the primary script based method to add file resources such as 3D models, textures, sounds, etc.

Return Value

Target types Returned object File suffixes or keyword
3D models node3d 'WRL', 'OSG', '3DS', 'OBJ', 'FLT', 'TXP', 'GEO', 'BSP', 'MD2', 'AC', 'LWO', 'PFB'

Animation path

animationpath

internal only (viz.ANIMATION_PATH)

Avatars

node3d:avatar

.CFG (CharacterStudio -> Cal3D export)

Bitmaps

multimedia:image

'JPG', 'BMP', 'TIF', 'GIF', 'PNG', 'RGB', 'RGBA', 'DDS', 'PIC'

Button

node2d:button

internal only (viz.BUTTON)

Checkbox

node2d:button

internal only (viz.CHECKBOX)

Controlpoint

controlpoint

internal only (viz.CONTROL_POINT)

Draw Custom

node3d:custom

'DLC'

Dynamic Texture

plugin:imagegen

'DLT'

Environment Map

multimedia:image

internal only (viz.ENVIRONMENT_MAP)

Face / Morph

node3d:face

'VZF'

Fragment Program

fragmentprogram

'FP'

Group

node3d

internal only (viz.GROUP)

Light

light

internal only (viz.LIGHT)

Modifier

plugin

'DLM'

Movies

multimedia:avi

'AVI', 'MPG', 'MPEG'

Network

network

internal only (viz.NETWORK)

Scene

scene

internal only (viz.SCENE)

Sensor device

plugin:sensor

'DLS'

Slider

node2d:slider

internal only (viz.SLIDER)

Radio

node2d:button

internal only (viz.RADIO)

Texture Quad

node3d

internal only (viz.TEXQUAD)

Text3D

node3d:text3d

internal only (viz.TEXT3D)

Vertex Program

vertexprogram

'VP'

Viewpoint

viewpoint

internal only (viz.VIEWPOINT)

Window

window

internal only (viz.WINDOW)

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