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

Restore backwards-compatible logic paths in KHR_texture_transform #16115

Merged
merged 1 commit into from
Jan 27, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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