02-22-2021, 11:56 AM
(02-22-2021, 10:25 AM)abenedik Wrote: In the AssimpWpfImporterSample the ContentVisual is defined in XAML:
<ModelVisual3D x:Name="ContentVisual" />
<visuals:WireframeVisual3D x:Name="ContentWireframeVisual" ShowPolygonLines="True" WireframeType="Wireframe" UseModelColor="False"
LineColor="Black" LineThickness="1" />
I see that you already have a field ContentVisual, but because of the exception, you get it seems that you did not yet create an instance of it. As seen from the XAML, you will need to assign it to a new instance of ModelVisual3D object and then add that instance to Viewport3D objects with (MainViewport is the field that is an instance of Viewport3D):
Private _contentVisual As ModelVisual3D
Me._contentVisual = new ModelVisual3D()
Doh! simple when you write it like that :) thank you....... plodding on Model now loads :) now i need to reset the view to load another model at the moment i am adding to the scene i would rather clear it an load fresh each time.
Thank you for you help