[x3d-public] Possible issue with X3DV4 schema. X3dForAdvancedModeling/AudioSpatialSound .x3d files fail validation. Two Material Appearances

John Carlson yottzumm at gmail.com
Thu Apr 15 23:17:49 PDT 2021


Traceback:

Found the following error with my ~/x3dschema JSON parse test, done by 
running `base validate.sh`, results in javaresults.txt, which is 
filtered (also need to filter "node_modules") here: 
https://github.com/coderextreme/x3dschema/blob/master/jsonparseresults.txt 
Cleaned up results here:

json-parse json Expected a ':' after a key at 196859 [character 37 line 
216] 
x3d/content/examples/X3dForAdvancedModeling/AudioSpatialSound/SingleAudio.json
json-parse json Expected a ':' after a key at 7359 [character 31 line 
198] 
x3d/content/examples/X3dForAdvancedModeling/AudioSpatialSound/SplitChannels.json
json-parse json Expected a ':' after a key at 287624 [character 37 line 
270] 
x3d/content/examples/X3dForAdvancedModeling/AudioSpatialSound/SpatialAudioCameraAnimation.json


Note that there are two Material objects in SplitChannels.json, so 
-material should probably be an array.   Will check XML.

SplitChannels.x3d excerpt:

       <Transform DEF='volumeRight' rotation='1 0 0 -0.5' scale='10 10 
10' translation='0 -10 0'>
         <Shape>
           <Appearance>
             <Material diffuseColor='0.345 0.345 0.882' transparency='0'/>
             <Material ambientIntensity='0.0933' diffuseColor='1 1 1' 
emissiveColor='0 0 0' shininess='0.51' specularColor='0.46 0.46 0.46'/>
           </Appearance>
           <Text solid='false' string='Right Channel Volume'>
             <FontStyle family=''Times'' horizontal='true' 
justify='BEGIN' leftToRight='true' size='1' spacing='1' style='BOLD' 
topToBottom='true'/>
           </Text>
         </Shape>
       </Transform>


The following will show the two Material Appearances in all three .x3d 
files.

x3d/content/examples/X3dForAdvancedModeling/AudioSpatialSound$ egrep 
'Appearance|Material' *.x3d

Will check for error/warning/development.  An allied file in same folder 
has a warning, but none in these .x3d files that I can tell.

Will check web. 
https://x3dgraphics.com/examples/X3dForAdvancedModeling/AudioSpatialSound/SplitChannelsIndex.html 
looks like above.


Will check X3DV4 schema:

<xs:element name="Appearance">
         <xs:annotation>
             <xs:appinfo>
                 [snip]
                 <xs:element name="material" type="SFNode" 
fixed="inputOutputField" default="X3DMaterialNode"/>

I'm reading this that there shouldn't be more that one Material, 
otherwise, material would be an MFNode.

Running the XML files through X3D validator:   All three .x3d files fail

Don't forget to validate before checking in.  I'm aware these files are 
under development. My best guess is we'll have to wait for a new copy of 
the X3D validator and schema?

If we make -material an array, this will be a pretty significant change, 
basically affecting practically everything.  It's easy for XML, and we 
haven't defined X3D JSON in a standard, but in the future, I recommend 
changing SFNode to MFNode with care.

jsonlint errors follow:

SingleAudio.json
Error: Parse error on line 207:
...                    { "Material":
-----------------------^
Expecting 'STRING', got '{'
     at Object.parseError 
(/usr/local/lib/node_modules/jsonlint/lib/jsonlint.js:55:11)
     at Object.parse 
(/usr/local/lib/node_modules/jsonlint/lib/jsonlint.js:132:22)
     at parse (/usr/local/lib/node_modules/jsonlint/lib/cli.js:82:14)
     at main (/usr/local/lib/node_modules/jsonlint/lib/cli.js:135:14)
     at Object.<anonymous> 
(/usr/local/lib/node_modules/jsonlint/lib/cli.js:179:1)
     at Module._compile (internal/modules/cjs/loader.js:1138:30)
     at Object.Module._extensions..js 
(internal/modules/cjs/loader.js:1158:10)
     at Module.load (internal/modules/cjs/loader.js:986:32)
     at Function.Module._load (internal/modules/cjs/loader.js:879:14)
     at Function.executeUserEntryPoint [as runMain] 
(internal/modules/run_main.js:71:12)
SpatialAudioCameraAnimation.json
Error: Parse error on line 261:
...                    { "Material":
-----------------------^
Expecting 'STRING', got '{'
     at Object.parseError 
(/usr/local/lib/node_modules/jsonlint/lib/jsonlint.js:55:11)
     at Object.parse 
(/usr/local/lib/node_modules/jsonlint/lib/jsonlint.js:132:22)
     at parse (/usr/local/lib/node_modules/jsonlint/lib/cli.js:82:14)
     at main (/usr/local/lib/node_modules/jsonlint/lib/cli.js:135:14)
     at Object.<anonymous> 
(/usr/local/lib/node_modules/jsonlint/lib/cli.js:179:1)
     at Module._compile (internal/modules/cjs/loader.js:1138:30)
     at Object.Module._extensions..js 
(internal/modules/cjs/loader.js:1158:10)
     at Module.load (internal/modules/cjs/loader.js:986:32)
     at Function.Module._load (internal/modules/cjs/loader.js:879:14)
     at Function.executeUserEntryPoint [as runMain] 
(internal/modules/run_main.js:71:12)
SplitChannels.json
Error: Parse error on line 189:
...                    { "Material":
-----------------------^
Expecting 'STRING', got '{'
     at Object.parseError 
(/usr/local/lib/node_modules/jsonlint/lib/jsonlint.js:55:11)
     at Object.parse 
(/usr/local/lib/node_modules/jsonlint/lib/jsonlint.js:132:22)
     at parse (/usr/local/lib/node_modules/jsonlint/lib/cli.js:82:14)
     at main (/usr/local/lib/node_modules/jsonlint/lib/cli.js:135:14)
     at Object.<anonymous> 
(/usr/local/lib/node_modules/jsonlint/lib/cli.js:179:1)
     at Module._compile (internal/modules/cjs/loader.js:1138:30)
     at Object.Module._extensions..js 
(internal/modules/cjs/loader.js:1158:10)
     at Module.load (internal/modules/cjs/loader.js:986:32)
     at Function.Module._load (internal/modules/cjs/loader.js:879:14)
     at Function.executeUserEntryPoint [as runMain] 
(internal/modules/run_main.js:71:12)




More information about the x3d-public mailing list