some utils fix
This commit is contained in:
parent
ed294a77f9
commit
def1e3bad4
|
@ -3,6 +3,16 @@ import { getColorHexFromRal } from "~/components/ral"
|
||||||
|
|
||||||
const lamelle_color = use_lamelle_color()
|
const lamelle_color = use_lamelle_color()
|
||||||
const pillar_color = use_pillar_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) => {
|
export const set_material = (scene: any, color: any) => {
|
||||||
let c = color
|
let c = color
|
||||||
if (color == 'lamelle') {
|
if (color == 'lamelle') {
|
||||||
|
@ -18,12 +28,5 @@ export const set_material = (scene: any, color: any) => {
|
||||||
roughness: 0.3,
|
roughness: 0.3,
|
||||||
metalness: 0.3
|
metalness: 0.3
|
||||||
})
|
})
|
||||||
scene.children.forEach((el: any) => {
|
set_metaril_func(scene, material)
|
||||||
if (el.isMesh) {
|
|
||||||
el.castShadow = true
|
|
||||||
el.receiveShadow = true
|
|
||||||
}
|
|
||||||
if (el.material) el.material = material
|
|
||||||
set_material(el, color)
|
|
||||||
})
|
|
||||||
}
|
}
|
Loading…
Reference in New Issue