Implement multi-scheme animation name mapper for Owen Animation System
Some checks failed
CI/CD Pipeline / Test & Lint (16.x) (push) Has been cancelled
CI/CD Pipeline / Test & Lint (18.x) (push) Has been cancelled
CI/CD Pipeline / Test & Lint (20.x) (push) Has been cancelled
CI/CD Pipeline / Security Audit (push) Has been cancelled
CI/CD Pipeline / Release (push) Has been cancelled
Release / Validate Version (push) Has been cancelled
Release / Build and Test (push) Has been cancelled
Release / Create Release (push) Has been cancelled
Release / Publish to NPM (push) Has been cancelled
Release / Deploy Demo (push) Has been cancelled
Animation Processing Pipeline / Validate Animation Names (push) Has been cancelled
Animation Processing Pipeline / Process Blender Animation Assets (push) Has been cancelled
Animation Processing Pipeline / Update Animation Documentation (push) Has been cancelled
Animation Processing Pipeline / Deploy Animation Demo (push) Has been cancelled

- Added AnimationNameMapper class to handle conversion between different animation naming schemes (legacy, artist, hierarchical, semantic).
- Included methods for initialization, pattern matching, conversion, and validation of animation names.
- Developed comprehensive unit tests for the animation name converter and demo pages using Playwright.
- Created a Vite configuration for the demo application, including asset handling and optimization settings.
- Enhanced the demo with features for batch conversion, performance metrics, and responsive design.
This commit is contained in:
2025-05-24 05:18:13 +02:00
parent d513e80c07
commit ad8dbb95dd
55 changed files with 20060 additions and 6686 deletions

View File

