Commit c7538a7
committed
LinkedScene : Fix incorrect
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.linkLocations attribute value1 parent 43d779d commit c7538a7
File tree
3 files changed
+25
-3
lines changed- src/IECoreScene
- test/IECoreScene
3 files changed
+25
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
4 | 10 | | |
5 | 11 | | |
6 | 12 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
700 | 700 | | |
701 | 701 | | |
702 | 702 | | |
| 703 | + | |
703 | 704 | | |
704 | 705 | | |
705 | 706 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1094 | 1094 | | |
1095 | 1095 | | |
1096 | 1096 | | |
| 1097 | + | |
1097 | 1098 | | |
1098 | 1099 | | |
1099 | 1100 | | |
1100 | 1101 | | |
| 1102 | + | |
| 1103 | + | |
| 1104 | + | |
| 1105 | + | |
| 1106 | + | |
1101 | 1107 | | |
1102 | 1108 | | |
1103 | 1109 | | |
1104 | 1110 | | |
1105 | 1111 | | |
1106 | 1112 | | |
| 1113 | + | |
| 1114 | + | |
| 1115 | + | |
| 1116 | + | |
| 1117 | + | |
| 1118 | + | |
| 1119 | + | |
| 1120 | + | |
1107 | 1121 | | |
| 1122 | + | |
1108 | 1123 | | |
1109 | | - | |
| 1124 | + | |
1110 | 1125 | | |
1111 | 1126 | | |
1112 | 1127 | | |
1113 | 1128 | | |
1114 | 1129 | | |
1115 | | - | |
1116 | | - | |
| 1130 | + | |
| 1131 | + | |
1117 | 1132 | | |
1118 | 1133 | | |
1119 | 1134 | | |
| |||
0 commit comments