vrworld/addexternproto

Add externproto declaration to virtual world

Syntax

addexternproto(vrworld_object, protofile, protoname)
addexternproto(vrworld_object, protofile, protoname, protodef)

Arguments

vrworld_object

A vrworld object representing the virtual world.

protofile

String containing the name of the prototype file from which the EXTERNPROTO declaration is added.

protoname

String containing the name of the EXTERNPROTO declaration.

protodef

String containing a new name for the EXTERNPROTO declaration.

Description

addexternproto(vrworld_object, protofile, protoname) adds an EXTERNPROTO declaration from file protofile to the virtual world. The handle vrworld_object refers to the virtual world. The EXTERNPROTO declaration is identified as protoname. If protoname is a cell array of identifiers, the function adds multiple EXTERNPROTOs from one file to the virtual world.

addexternproto(vrworld_object, protofile, protoname, protodef) adds an EXTERNPROTO declaration from file protofile to the virtual world. The handle vrworld_object refers to the virtual world. The EXTERNPROTO declaration is identified as protoname. If protoname is a cell array of identifiers, the function adds multiple EXTERNPROTOs from one file to the virtual world. This command then renames the new EXTERNPROTO declaration to protodef.

In both cases, the EXTERNPROTO declaration becomes equivalent to the VRML PROTO declaration. In other words, protoname or protodef becomes an internal PROTO type in the virtual scene associated with vrworld_object. After you save the virtual world, these PROTO declarations no longer require a reference to the original file, protofile, that contains the EXTERNPROTO declarations.

Was this topic helpful?