Material editor for custom materials, a few fixes + cleanup.