Skip to content

Commit

Permalink
Preliminarily ignore missing BATCHID
Browse files Browse the repository at this point in the history
  • Loading branch information
javagl committed Aug 13, 2024
1 parent 38cf809 commit 445ffa9
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 7 deletions.
6 changes: 4 additions & 2 deletions src/tools/migration/TileFormatsMigrationB3dm.ts
Original file line number Diff line number Diff line change
Expand Up @@ -90,8 +90,10 @@ export class TileFormatsMigrationB3dm {
primitive,
batchIdToFeatureIdAccessor
);
if (propertyTable) {
featureId.setPropertyTable(propertyTable);
if (featureId) {
if (propertyTable) {
featureId.setPropertyTable(propertyTable);
}
}
}
}
Expand Down
13 changes: 8 additions & 5 deletions src/tools/migration/TileTableDataToMeshFeatures.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ export class TileTableDataToMeshFeatures {
* extension that is associated with this primitive, storing
* the former batch ID attribute as a new `_FEATURE_ID_0` attribute.
*
* Note that this will remove the former batch ID attributes
* Note that this will set the former batch ID attributes
* in the given primitive to `null`, but it will not dispose
* the corresponding accessors. These have to be disposed
* after all primitives have been processed.
Expand All @@ -42,7 +42,7 @@ export class TileTableDataToMeshFeatures {
document: Document,
primitive: Primitive,
batchIdToFeatureIdAccessor: Map<Accessor, Accessor>
): FeatureId {
): FeatureId | undefined {
let batchIdAttribute = primitive.getAttribute("_BATCHID");
if (!batchIdAttribute) {
batchIdAttribute = primitive.getAttribute("BATCHID");
Expand All @@ -52,9 +52,12 @@ export class TileTableDataToMeshFeatures {
"should be _BATCHID, starting with an underscore"
);
} else {
throw new TileFormatError(
"The primitive did not contain a _BATCHID attribute"
);
// XXX Preliminarily ignore this
//throw new TileFormatError(
// "The primitive did not contain a _BATCHID attribute"
//);
logger.warn("The primitive did not contain a _BATCHID attribute");
return undefined;
}
}

Expand Down

0 comments on commit 445ffa9

Please sign in to comment.