Skip to content

Commit

Permalink
fixed: build error fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
5nxtnxtnxt committed Dec 4, 2023
1 parent cbec804 commit 71a99d9
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
5 changes: 2 additions & 3 deletions front/src/pages/Visit/Deco/DecoCanvas/DecoModel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import * as THREE from 'three';
import { DECO } from '../../../../constants/deco';
import { DecoContext } from '../DecoProvider';
import { useContext } from 'react';
import { makeColorChangedMaterial } from '../../../../utils/meshUtils';

const DecoModel = () => {
const { decoID, color } = useContext(DecoContext);
Expand All @@ -16,9 +17,7 @@ const DecoModel = () => {
return;
}
if (child.name === 'Main') {
const newMaterial = child.material.clone();
newMaterial.color = new THREE.Color(color);
child.material = newMaterial;
child.material = makeColorChangedMaterial(child, color);
}
}
});
Expand Down
1 change: 0 additions & 1 deletion front/src/utils/meshUtils.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import { useGLTF } from '@react-three/drei';
import * as THREE from 'three';

const makeColorChangedMaterial = (mesh: THREE.Mesh, color: string) => {
Expand Down

0 comments on commit 71a99d9

Please sign in to comment.