From f30724c5dec9d2a5a74488e47116049734bed64e Mon Sep 17 00:00:00 2001 From: dan-rpm Date: Tue, 17 Sep 2024 15:43:12 +0300 Subject: [PATCH] fix: animationmodel rollback --- .../Models/AnimationModel/AnimationModel.component.tsx | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/components/Models/AnimationModel/AnimationModel.component.tsx b/src/components/Models/AnimationModel/AnimationModel.component.tsx index e6c5a247..def8a6a1 100644 --- a/src/components/Models/AnimationModel/AnimationModel.component.tsx +++ b/src/components/Models/AnimationModel/AnimationModel.component.tsx @@ -1,10 +1,9 @@ import React, { useRef, FC, useMemo, useState } from 'react'; -import { useFrame, useGraph, useLoader } from '@react-three/fiber'; +import { useFrame, useGraph } from '@react-three/fiber'; import { AnimationMixer, Group } from 'three'; -import { GLTFLoader } from 'three-stdlib'; import { Model } from 'src/components/Models/Model'; -import { useHeadMovement, useFallback, useIdleExpression, useEmotion } from 'src/services'; +import { useHeadMovement, useFallback, useIdleExpression, useEmotion, useGltfLoader } from 'src/services'; import { BaseModelProps } from 'src/types'; import { loadAnimationClip } from 'src/services/Animation.service'; import { Emotion } from 'src/components/Avatar/Avatar.component'; @@ -39,7 +38,7 @@ export const AnimationModel: FC = ({ setAnimationRunning(false); }; - const { scene } = useLoader(GLTFLoader, String(modelSrc)); + const { scene } = useGltfLoader(modelSrc); const { nodes } = useGraph(scene); const animationClip = useMemo(async () => loadAnimationClip(animationSrc), [animationSrc]);