Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LinkedScene : Fix incorrect linkLocations attribute value #1378

Merged
merged 1 commit into from
Jul 21, 2023

Conversation

ivanimanishi
Copy link
Member

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 the m_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 from m_linkedScene, since this is the location where the link is being created, and therefore the m_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() or LinkedScenes::readSet(), if the links were targeting something other than the root of the target scene.

Checklist

  • I have read the contribution guidelines.
  • I have updated the documentation, if applicable.
  • I have tested my change(s) in the test suite, and added new test cases where necessary.
  • My code follows the Cortex project's prevailing coding style and conventions.

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 the
`m_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 from `m_linkedScene`, since this
is the location where the link is being created, and therefore the
`m_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.
@ivanimanishi ivanimanishi merged commit 45a3975 into ImageEngine:RB-10.4 Jul 21, 2023
3 of 4 checks passed
@ivanimanishi ivanimanishi deleted the linkLocationsFix branch July 21, 2023 16:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant