Main Content

vrworld/addexternproto

(To be removed) Add externproto declaration to virtual world

vrworld/addexternproto will be removed in a future release. For more information, see Version History.

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

Version History

Introduced in R2008b

collapse all

R2023b: To be removed

The vrworld/addexternproto will be removed in a future release. Instead, use sim3d classes and Simulation 3D blocks to interface MATLAB® and Simulink® with the Unreal Engine® 3D simulation environment. To get started, see Create 3D Simulations in Unreal Engine Environment.