LinkedScene : Fix incorrect linkLocations
attribute value
#1378
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The old code was incorrectly appending the target's location to the
linkLocations
.The
linkLocations
are expected to hold the locations in the current LinkedScene that contain links to other files. These paths are expected to exist in the LinkedScene itself.Everything worked fine if the target location was set to the ROOT, but if it was targeting an internal location, that would be appended which would result in an invalid path.
The cause for that bug was that we were updating
m_linkedScene
, which is used to compute LinkedScene::path(), but not updating them_rootLinkDepth
property, which is also used to compute the path, by stripping out part of it based on the depth of the link.For
linkLocations
, that depth should generally be expected to completely remove any contributions fromm_linkedScene
, since this is the location where the link is being created, and therefore them_rootLinkDepth
will match the length of the path inside the target linked scene that we are linking to.Note that existing saved
lscc
files have the attribute baked in, and are therefore not fixed by this commit. A new export is necessary in order to fix it.Related Issues
Error messages complaining about non-existent children of a location when trying to call either
LinkedScene::setNames()
orLinkedScenes::readSet()
, if the links were targeting something other than the root of the target scene.Checklist