<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE X3D PUBLIC "ISO//Web3D//DTD X3D 3.0//EN" "https://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='https://www.web3d.org/specifications/x3d-3.0.xsd'>
  <head>
    <meta content='BradenPrototypeInitializeExample.x3d' name='title'/>
    <meta content='Don Brutzman' name='creator'/>
    <meta content='5 March 2000' name='created'/>
    <meta content='20 October 2019' name='modified'/>
    <meta content='Default color red, overridden color green: example answer to email question showing how to initialize a node field when creating a ProtoInstance.' name='description'/>
    <meta content='https://www.web3d.org/WorkingGroups/x3d-contributors/hypermail/2000/0487.html' name='reference'/>
    <meta content='https://www.web3d.org/x3d/content/examples/Basic/development/BradenPrototypeInitializeExample.x3d' name='identifier'/>
    <meta content='X3D-Edit 3.3, https://www.web3d.org/x3d/tools/X3D-Edit' name='generator'/>
    <meta content='../license.html' name='license'/>
  </head>
  <Scene>
    <WorldInfo title='BradenPrototypeInitializeExample.x3d'/>
    <ProtoDeclare name='Foo'>
      <ProtoInterface>
        <field accessType='inputOutput' name='runtimeMaterialInstance' type='SFNode'>
          <Material diffuseColor='1 0 0'/>
        </field>
      </ProtoInterface>
      <ProtoBody>
        <Shape>
          <Appearance DEF='FOO_APPEARANCE'>
            <IS>
              <connect nodeField='material' protoField='runtimeMaterialInstance'/>
            </IS>
          </Appearance>
          <Sphere/>
        </Shape>
      </ProtoBody>
    </ProtoDeclare>
    <ProtoInstance name='Foo'>
      <fieldValue name='runtimeMaterialInstance'>
        <Material diffuseColor='0 1 0'/>
      </fieldValue>
    </ProtoInstance>
  </Scene>
</X3D>