C# Materials list and texture files

Could anyone please give me some c# samples to get a list of all my materials in current RhinoDoc? I would like to get all used materials’ name and texture files’ name and path of the material.

I am confused with the difference between MaterialTable and RenderMaterialTable. rhinoDoc.Materials would return a MaterialTable, rhinoDoc.RenderMaterials would return a RenderMaterialTable, what’s the difference?

RenderMaterialTable is the new, preferred way of accessing materials. You get instances of RenderMaterial.

For all textures you can iterate over the RenderTextures table.

RenderMaterial, RenderTexture and RenderEnvironment all derive from RenderContent.

For RhinoCycles (which provides Raytraced and Rhino Render) I don’t directly access these tables, though, since I get material info via the ChangeQueue mechanism.

But iterate over doc.RenderMaterials and doc.RenderTextures to get these.