Add recursive assingment of materials

assign each mesh the right material depending on the parent nodes color
if its a variable color