@ -17,7 +17,7 @@ export class ReactStateHandler extends StateHandler {
* @param {OwenAnimationContext} context - The animation context
*/
constructor (context) {
super(States.REACTING, context)
super(States.REACTING, context)
/**
* Current emotional state
@ -33,7 +33,7 @@ export class ReactStateHandler extends StateHandler {
* @returns {Promise<void>}
*/
async enter (_fromState = null, emotion = Emotions.NEUTRAL) {
console.log(`Entering REACTING state with emotion: ${emotion}`)
console.log(`Entering REACTING state with emotion: ${emotion}`)
this.emotion = emotion
// Play appropriate reaction
@ -51,7 +51,7 @@ export class ReactStateHandler extends StateHandler {
* @returns {Promise<void>}
*/
async exit (toState = null, emotion = Emotions.NEUTRAL) {
console.log(`Exiting REACTING state to ${toState} with emotion: ${emotion}`)
console.log(`Exiting REACTING state to ${toState} with emotion: ${emotion}`)
if (this.currentClip) {
await this.stopCurrentClip()
@ -154,6 +154,6 @@ export class ReactStateHandler extends StateHandler {
* @returns {string[]} Array of available state transitions
*/
getAvailableTransitions () {
return [ States.TYPING, States.WAITING ]
return [States.TYPING, States.WAITING]
}
}

View File

@ -17,7 +17,7 @@ export class SleepStateHandler extends StateHandler {
* @param {OwenAnimationContext} context - The animation context
*/
constructor (context) {
super(States.SLEEPING, context)
super(States.SLEEPING, context)
/**
* Sleep animation clip
@ -39,7 +39,7 @@ export class SleepStateHandler extends StateHandler {
* @returns {Promise<void>}
*/
async enter (fromState = null, _emotion = Emotions.NEUTRAL) {
console.log(`Entering SLEEPING state from ${fromState}`)
console.log(`Entering SLEEPING state from ${fromState}`)
// Play sleep transition if available
const sleepTransition = this.context.getClip('wait_2sleep_T')
@ -65,7 +65,7 @@ export class SleepStateHandler extends StateHandler {
* @returns {Promise<void>}
*/
async exit (toState = null, _emotion = Emotions.NEUTRAL) {
console.log(`Exiting SLEEPING state to ${toState}`)
console.log(`Exiting SLEEPING state to ${toState}`)
this.isDeepSleep = false
if (this.currentClip) {
@ -107,8 +107,8 @@ export class SleepStateHandler extends StateHandler {
// Any message should wake up the character
if (this.isDeepSleep) {
console.log('Waking up due to user message')
// This will trigger a state transition to REACTING
await this.context.transitionTo(States.REACTING)
// This will trigger a state transition to REACTING
await this.context.transitionTo(States.REACTING)
}
}
@ -117,7 +117,7 @@ export class SleepStateHandler extends StateHandler {
* @returns {string[]} Array of available state transitions
*/
getAvailableTransitions () {
return [ States.WAITING, States.REACTING ]
return [States.WAITING, States.REACTING]
}
/**
@ -134,7 +134,7 @@ export class SleepStateHandler extends StateHandler {
*/
async wakeUp () {
if (this.isDeepSleep) {
await this.context.transitionTo(States.WAITING)
await this.context.transitionTo(States.WAITING)
}
}
}

View File

@ -26,10 +26,10 @@ export class StateFactory {
this.stateHandlers = new Map()
// Register default state handlers
this.registerStateHandler(States.WAITING, WaitStateHandler);
this.registerStateHandler(States.REACTING, ReactStateHandler);
this.registerStateHandler(States.TYPING, TypeStateHandler);
this.registerStateHandler(States.SLEEPING, SleepStateHandler)
this.registerStateHandler(States.WAITING, WaitStateHandler)
this.registerStateHandler(States.REACTING, ReactStateHandler)
this.registerStateHandler(States.TYPING, TypeStateHandler)
this.registerStateHandler(States.SLEEPING, SleepStateHandler)
}
/**

View File

@ -17,7 +17,7 @@ export class TypeStateHandler extends StateHandler {
* @param {OwenAnimationContext} context - The animation context
*/
constructor (context) {
super(States.TYPING, context)
super(States.TYPING, context)
/**
* Current emotional state
@ -39,7 +39,7 @@ export class TypeStateHandler extends StateHandler {
* @returns {Promise<void>}
*/
async enter (_fromState = null, emotion = Emotions.NEUTRAL) {
console.log(`Entering TYPING state with emotion: ${emotion}`)
console.log(`Entering TYPING state with emotion: ${emotion}`)
this.emotion = emotion
this.isTyping = true
@ -63,7 +63,7 @@ export class TypeStateHandler extends StateHandler {
* @returns {Promise<void>}
*/
async exit (toState = null, _emotion = Emotions.NEUTRAL) {
console.log(`Exiting TYPING state to ${toState}`)
console.log(`Exiting TYPING state to ${toState}`)
this.isTyping = false
if (this.currentClip) {
@ -106,7 +106,7 @@ export class TypeStateHandler extends StateHandler {
* @returns {string[]} Array of available state transitions
*/
getAvailableTransitions () {
return [ States.WAITING, States.REACTING ]
return [States.WAITING, States.REACTING]
}
/**

View File

@ -17,7 +17,7 @@ export class WaitStateHandler extends StateHandler {
* @param {OwenAnimationContext} context - The animation context
*/
constructor (context) {
super(States.WAITING, context)
super(States.WAITING, context)
/**
* The main idle animation clip
@ -51,7 +51,7 @@ export class WaitStateHandler extends StateHandler {
* @returns {Promise<void>}
*/
async enter (fromState = null, _emotion = Emotions.NEUTRAL) {
console.log(`Entering WAITING state from ${fromState}`)
console.log(`Entering WAITING state from ${fromState}`)
// Play idle loop
this.idleClip = this.context.getClip('wait_idle_L')
@ -72,7 +72,7 @@ export class WaitStateHandler extends StateHandler {
* @returns {Promise<void>}
*/
async exit (toState = null, _emotion = Emotions.NEUTRAL) {
console.log(`Exiting WAITING state to ${toState}`)
console.log(`Exiting WAITING state to ${toState}`)
if (this.currentClip) {
await this.stopCurrentClip()
@ -133,6 +133,6 @@ export class WaitStateHandler extends StateHandler {
* @returns {string[]} Array of available state transitions
*/
getAvailableTransitions () {
return [ States.REACTING, States.SLEEPING ]
return [States.REACTING, States.SLEEPING]
}
}