Skip to content

Commit

Permalink
Restore backwards-compatible logic paths (#16115)
Browse files Browse the repository at this point in the history
  • Loading branch information
alexchuber authored Jan 27, 2025
1 parent 13ac61f commit 0e23e9b
Showing 1 changed file with 6 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,7 @@ export class KHR_texture_transform implements IGLTFExporterExtensionV2 {
public postExportTexture?(context: string, textureInfo: ITextureInfo, babylonTexture: Texture): void {
const scene = babylonTexture.getScene();
if (!scene) {
Tools.Warn(`${context}: "scene" is not defined for Babylon texture ${babylonTexture.name}! Not exporting with ${NAME}.`);
return;
Tools.Warn(`${context}: "scene" is not defined for Babylon texture ${babylonTexture.name}!`);
}

/*
Expand All @@ -59,7 +58,11 @@ export class KHR_texture_transform implements IGLTFExporterExtensionV2 {
*/
if (babylonTexture.uAng !== 0 || babylonTexture.vAng !== 0) {
Tools.Warn(`${context}: Texture ${babylonTexture.name} with rotation in the u or v axis is not supported in glTF.`);
return;
// Usually, we'd always early return here if the texture uses an unsupported combination of transform properties,
// but we're making an exception here to maintain backwards compatibility.
if (babylonTexture.uRotationCenter !== 0 || babylonTexture.vRotationCenter !== 0) {
return;
}
}

const textureTransform: IKHRTextureTransform = {};
Expand Down

0 comments on commit 0e23e9b

Please sign in to comment.