Skip to content

Commit

Permalink
fix: Outlines on meshes with morphTargets (#2317)
Browse files Browse the repository at this point in the history
  • Loading branch information
Nickardson authored Jan 20, 2025
1 parent 10aa60f commit eb449ed
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/core/Outlines.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,8 @@ export function Outlines({
group.add(mesh)
}
mesh.geometry = angle ? toCreasedNormals(parent.geometry, angle) : parent.geometry
mesh.morphTargetInfluences = parent.morphTargetInfluences
mesh.morphTargetDictionary = parent.morphTargetDictionary
}
}
})
Expand All @@ -146,6 +148,12 @@ export function Outlines({
const mesh = group.children[0] as THREE.Mesh<THREE.BufferGeometry, THREE.Material>
if (mesh) {
mesh.renderOrder = renderOrder

const parent = group.parent as THREE.Mesh & THREE.SkinnedMesh & THREE.InstancedMesh
applyProps(mesh as any, {
morphTargetInfluences: parent.morphTargetInfluences,
morphTargetDictionary: parent.morphTargetDictionary,
})
applyProps(mesh.material as any, {
transparent,
thickness,
Expand Down

0 comments on commit eb449ed

Please sign in to comment.