SoSFBitMask doesn't read correctly from VRML files

Issue #143 closed
Thomas Moeller created an issue

I noticed that bit mask fields aren't read correctly from VRML files when multiple bits are given. The example file 'models\vrml1.0\properties\fontstyle.wrl' doesn't load.

The style field of FontStyle fails to parse (BOLD|ITALIC). The root cause is the different definition of what are valid characters in identifiers for IV and VRML. IV accepts only alphanumerical characters whereas VRML allows all characters except for a small list of excluded ones (see section 4.3.1. http://www.web3d.org/documents/specifications/19776-2/V3.0/Part02/concepts.html). So when loading from VRML the SoSFBitMask class gets "BOLD|ITALIC)" when expecting just "BOLD" and "ITALIC" in the next iteration (pipe and round brackets are valid parts of an identifier in VRML).

The easiest fix would be to include 0x28, 0x29 and 0x7c ('(', ')', '|') to the list of invalid VRML identifier characters in SoInputP.cpp. Coin already applies a similar fix and excludes the comma from the valid character list to address another loading issue.

//  In addition to this, we found ',' to be an invalid character in
//  VRML 1.0 names. This was made apparent when reading the following
//  fields on an unknown node:
//
//   fields [SFString test, SFFloat length]

I therefore suggest fixing this issue by adding round brackets and the pipe character to the invalid identifier character list on SoInputP.cpp.

Comments (1)

  1. Log in to comment