mirror of
https://github.com/exogen/t2-mapper.git
synced 2026-01-19 20:25:01 +00:00
fix missing key
This commit is contained in:
parent
d925585a34
commit
507ddf8d49
|
|
@ -33,7 +33,7 @@ function ShapeModel({ shapeName }: { shapeName: string }) {
|
|||
!node.material || !node.material.name.match(/\.\d+$/)
|
||||
)
|
||||
.map(([name, node]: [string, any]) => (
|
||||
<mesh geometry={node.geometry} castShadow receiveShadow>
|
||||
<mesh key={node.id} geometry={node.geometry} castShadow receiveShadow>
|
||||
<meshStandardMaterial color="cyan" wireframe />
|
||||
</mesh>
|
||||
))}
|
||||
|
|
|
|||
|
|
@ -34,7 +34,7 @@ function ShapeModel({ shapeName }: { shapeName: string }) {
|
|||
!node.material || !node.material.name.match(/\.\d+$/)
|
||||
)
|
||||
.map(([name, node]: [string, any]) => (
|
||||
<mesh geometry={node.geometry} castShadow receiveShadow>
|
||||
<mesh key={node.id} geometry={node.geometry} castShadow receiveShadow>
|
||||
<meshStandardMaterial color="cyan" wireframe />
|
||||
</mesh>
|
||||
))}
|
||||
|
|
|
|||
|
|
@ -19,9 +19,22 @@ function useStaticShape(shapeName: string) {
|
|||
}
|
||||
|
||||
function ShapeModel({ shapeName }: { shapeName: string }) {
|
||||
const { scene } = useStaticShape(shapeName);
|
||||
const { nodes } = useStaticShape(shapeName);
|
||||
|
||||
return <primitive object={scene} />;
|
||||
return (
|
||||
<>
|
||||
{Object.entries(nodes)
|
||||
.filter(
|
||||
([name, node]: [string, any]) =>
|
||||
!node.material || !node.material.name.match(/\.\d+$/)
|
||||
)
|
||||
.map(([name, node]: [string, any]) => (
|
||||
<mesh key={node.id} geometry={node.geometry} castShadow receiveShadow>
|
||||
<meshStandardMaterial color="cyan" wireframe />
|
||||
</mesh>
|
||||
))}
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
function ShapePlaceholder({ color }: { color: string }) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue