mirror of
https://github.com/exogen/t2-mapper.git
synced 2026-07-13 23:44:52 +00:00
fix missing key
This commit is contained in:
parent
d925585a34
commit
507ddf8d49
3 changed files with 17 additions and 4 deletions
|
|
@ -33,7 +33,7 @@ function ShapeModel({ shapeName }: { shapeName: string }) {
|
||||||
!node.material || !node.material.name.match(/\.\d+$/)
|
!node.material || !node.material.name.match(/\.\d+$/)
|
||||||
)
|
)
|
||||||
.map(([name, node]: [string, any]) => (
|
.map(([name, node]: [string, any]) => (
|
||||||
<mesh geometry={node.geometry} castShadow receiveShadow>
|
<mesh key={node.id} geometry={node.geometry} castShadow receiveShadow>
|
||||||
<meshStandardMaterial color="cyan" wireframe />
|
<meshStandardMaterial color="cyan" wireframe />
|
||||||
</mesh>
|
</mesh>
|
||||||
))}
|
))}
|
||||||
|
|
|
||||||
|
|
@ -34,7 +34,7 @@ function ShapeModel({ shapeName }: { shapeName: string }) {
|
||||||
!node.material || !node.material.name.match(/\.\d+$/)
|
!node.material || !node.material.name.match(/\.\d+$/)
|
||||||
)
|
)
|
||||||
.map(([name, node]: [string, any]) => (
|
.map(([name, node]: [string, any]) => (
|
||||||
<mesh geometry={node.geometry} castShadow receiveShadow>
|
<mesh key={node.id} geometry={node.geometry} castShadow receiveShadow>
|
||||||
<meshStandardMaterial color="cyan" wireframe />
|
<meshStandardMaterial color="cyan" wireframe />
|
||||||
</mesh>
|
</mesh>
|
||||||
))}
|
))}
|
||||||
|
|
|
||||||
|
|
@ -19,9 +19,22 @@ function useStaticShape(shapeName: string) {
|
||||||
}
|
}
|
||||||
|
|
||||||
function ShapeModel({ shapeName }: { 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 }) {
|
function ShapePlaceholder({ color }: { color: string }) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue