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

Commit

Permalink
various fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
HexaField committed Aug 31, 2023
1 parent f29bd34 commit 0b1ad76
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 10 deletions.
10 changes: 2 additions & 8 deletions packages/engine/src/avatar/components/LoopAnimationComponent.ts
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ export const LoopAnimationComponent = defineComponent({

const modelComponent = useOptionalComponent(entity, ModelComponent)

const animComponent = useComponent(entity, AnimationComponent)
const animComponent = useOptionalComponent(entity, AnimationComponent)

/**
* Callback functions
Expand Down Expand Up @@ -130,14 +130,8 @@ export const LoopAnimationComponent = defineComponent({
animComponent.mixer.timeScale.set(loopAnimationComponent.animationSpeed.value)
}, [loopAnimationComponent.animationSpeed])

console.error(
modelComponent?.scene?.value,
animComponent?.animations?.value,
loopAnimationComponent?.vrm?.value,
loopAnimationComponent?.animationPack?.value
)
useEffect(() => {
if (!modelComponent?.scene?.value) return
if (!modelComponent?.scene?.value || !animComponent) return

const loopComponent = getComponent(entity, LoopAnimationComponent)
const animationComponent = getComponent(entity, AnimationComponent)
Expand Down
4 changes: 2 additions & 2 deletions packages/engine/src/avatar/functions/retargetMixamoRig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,8 @@ export function retargetMixamoAnimation(clip: AnimationClip, mixamoScene: Object
const leftArm = mixamoRig.getObjectByName('mixamorigLeftArm')!

const userData = (vrm as any).userData
if (userData.flipped) hips.quaternion.copy(hipsOffset)
if (userData.needsMixamoPrefix) {
if (userData?.flipped) hips.quaternion.copy(hipsOffset)
if (userData?.needsMixamoPrefix) {
rightArm.quaternion.copy(rightArmOffset)
leftArm.quaternion.copy(leftArmOffset)
}
Expand Down

0 comments on commit 0b1ad76

Please sign in to comment.