KhronosGroup / KhronosGroup/OpenCOLLADA

Effect names with embedded spaces treated inconsistently

Open
#501 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C++
Stars
678
Forks
260
PR merge metrics
No merged PRs in 30d

Description

In the process of tracking down a bug in a tool of mine I've discovered that the OpenCOLLADA SAX parser treats the id of an effect and the url of an instantiated effect differently. The id of an effect is preserved exactly, while the url of the instantiated effect is truncated at the first space.

For example, in this model an effect "dbl_Plate 08_001-fx" is defined and later used in a material "dbl_Plate 08_001". If you trace through the code, you find that when the material is parsed the url of the instantiated effect is truncated to "#dbl_Plate" by the use of GeneratedSaxParser::Utils::toURI, which calls Utils::toStringListItem, which truncates the string at the first whitespace character. By contrast, when the effect is parsed the given id is simply stored.

This inconsistency causes the UniqueId calculated for the effect and for its instantiation to be different, and downstream code fails looking up the effect.

I suspect this is a known issue of some sort, given the following comment in toUri:

    //FIXME: Testing fails on windows but pass on OSX with this fix.
    //Just get the string as it is for ids, so that we are able to read FBX-COLLADA
    //Otherwise, calling toStringItem would result in a truncated string when an id contains spaces
    //return COLLADABU::URI((const char*)*buffer);

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in GeneratedSaxParser::Utils::toURI and follow its call to Utils::toStringListItem, then compare how effect ids and instantiated-effect URLs are stored. Reproduce the behavior with the linked BMW-COLLADA model and verify that ids containing spaces are preserved consistently, producing matching UniqueId values and allowing the downstream effect lookup to succeed.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
computer-graphics
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.