Skip to content
This repository has been archived by the owner on Aug 21, 2024. It is now read-only.

Preload emote animation files #9592

Merged
merged 1 commit into from
Jan 10, 2024
Merged
Show file tree
Hide file tree
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
4 changes: 0 additions & 4 deletions packages/engine/src/avatar/functions/avatarFunctions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,10 +73,6 @@ declare module '@pixiv/three-vrm/types/VRM' {
}
}

export const getPreloaded = () => {
return ['sitting']
}

/** Checks if the asset is a VRM. If not, attempt to use
* Mixamo based naming schemes to autocreate necessary VRM humanoid objects. */
export const autoconvertMixamoAvatar = (model: GLTF | VRM) => {
Expand Down
9 changes: 6 additions & 3 deletions packages/engine/src/avatar/systems/AvatarAnimationSystem.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,11 +51,11 @@ import { AvatarHeadDecapComponent, AvatarIKTargetComponent } from '.././componen
import { IKSerialization } from '../IKSerialization'
import { updateAnimationGraph } from '../animation/AvatarAnimationGraph'
import { solveTwoBoneIK } from '../animation/TwoBoneIKSolver'
import { ikTargets } from '../animation/Util'
import { emoteAnimations, ikTargets } from '../animation/Util'
import { getArmIKHint } from '../animation/getArmIKHint'
import { AvatarComponent } from '../components/AvatarComponent'
import { SkinnedMeshComponent } from '../components/SkinnedMeshComponent'
import { loadLocomotionAnimations } from '../functions/avatarFunctions'
import { loadAnimationArray, loadLocomotionAnimations } from '../functions/avatarFunctions'
import { updateVRMRetargeting } from '../functions/updateVRMRetargeting'
import { AnimationSystem } from './AnimationSystem'

Expand Down Expand Up @@ -338,7 +338,10 @@ const execute = () => {

const reactor = () => {
useEffect(() => {
if (isClient) loadLocomotionAnimations()
if (isClient) {
loadLocomotionAnimations()
loadAnimationArray(Object.values(emoteAnimations), 'emotes')
}

const networkState = getMutableState(NetworkState)

Expand Down