some utils fix

This commit is contained in:
Kseninia Mikhaylova 2024-06-20 12:22:47 +03:00
parent ed294a77f9
commit def1e3bad4
1 changed files with 11 additions and 8 deletions

View File

@ -3,6 +3,16 @@ import { getColorHexFromRal } from "~/components/ral"
const lamelle_color = use_lamelle_color()
const pillar_color = use_pillar_color()
const set_metaril_func = (scene: any, material: any) => {
scene.children.forEach((el: any) => {
if (el.isMesh) {
el.castShadow = true
el.receiveShadow = true
}
if (el.material) el.material = material
set_material(el, material)
})
}
export const set_material = (scene: any, color: any) => {
let c = color
if (color == 'lamelle') {
@ -18,12 +28,5 @@ export const set_material = (scene: any, color: any) => {
roughness: 0.3,
metalness: 0.3
})
scene.children.forEach((el: any) => {
if (el.isMesh) {
el.castShadow = true
el.receiveShadow = true
}
if (el.material) el.material = material
set_material(el, color)
})
set_metaril_func(scene, material)
}