create3000 / x_ite

X_ITE X3D Browser, view and manipulate X3D and VRML scenes in HTML.
https://create3000.github.io/x_ite/
Other
66 stars 13 forks source link

"aspectRatio" not supported? #162

Closed davidhedley closed 6 months ago

davidhedley commented 6 months ago

Trying to view some specific third party WRL models, x_ite-9.1.10 fails with:

    aspectRatio 0
                   ^
Unknown field 'aspectRatio' in class 'Panel'.

Can this property be supported or ignored?

create3000 commented 6 months ago

It seems you have a .wrl file with some nodes and a node of type Panel, which is probably a PROTO, and this node has a field aspectRatio.

Due to the nature of the VRML encoding you use, it is not possible, nor to skip this field. This feature is first possible with X3D XML encoding. You should remove this field(s), or comment out, then your files should be possible to be loaded.

davidhedley commented 6 months ago

Thanks for your response. So you are saying is it not possible to just warn on unknown fields and continue the parse? This is a snippet of the VRML:

  DEF SafeAreaFrame Switch 
   {
    choice 
    [ 
     DEF FrameGroup Group 
     {
      children 
      [ 
       DEF FP1 Panel 
       {
        source HTMLText 
        {
         body ""
         padding []
         shadow FALSE
         shadowTransparency 0
         shadowSize 8
         shadowOffset 3
         shadowColor 0 0 0
        }
        top "0"
        left "0"
        right ""
        bottom ""
        width "1"
        height "1"
        offsetLeft ""
        offsetTop ""
        aspectRatio 0
        sticky FALSE
        enabled FALSE
        backgroundTransparency 1
        backgroundColor 1 1 1
        borderSize 1
        borderRadius "0"
        borderColor 1 0 0
       }

If necessary I could preprocess the file to remove the offending line but I wasn't sure if this was something in the VRML standard that you might want to support?

davidhedley commented 6 months ago

On closer inspection there is a reference further up in the WRL to: ["urn:inet:parallelgraphics.com:cortona:Panel" "http://www.parallelgraphics.com/vrml/proto/Cortona/extensions.wrl#Panel"] I can see this is failing to load as part of the parse (CORS issues) which I assume is leading to the error shown above.

Thanks for your speedy response - looks like I need to fix this elsewhere.

create3000 commented 6 months ago

Think we can have it with next version, ie. unknown nodes and fields will be ignored during parse, but there will be at least a warning, that there was something unknown.