Skip to content

Import a 3D Model and automatically assign and export animations

TypeScript

to to actually show build version now on UI

Scott Petrovic0c9e28825e9a
diff --git a/src/Mesh2MotionEngine.ts b/src/Mesh2MotionEngine.ts
index 521482b..3a01d05 100644
--- a/src/Mesh2MotionEngine.ts
+++ b/src/Mesh2MotionEngine.ts
@@ -22,7 +22,6 @@ import { ProcessStep } from './lib/enums/ProcessStep.ts'
import { type Bone, Group, Scene, type Skeleton, type Vector3 } from 'three'
import type BoneTesterData from './lib/interfaces/BoneTesterData.ts'
-import { build_version } from './environment.js'
import { SkeletonType } from './lib/enums/SkeletonType.ts'
import { CustomSkeletonHelper } from './lib/CustomSkeletonHelper.ts'
@@ -100,9 +99,11 @@ export class Mesh2MotionEngine {
tippy('[data-tippy-content]', { theme: 'mesh2motion' })
}
+ // for the release, let's just show the first 7 characters of the commit SHA
+ // then the branch we used to build. This comes from Cloudflare build process
private inject_build_version (): void {
if (this.ui.dom_build_version !== null) {
- this.ui.dom_build_version.innerHTML = build_version
+ this.ui.dom_build_version.innerHTML = `${window.CLOUDFLARE_COMMIT_SHA.slice(0, 6)}-(${window.CLOUDFLARE_BRANCH})`
} else {
console.warn('Build version DOM element is null. Cannot set number')
}
diff --git a/src/environment.js b/src/environment.js
index 62b5390..38a98ff 100644
--- a/src/environment.js
+++ b/src/environment.js
@@ -1,7 +1,4 @@
-export const build_version = '0.0.0'
-
// grab a couple environment variables from Clourflare build process
// Vite actually does the injection, so look at vite.config.js with the "define" block
window.CLOUDFLARE_COMMIT_SHA = PROCESS_ENV.WORKERS_CI_COMMIT_SHA
window.CLOUDFLARE_BRANCH = PROCESS_ENV.WORKERS_CI_BRANCH || 'unknown'
-