Quantcast
Channel: Bugs Latest Topics
Viewing all articles
Browse latest Browse all 760

PRBMaterial clone name, id not applied

$
0
0

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


Viewing all articles
Browse latest Browse all 760

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>