title: RealityKit - Hiding and showing parts (meshes) of usdz model
body: <p>I need an advice. I am using RealityKit for showing models of fences. I have models which has several meshes that shouldn't be shown at once. For example filling of the fence. There are different options and I have it all in my model:</p>
  <p><a href="https://i.stack.imgur.com/RmMPJ.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/RmMPJ.jpg" alt="3D usdz model showing in Xcode" /></a></p>
  <p>I would like to show always one at the time. How can I do that? I can't edit meshes at runtime, can I? I was thinking about changing material for each mesh but when I tried to set clear color with SimpleMaterial it shows mesh in black and when I tried OcclusionMateril I get this result:</p>
  <p><a href="https://i.stack.imgur.com/oUgmj.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/oUgmj.jpg" alt="Apply OcclusionMaterial in real app" /></a></p>
  <p>Example how I tried hide material with SimpleMaterial:</p>
  <pre><code>var material = SimpleMaterial()
  material.baseColor = MaterialColorParameter.color(UIColor.clear)
  material.tintColor = .clear
  clonedEntity.model?.materials[index] = material
  </code></pre>
  <p>Or with OcclusionMaterial (in screenshot from app above):</p>
  <pre><code>let occlusion = OcclusionMaterial()
  clonedEntity.model?.materials[index] = occlusion
  </code></pre>
  <p>Is it possible to somehow hide parts of 3D model? Or do I have to several models and when I want to change filling for example I must change whole model? Or should I somehow composite one object from multiple models (for example filling and rest of fence)? Thanks for any advice.</p>