mirror of https://github.com/CesiumGS/obj2gltf.git
Sceure/logging/outside fixes
This commit is contained in:
parent
099d6ee65e
commit
9fc526b692
|
@ -481,14 +481,14 @@ function loadMaterials(mtlPaths, objPath, options) {
|
|||
var shallowPath = path.join(objDirectory, path.basename(mtlPath));
|
||||
if (options.secure && outsideDirectory(mtlPath, objPath)) {
|
||||
// Try looking for the .mtl in the same directory as the obj
|
||||
optionslogger('The material file is outside of the obj directory and the secure flag is true. Attempting to read the material file from within the obj directory instead.');
|
||||
options.logger('The material file is outside of the obj directory and the secure flag is true. Attempting to read the material file from within the obj directory instead.');
|
||||
return loadMtl(shallowPath)
|
||||
.then(function(materialsInMtl) {
|
||||
Object.assign(materials, materialsInMtl);
|
||||
})
|
||||
.catch(function(error) {
|
||||
console.logger(error.message);
|
||||
console.logger('Could not read material file at ' + shallowPath + '. Using default material instead.');
|
||||
options.logger(error.message);
|
||||
options.logger('Could not read material file at ' + shallowPath + '. Using default material instead.');
|
||||
});
|
||||
}
|
||||
return loadMtl(mtlPath)
|
||||
|
|
Loading…
Reference in New Issue