title: C# WPF HELIX 3D How to get a model's material and make it a usable material
body: <p>I have a model of a human head with hair...don't worry about the bleeding, I'm only trying to get a rudimentary program going for altering meshes and things.</p>
  
  <p><img src="https://i.stack.imgur.com/Gptf2.jpg" alt="enter image description here"></p>
  
  <p>It's an .OBJ model and I am loading it using the Helix 3D toolkit. I tried various ways of getting the material used for the hair (once the model is loaded). The hair is a child mesh and is child 0. I am calling the imported model 'start' and it is loaded like this :</p>
  
  <pre><code> ObjReader CurrentHelixObjReader = new ObjReader();
   start = CurrentHelixObjReader.Read("C:/Users/Roger/Desktop/head/base_med_.obj");
  </code></pre>
  
  <p>The model can be loaded successfully but things break when I attempt this :</p>
  
  <pre><code> Material matty = (MaterialGroup)((GeometryModel3D)start.Children[0]).Material;
  </code></pre>
  
  <p>What I am trying to do is get the material from the original model. Is this the correct way to create a new material from an existing one ?</p>
  
  <p>Once I have the material I would want to use it at a later stage.</p>
  
  <p>I would welcome any advice and thank you for taking a look.</p>
  
  <p>EDIT: Error Message is :</p>
  
  <p>"<em>An unhandled exception of type 'System.Windows.Markup.XamlParseException' occurred in PresentationFramework.dll
  Additional information: 'The invocation of the constructor on type 'HelixTrial.MainWindow' that matches the specified binding constraints threw an exception.' Line number '4' and line position '9'.
  If there is a handler for this exception, the program may be safely continued.</em>"</p>