0
votes


I want to ask, I am clonning mesh (100x). This mesh have one material, but this mesh (its also parent mesh) have 4 childrens with another 4 materials. When I clone my parent mesh like this:

let result = cloudObjects.sideCloudGeometry[texture].clone();

I got clonned mesh, with all childrens, so its looks great, which is great.
But there is another problem, when I want to change opacity of one clonned mesh, this opacity apply to all clonned meshes texture (also childrens).
How can I clone all texture of parent object and children object, to apply opacity separatly?
Thanks very much!

1

1 Answers

1
votes

Ok, so finnaly I got it, here it is:

let result = cloudObjects.sideCloudGeometry[texture].clone();
result.material = cloudObjects.sideCloudGeometry[texture].material.clone();
result.children[0].material = cloudObjects.sideCloudGeometry[texture].children[0].material.clone();
result.children[1].material = cloudObjects.sideCloudGeometry[texture].children[1].material.clone();
result.children[2].material = cloudObjects.sideCloudGeometry[texture].children[2].material.clone();
result.children[3].material = cloudObjects.sideCloudGeometry[texture].children[3].material.clone();