<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE X3D PUBLIC "ISO//Web3D//DTD X3D 3.0//EN" "http://www.web3d.org/specifications/x3d-3.0.dtd">
<X3D profile='Immersive' version='3.0 xmlns:xsd='http://www.w3.org/2001/XMLSchema-instance' xsd:noNamespaceSchemaLocation =' http://www.web3d.org/specifications/x3d-3.0.xsd '>
<head>
<meta name='titlecontent='TestProtoInterfaceNodeScope.x3d'/>
<meta name='descriptioncontent='Test override of color values in prototypes and scripts. Color code: red = left-most default prototype interface, yellow = middle ProtoInstance fieldValue, green = Script initialization of middle ProtoInstance, blue = right-side default prototype instance.'/>
<meta name='creatorcontent='Alan Hudson, Don Brutzman'/>
<meta name='translatorcontent=' Xeena VRML importer, X3D-Edit 3.1, http://www.web3d.org/x3d/content/README.X3D-Edit.html '/>
<meta name='createdcontent='4 January 2006'/>
<meta name='translatedcontent='5 January 2006'/>
<meta name='modifiedcontent='28 October 2014'/>
<meta name='rightscontent='Copyright (c) Web3D Consortium Inc. 2006'/>
<meta name='identifiercontent=' http://www.web3d.org/x3d/content/examples/Basic/development/TestProtoInterfaceNodeScope.x3d '/>
<meta name='generatorcontent='X3D-Edit 3.3, https://savage.nps.edu/X3D-Edit'/>
<meta name='generatorcontent='Vrml97ToX3dNist, http://ovrt.nist.gov/v2_x3d.html'/>
<meta name='licensecontent=' ../license.html'/>
</head>
<!--

Index for ProtoDeclare definition : MyProto

Index for DEF nodes : LeftTransform, MiddleTransform, P1, P2, P3, ProtoBox, RightTransform, SC
-->
<Scene>
<ProtoDeclare name='MyProto'>
<ProtoInterface>
<field name='materialtype='SFNodeaccessType='inputOutput'>
<Material diffuseColor='1 0 0'/>
</field>
</ProtoInterface>
<ProtoBody>
<Shape>
<Appearance>
<IS>
<connect nodeField='materialprotoField='material'/>
</IS>
</Appearance>
<Box DEF='ProtoBox'/>
</Shape>
</ProtoBody>
</ProtoDeclare>
<Transform DEF='LeftTransformtranslation='-2.5 0.0 0.0'>
<ProtoInstance name='MyProtoDEF='P1'/>
</Transform>
<Transform DEF='MiddleTransform'>
<ProtoInstance name='MyProtoDEF='P2'>
<fieldValue name='material'>
<Material diffuseColor='0.7 0.7 0'/>
</fieldValue>
</ProtoInstance>
<Script DEF='SCdirectOutput='true'>
<field name='proto1type='SFNodeaccessType='initializeOnly'>
<ProtoInstance USE='P2'/>
</field>
<![CDATA[
        
ecmascript:

function initialize() {
	Browser.print('Changing color on middle box to green');
	proto1.material.diffuseColor = new SFColor(0,1,0);
}

      
]]>
</Script>
</Transform>
<Transform DEF='RightTransformtranslation='2.5 0.0 0.0'>
<ProtoInstance name='MyProtoDEF='P3'>
<fieldValue name='material'>
<Material diffuseColor='0 0 1'/>
</fieldValue>
</ProtoInstance>
</Transform>
<Switch whichChoice='-1'>
<Shape>
<!-- To test protected scope of nodes DEF'ed inside a prototype body, add: <Box USE="ProtoBox"/> -->
</Shape>
</Switch>
</Scene>
</X3D>
<!--

Index for ProtoDeclare definition : MyProto

Index for DEF nodes : LeftTransform, MiddleTransform, P1, P2, P3, ProtoBox, RightTransform, SC
-->

<!-- Color key: <X3dNode DEF='idName' field='value'/> matches <XmlElement DEF='idName' attribute='value'/>
(Light blue background: behavior node) (Grey background: inserted documentation) (Magenta background: X3D Extensibility)
    <Prototype name='ProtoName'> <field name='fieldName'/> </Prototype> -->

<!-- Additional help information about X3D scenes: X3D Resources, X3D Scene Authoring Hints and X3D Tooltips -->