Hey.
While working with PBR materials i have noticed that the name and id are not applied when cloning the material. Instead it uses it's parent name and id.
For comparison here is the cloning snippet for the standard material and PBR materials, where the id and name are not reset prior to returning.
StandardMaterial.prototype.clone = function (name) {
var _this = this;
var result = BABYLON.SerializationHelper.Clone(function () { return new StandardMaterial(name, _this.getScene()); }, this);
result.name = name;
result.id = name;
return result;
};
PBRMetallicRoughnessMaterial.prototype.clone = function (name) {
var _this = this;
return BABYLON.SerializationHelper.Clone(function () { return new PBRMetallicRoughnessMaterial(name, _this.getScene()); }, this);
};
Correct me if I am missing something.
Thanks