Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create better error description if field is access type InputOnly in a PROTO #98

Open
coderextreme opened this issue Jul 10, 2024 · 1 comment

Comments

@coderextreme
Copy link

coderextreme commented Jul 10, 2024

Working example below. Try changing the accessType of the PROTO fields to inputOnly and see the warnings:

castle-model-converter: Warning: X3D: X3D XML: element references unknown field name "desc"
castle-model-converter: Warning: X3D: X3D XML: element references unknown field name "str"

A better warning might suggest a change to the accessType to inputOutput, or perhaps suggest making the field visible to the outside of the ProtoDeclare by changing accessType.

IDK, I figured it out. Now to see if the PROTO does something.

<!DOCTYPE X3D PUBLIC "ISO//Web3D//DTD X3D 4.0//EN" "https://www.web3d.org/specifications/x3d-4.0.dtd">
<X3D profile='Immersive' version='4.0' xmlns:xsd='http://www.w3.org/2001/XMLSchema-instance' xsd:noNamespaceSchemaLocation='https://www.web3d.org/specifications/x3d-4.0.xsd'>
  <head>
    <component name='HAnim' level='1'/>
    <meta content='billboardPROTO.x3d' name='title'/>
    <meta name='identifier' content='file://C:/Users/john/jaminate/Jaminate/app/billboardPROTO.x3d'/>
    <meta name='description' content='A partial humanoid, with a PROTO at an HAnimSite'/>
    <meta name='generator' content='Jaminate, Just Humans'/>
  </head>
  <Scene>
    <ProtoDeclare name='TouchAndBillboard'>
      <ProtoInterface>
        <field name='str' accessType='inputOutput' type='MFString' value='"-1"'/>
        <field name='desc' accessType='inputOutput' type='SFString' value='HAnim Feature Point Description'/>
      </ProtoInterface>
      <ProtoBody>
        <Transform>
          <TouchSensor>
            <IS>
              <connect nodeField='description' protoField='desc'/>
            </IS>
          </TouchSensor>
          <Billboard>
            <Shape>
              <Text>
                <IS>
                  <connect nodeField='string' protoField='str'/>
                </IS>
              </Text>
            </Shape>
          </Billboard>
        </Transform>
      </ProtoBody>
    </ProtoDeclare>
    <HAnimHumanoid DEF='hanim_humanoid' name='humanoid' loa='4' version='2.0'>
      <HAnimJoint DEF='hanim_humanoid_root' name='humanoid_root' containerField='skeleton' center='0 0.77 0'>
        <HAnimJoint DEF='hanim_sacroiliac' name='sacroiliac' center='0 0.826 0.02'>
          <HAnimSegment DEF='hanim_pelvis' name='pelvis'>
            <HAnimSite DEF='hanim_l_iliocristale_pt' name='l_iliocristale' translation='0.13 0.92 0.0035'>
              <ProtoInstance name='TouchAndBillboard'>
                <fieldValue name='desc' value='HAnimSite 33 hanim_l_iliocristale_pt'/>
                <fieldValue name='str' value='"33"'/>
              </ProtoInstance>
            </HAnimSite>
	  </HAnimSegment>
        </HAnimJoint>
      </HAnimJoint>
      <HAnimJoint USE='hanim_humanoid_root' containerField='joints'/>
      <HAnimJoint USE='hanim_sacroiliac' containerField='joints'/>
    </HAnimHumanoid>
  </Scene>
</X3D>
@coderextreme
Copy link
Author

Success. See pictures on discord under x3d channel

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant