Change materials at runtime

Nov 14, 2013 at 6:04 PM
Hi,

I've been using the Helix toolkit for a day now, and I just can't get my head wrapped around it.
I have my own WPF interface, and I can load and display a model into my scene. However, I just can't figure out how to change the materials on the model after loading the model from file.

Does anyone know?

Thanks!
Nov 19, 2013 at 8:18 PM
No one has any suggestions on how to do this?
Coordinator
Nov 19, 2013 at 10:22 PM
Did you try changing the Material property?
http://msdn.microsoft.com/en-us/library/system.windows.media.media3d.geometrymodel3d.material(v=vs.110).aspx

Also, make sure the model is not frozen.
Nov 20, 2013 at 12:11 AM
I didn't realize you could do that in XAML :D

I'll give that a try, thanks!
Coordinator
Nov 20, 2013 at 8:12 AM
I think you need to change the material programatically if you load a model into the scene at runtime!
Nov 23, 2013 at 2:31 PM
objo wrote:
I think you need to change the material programatically if you load a model into the scene at runtime!
And how exactly would I access that material? I use a Model3D after loading in the mesh, but I really don't see where I can change the material anywhere.. :/
Nov 24, 2013 at 10:48 AM
you can try setting the Material property of a GeometryModel3D to an instance of Material , for instance DiffuseMaterial
Nov 28, 2013 at 10:34 AM
Working great now; thanks a lot! :)