11-03-2021, 05:06 PM
I cannot reproduce this problem. I have a frozen Model3DGroup with a ModelVisual3D and then I tried to add/remove it from Viewport3D.Childer, from parent ModelVisual3D and I have also tried to set ModelVisual3D.Content to null and then back to frozen Model3DGroup. In all cases this worked for me. I will send you an email and ask you to provide some additional information.
Note that with Ab3d.DXEngine there is a more efficient way to show / hide 3D objects then adding / removing it to a Children collection. Instead, you can use ContentVisual3D and change its IsVisible property. An advantage of this approach is that in this case the DirectX resources that are created from the models are preserved and only rendering of the objects is skipped. In case when you remove the object from the parent's tree (and not add it back in the same frame), then the DirectX resources are disposed. So when adding the model back the resources will need to be generated again.
Therefore it is usually better to use ContentModel3D instead of ModelVisual3D as a parent Visual3D object. See "Other Ab3d.PowerToys samples / ContentVisual3D sample" in the Ab3d.DXEninge samples for more info.
Note that with Ab3d.DXEngine there is a more efficient way to show / hide 3D objects then adding / removing it to a Children collection. Instead, you can use ContentVisual3D and change its IsVisible property. An advantage of this approach is that in this case the DirectX resources that are created from the models are preserved and only rendering of the objects is skipped. In case when you remove the object from the parent's tree (and not add it back in the same frame), then the DirectX resources are disposed. So when adding the model back the resources will need to be generated again.
Therefore it is usually better to use ContentModel3D instead of ModelVisual3D as a parent Visual3D object. See "Other Ab3d.PowerToys samples / ContentVisual3D sample" in the Ab3d.DXEninge samples for more info.
Andrej Benedik

