Default material has no name

rewrite of aaeaf9bdb9ad1be0e7519d2a9a74186a5aae835, use tmp variable