Import a 3D Model and automatically assign and export animations
TypeScript
Change a-pose slider to arm extension verbiage
Scott Petrovic4f76097d64c4
diff --git a/src/Mesh2MotionEngine.ts b/src/Mesh2MotionEngine.tsindex 9c61ccf..4a00a15 100644--- a/src/Mesh2MotionEngine.ts+++ b/src/Mesh2MotionEngine.ts@@ -271,12 +271,12 @@ export class Mesh2MotionEngine {}public update_a_pose_options_visibility (): void {- if (this.ui.dom_a_pose_correction_options != null) {+ if (this.ui.dom_arm_extension_options != null) {const config = RigConfig.by_skeleton_type(this.load_skeleton_step.skeleton_type())- if (config?.has_a_pose_correction === true) {- this.ui.dom_a_pose_correction_options.style.display = 'block'+ if (config?.has_arm_extension === true) {+ this.ui.dom_arm_extension_options.style.display = 'block'} else {- this.ui.dom_a_pose_correction_options.style.display = 'none'+ this.ui.dom_arm_extension_options.style.display = 'none'}}}diff --git a/src/create.html b/src/create.htmlindex bd6a0b4..936d1d4 100644--- a/src/create.html+++ b/src/create.html@@ -342,7 +342,7 @@<!-- slider to control arm extension (hide this feature until the base functionality is more stable) -->- <div id="a-pose-correction-options">+ <div id="arm-extension-options"><div style="display: flex;flex-direction: row;@@ -350,11 +350,11 @@gap: 1rem;justify-content: center;">- <label style="display:inline-flex">A-Pose Correction - Open Arms</label>- <span class="material-symbols-outlined" data-tippy-content="If your model uses an A-Pose, this will help expand/contract arms for all animations">help</span>+ <label style="display:inline-flex">Expand / Contract Arms</label>+ <span class="material-symbols-outlined" data-tippy-content="Fine-tune arm spread across all animations for heavier or skinnier characters.">help</span>- <button class="secondary-button" id="reset-a-pose-button">- <img src="images/icons/reset.svg" alt="Reset A-Pose" width="20" height="20" />+ <button class="secondary-button" id="reset-arm-extension-button">+ <img src="images/icons/reset.svg" alt="Reset Arm Extension" width="20" height="20" /></button></div>diff --git a/src/lib/RigConfig.ts b/src/lib/RigConfig.tsindex de73986..262e18c 100644--- a/src/lib/RigConfig.ts+++ b/src/lib/RigConfig.ts@@ -9,7 +9,7 @@ export interface RigConfigEntry {animation_preview_folder: string // Sub-folder name used when referencing animation preview thumbnailshas_hand_options: boolean // Only Human has per-finger hand skeleton optionshas_head_weight_correction: boolean // Only Human shows the head weight correction panel- has_a_pose_correction: boolean // Only Human shows the A-pose arm-extension correction slider+ has_arm_extension: boolean // Only Human shows the arm expand/contract slider}/**@@ -29,7 +29,7 @@ export class RigConfig {animation_preview_folder: 'human',has_hand_options: true,has_head_weight_correction: true,- has_a_pose_correction: true+ has_arm_extension: true} satisfies RigConfigEntry,{skeleton_type: SkeletonType.Fox,@@ -40,7 +40,7 @@ export class RigConfig {animation_preview_folder: 'fox',has_hand_options: false,has_head_weight_correction: false,- has_a_pose_correction: false+ has_arm_extension: false} satisfies RigConfigEntry,{skeleton_type: SkeletonType.Bird,@@ -51,7 +51,7 @@ export class RigConfig {animation_preview_folder: 'bird',has_hand_options: false,has_head_weight_correction: false,- has_a_pose_correction: false+ has_arm_extension: false} satisfies RigConfigEntry,{skeleton_type: SkeletonType.Dragon,@@ -62,7 +62,7 @@ export class RigConfig {animation_preview_folder: 'dragon',has_hand_options: false,has_head_weight_correction: false,- has_a_pose_correction: false+ has_arm_extension: false} satisfies RigConfigEntry,{skeleton_type: SkeletonType.Kaiju,@@ -73,7 +73,7 @@ export class RigConfig {animation_preview_folder: 'kaiju',has_hand_options: false,has_head_weight_correction: false,- has_a_pose_correction: false+ has_arm_extension: false} satisfies RigConfigEntry,{skeleton_type: SkeletonType.Spider,@@ -84,7 +84,7 @@ export class RigConfig {animation_preview_folder: 'spider',has_hand_options: false,has_head_weight_correction: false,- has_a_pose_correction: false+ has_arm_extension: false} satisfies RigConfigEntry]diff --git a/src/lib/UI.ts b/src/lib/UI.tsindex 6d4dab3..28040b1 100644--- a/src/lib/UI.ts+++ b/src/lib/UI.ts@@ -67,7 +67,7 @@ export class UI {dom_export_button: HTMLButtonElement | null = nulldom_mirror_animations_checkbox: HTMLInputElement | null = null- dom_reset_a_pose_button: HTMLButtonElement | null = null+ dom_reset_arm_extension_button: HTMLButtonElement | null = null// loading progress UI controls for animationsdom_animation_progress_loader_container: HTMLElement | null = null@@ -87,7 +87,7 @@ export class UI {dom_import_animations_input: HTMLInputElement | null = nulldom_extend_arm_range_input: HTMLInputElement | null = nulldom_extend_arm_numeric_input: HTMLInputElement | null = null- dom_a_pose_correction_options: HTMLElement | null = null+ dom_arm_extension_options: HTMLElement | null = nulldom_export_button_hidden_link: HTMLElement | null = nulldom_animation_count: HTMLElement | null = nulldom_animations_listing_count: HTMLElement | null = null@@ -188,7 +188,7 @@ export class UI {this.dom_import_animations_button = document.querySelector('#import-animations-button')this.dom_import_animations_input = document.querySelector('#import-animations-input')this.dom_mirror_animations_checkbox = document.querySelector('#mirror-animations-checkbox')- this.dom_reset_a_pose_button = document.querySelector('#reset-a-pose-button')+ this.dom_reset_arm_extension_button = document.querySelector('#reset-arm-extension-button')// loading progress UI controls for animationsthis.dom_animation_progress_loader_container = document.querySelector('#animation-progress-loader-container')@@ -206,7 +206,7 @@ export class UI {this.dom_extend_arm_range_input = document.querySelector('#extend-arm-range-input')this.dom_extend_arm_numeric_input = document.querySelector('#extend-arm-numeric-input')- this.dom_a_pose_correction_options = document.querySelector('#a-pose-correction-options')+ this.dom_arm_extension_options = document.querySelector('#arm-extension-options')this.dom_build_version = document.querySelector('#build-version')diff --git a/src/lib/processes/animations-listing/StepAnimationsListing.ts b/src/lib/processes/animations-listing/StepAnimationsListing.tsindex 3df3a2b..896122a 100644--- a/src/lib/processes/animations-listing/StepAnimationsListing.ts+++ b/src/lib/processes/animations-listing/StepAnimationsListing.ts@@ -362,7 +362,7 @@ export class StepAnimationsListing extends EventTarget {}// reset A-Pose arm extension button- this.ui.dom_reset_a_pose_button?.addEventListener('click', (event) => {+ this.ui.dom_reset_arm_extension_button?.addEventListener('click', (event) => {const extend_arm_value: number = 0 // reset to zeroif (this.ui.dom_extend_arm_numeric_input !== null) {this.ui.dom_extend_arm_numeric_input.value = extend_arm_value.toString()