@gltf-transform/extensions
Advanced tools
Comparing version 0.5.3 to 0.5.4
@@ -46,4 +46,4 @@ import { PropertyType } from './constants'; | ||
readonly provideTypes: PropertyType[]; | ||
private _required; | ||
private _properties; | ||
protected required: boolean; | ||
protected properties: Set<ExtensionProperty>; | ||
/** @hidden */ | ||
@@ -50,0 +50,0 @@ constructor(doc: Document); |
@@ -1,2 +0,2 @@ | ||
var e=require("@gltf-transform/core");function t(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,e.__proto__=t}function r(e,t,r,s){var o,n=arguments.length,a=n<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,r):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,s);else for(var i=e.length-1;i>=0;i--)(o=e[i])&&(a=(n<3?o(a):n>3?o(t,r,a):o(t,r))||a);return n>3&&a&&Object.defineProperty(t,r,a),a}var s=function(r){function s(){var t;return(t=r.apply(this,arguments)||this).propertyType="Clearcoat",t.parentTypes=[e.PropertyType.MATERIAL],t.extensionName="KHR_materials_clearcoat",t._clearcoatFactor=0,t._clearcoatRoughnessFactor=0,t._clearcoatNormalScale=1,t.clearcoatTexture=null,t.clearcoatRoughnessTexture=null,t.clearcoatNormalTexture=null,t}t(s,r);var o=s.prototype;return o.copy=function(t,s){return void 0===s&&(s=e.COPY_IDENTITY),r.prototype.copy.call(this,t,s),this._clearcoatFactor=t._clearcoatFactor,this._clearcoatRoughnessFactor=t._clearcoatRoughnessFactor,this._clearcoatNormalScale=t._clearcoatNormalScale,t.clearcoatTexture&&(this.setClearcoatTexture(s(t.clearcoatTexture.getChild())),this.clearcoatTexture.copy(t.clearcoatTexture)),t.clearcoatRoughnessTexture&&(this.setClearcoatRoughnessTexture(s(t.clearcoatRoughnessTexture.getChild())),this.clearcoatRoughnessTexture.copy(t.clearcoatRoughnessTexture)),t.clearcoatNormalTexture&&(this.setClearcoatNormalTexture(s(t.clearcoatNormalTexture.getChild())),this.clearcoatNormalTexture.copy(t.clearcoatNormalTexture)),this},o.getClearcoatFactor=function(){return this._clearcoatFactor},o.setClearcoatFactor=function(e){return this._clearcoatFactor=e,this},o.getClearcoatTexture=function(){return this.clearcoatTexture?this.clearcoatTexture.getChild():null},o.getClearcoatTextureInfo=function(){return this.clearcoatTexture?this.clearcoatTexture.textureInfo:null},o.getClearcoatTextureSampler=function(){return this.clearcoatTexture?this.clearcoatTexture.sampler:null},o.setClearcoatTexture=function(e){return this.clearcoatTexture=this.graph.linkTexture("clearcoatTexture",this,e),this},o.getClearcoatRoughnessFactor=function(){return this._clearcoatRoughnessFactor},o.setClearcoatRoughnessFactor=function(e){return this._clearcoatRoughnessFactor=e,this},o.getClearcoatRoughnessTexture=function(){return this.clearcoatRoughnessTexture?this.clearcoatRoughnessTexture.getChild():null},o.getClearcoatRoughnessTextureInfo=function(){return this.clearcoatRoughnessTexture?this.clearcoatRoughnessTexture.textureInfo:null},o.getClearcoatRoughnessTextureSampler=function(){return this.clearcoatRoughnessTexture?this.clearcoatRoughnessTexture.sampler:null},o.setClearcoatRoughnessTexture=function(e){return this.clearcoatRoughnessTexture=this.graph.linkTexture("clearcoatRoughnessTexture",this,e),this},o.getClearcoatNormalScale=function(){return this._clearcoatNormalScale},o.setClearcoatNormalScale=function(e){return this._clearcoatNormalScale=e,this},o.getClearcoatNormalTexture=function(){return this.clearcoatNormalTexture?this.clearcoatNormalTexture.getChild():null},o.getClearcoatNormalTextureInfo=function(){return this.clearcoatNormalTexture?this.clearcoatNormalTexture.textureInfo:null},o.getClearcoatNormalTextureSampler=function(){return this.clearcoatNormalTexture?this.clearcoatNormalTexture.sampler:null},o.setClearcoatNormalTexture=function(e){return this.clearcoatNormalTexture=this.graph.linkTexture("clearcoatNormalTexture",this,e),this},s}(e.ExtensionProperty);s.EXTENSION_NAME="KHR_materials_clearcoat",r([e.GraphChild],s.prototype,"clearcoatTexture",void 0),r([e.GraphChild],s.prototype,"clearcoatRoughnessTexture",void 0),r([e.GraphChild],s.prototype,"clearcoatNormalTexture",void 0);var o="KHR_materials_clearcoat",n=function(e){function r(){var t;return(t=e.apply(this,arguments)||this).extensionName=o,t}t(r,e);var n=r.prototype;return n.createClearcoat=function(){return new s(this.doc.getGraph(),this)},n.read=function(e){var t=this,r=e.nativeDocument,n=r.json.textures||[];return(r.json.materials||[]).forEach(function(r,a){if(r.extensions&&r.extensions[o]){var i=t.createClearcoat();if(e.materials[a].setExtension(s,i),void 0!==r.extensions[o].clearcoatFactor&&i.setClearcoatFactor(r.extensions[o].clearcoatFactor),void 0!==r.extensions[o].clearcoatRoughnessFactor&&i.setClearcoatRoughnessFactor(r.extensions[o].clearcoatRoughnessFactor),void 0!==r.extensions[o].clearcoatTexture){var u=r.extensions[o].clearcoatTexture;i.setClearcoatTexture(e.textures[n[u.index].source]),e.setTextureInfo(i.getClearcoatTextureInfo(),u),e.setTextureSampler(i.getClearcoatTextureSampler(),u)}if(void 0!==r.extensions[o].clearcoatRoughnessTexture){var c=r.extensions[o].clearcoatRoughnessTexture;i.setClearcoatRoughnessTexture(e.textures[n[c.index].source]),e.setTextureInfo(i.getClearcoatRoughnessTextureInfo(),c),e.setTextureSampler(i.getClearcoatRoughnessTextureSampler(),c)}if(void 0!==r.extensions[o].clearcoatNormalTexture){var l=r.extensions[o].clearcoatNormalTexture;i.setClearcoatNormalTexture(e.textures[n[l.index].source]),e.setTextureInfo(i.getClearcoatNormalTextureInfo(),l),e.setTextureSampler(i.getClearcoatNormalTextureSampler(),l),void 0!==l.scale&&i.setClearcoatNormalScale(l.scale)}}}),this},n.write=function(e){var t=e.nativeDocument;return this.doc.getRoot().listMaterials().forEach(function(r){var n=r.getExtension(s);if(n){var a=e.materialIndexMap.get(r),i=t.json.materials[a];if(i.extensions=i.extensions||{},i.extensions[o]={clearcoatFactor:n.getClearcoatFactor(),clearcoatRoughnessFactor:n.getClearcoatRoughnessFactor()},n.getClearcoatTexture()){var u=n.getClearcoatTexture(),c=n.getClearcoatTextureInfo(),l=n.getClearcoatTextureSampler();i.extensions[o].clearcoatTexture=e.createTextureInfoDef(u,c,l)}if(n.getClearcoatRoughnessTexture()){var x=n.getClearcoatRoughnessTexture(),p=n.getClearcoatRoughnessTextureInfo(),T=n.getClearcoatRoughnessTextureSampler();i.extensions[o].clearcoatRoughnessTexture=e.createTextureInfoDef(x,p,T)}if(n.getClearcoatNormalTexture()){var f=n.getClearcoatNormalTexture(),h=n.getClearcoatNormalTextureInfo(),m=n.getClearcoatNormalTextureSampler();i.extensions[o].clearcoatNormalTexture=e.createTextureInfoDef(f,h,m),1!==n.getClearcoatNormalScale()&&(i.extensions[o].clearcoatNormalTexture.scale=n.getClearcoatNormalScale())}}}),this},r}(e.Extension);n.EXTENSION_NAME=o;var a=function(r){function s(){var t;return(t=r.apply(this,arguments)||this).propertyType="IOR",t.parentTypes=[e.PropertyType.MATERIAL],t.extensionName="KHR_materials_ior",t._ior=0,t}t(s,r);var o=s.prototype;return o.copy=function(t,s){return void 0===s&&(s=e.COPY_IDENTITY),r.prototype.copy.call(this,t,s),this._ior=t._ior,this},o.getIOR=function(){return this._ior},o.setIOR=function(e){return this._ior=e,this},s}(e.ExtensionProperty);a.EXTENSION_NAME="KHR_materials_ior";var i="KHR_materials_ior",u=function(e){function r(){var t;return(t=e.apply(this,arguments)||this).extensionName=i,t}t(r,e);var s=r.prototype;return s.createIOR=function(){return new a(this.doc.getGraph(),this)},s.read=function(e){var t=this;return(e.nativeDocument.json.materials||[]).forEach(function(r,s){if(r.extensions&&r.extensions[i]){var o=t.createIOR();e.materials[s].setExtension(a,o),void 0!==r.extensions[i].ior&&o.setIOR(r.extensions[i].ior)}}),this},s.write=function(e){var t=e.nativeDocument;return this.doc.getRoot().listMaterials().forEach(function(r){var s=r.getExtension(a);if(s){var o=e.materialIndexMap.get(r),n=t.json.materials[o];n.extensions=n.extensions||{},n.extensions[i]={ior:s.getIOR()}}}),this},r}(e.Extension);u.EXTENSION_NAME=i;var c=function(r){function s(){var t;return(t=r.apply(this,arguments)||this).propertyType="PBRSpecularGlossiness",t.parentTypes=[e.PropertyType.MATERIAL],t.extensionName="KHR_materials_pbrSpecularGlossiness",t._diffuseFactor=[1,1,1,1],t._specularFactor=[1,1,1],t._glossinessFactor=1,t.diffuseTexture=null,t.specularGlossinessTexture=null,t}t(s,r);var o=s.prototype;return o.copy=function(t,s){return void 0===s&&(s=e.COPY_IDENTITY),r.prototype.copy.call(this,t,s),this._diffuseFactor=t._diffuseFactor,this._specularFactor=t._specularFactor,this._glossinessFactor=t._glossinessFactor,t.diffuseTexture&&(this.setDiffuseTexture(s(t.diffuseTexture.getChild())),this.diffuseTexture.copy(t.diffuseTexture)),t.specularGlossinessTexture&&(this.setSpecularGlossinessTexture(s(t.specularGlossinessTexture.getChild())),this.specularGlossinessTexture.copy(t.specularGlossinessTexture)),this},o.getDiffuseFactor=function(){return this._diffuseFactor},o.setDiffuseFactor=function(e){return this._diffuseFactor=e,this},o.getDiffuseTexture=function(){return this.diffuseTexture?this.diffuseTexture.getChild():null},o.getDiffuseTextureInfo=function(){return this.diffuseTexture?this.diffuseTexture.textureInfo:null},o.getDiffuseTextureSampler=function(){return this.diffuseTexture?this.diffuseTexture.sampler:null},o.setDiffuseTexture=function(e){return this.diffuseTexture=this.graph.linkTexture("diffuseTexture",this,e),this},o.getSpecularFactor=function(){return this._specularFactor},o.setSpecularFactor=function(e){return this._specularFactor=e,this},o.getGlossinessFactor=function(){return this._glossinessFactor},o.setGlossinessFactor=function(e){return this._glossinessFactor=e,this},o.getSpecularGlossinessTexture=function(){return this.specularGlossinessTexture?this.specularGlossinessTexture.getChild():null},o.getSpecularGlossinessTextureInfo=function(){return this.specularGlossinessTexture?this.specularGlossinessTexture.textureInfo:null},o.getSpecularGlossinessTextureSampler=function(){return this.specularGlossinessTexture?this.specularGlossinessTexture.sampler:null},o.setSpecularGlossinessTexture=function(e){return this.specularGlossinessTexture=this.graph.linkTexture("specularGlossinessTexture",this,e),this},s}(e.ExtensionProperty);c.EXTENSION_NAME="KHR_materials_pbrSpecularGlossiness",r([e.GraphChild],c.prototype,"diffuseTexture",void 0),r([e.GraphChild],c.prototype,"specularGlossinessTexture",void 0);var l="KHR_materials_pbrSpecularGlossiness",x=function(e){function r(){var t;return(t=e.apply(this,arguments)||this).extensionName=l,t}t(r,e);var s=r.prototype;return s.createPBRSpecularGlossiness=function(){return new c(this.doc.getGraph(),this)},s.read=function(e){var t=this,r=e.nativeDocument,s=r.json.textures||[];return(r.json.materials||[]).forEach(function(r,o){if(r.extensions&&r.extensions[l]){var n=t.createPBRSpecularGlossiness();if(e.materials[o].setExtension(c,n),void 0!==r.extensions[l].diffuseFactor&&n.setDiffuseFactor(r.extensions[l].diffuseFactor),void 0!==r.extensions[l].specularFactor&&n.setSpecularFactor(r.extensions[l].specularFactor),void 0!==r.extensions[l].glossinessFactor&&n.setGlossinessFactor(r.extensions[l].glossinessFactor),void 0!==r.extensions[l].diffuseTexture){var a=r.extensions[l].diffuseTexture;n.setDiffuseTexture(e.textures[s[a.index].source]),e.setTextureInfo(n.getDiffuseTextureInfo(),a),e.setTextureSampler(n.getDiffuseTextureSampler(),a)}if(void 0!==r.extensions[l].specularGlossinessTexture){var i=r.extensions[l].specularGlossinessTexture;n.setSpecularGlossinessTexture(e.textures[s[i.index].source]),e.setTextureInfo(n.getSpecularGlossinessTextureInfo(),i),e.setTextureSampler(n.getSpecularGlossinessTextureSampler(),i)}}}),this},s.write=function(e){var t=e.nativeDocument;return this.doc.getRoot().listMaterials().forEach(function(r){var s=r.getExtension(c);if(s){var o=e.materialIndexMap.get(r),n=t.json.materials[o];if(n.extensions=n.extensions||{},n.extensions[l]={diffuseFactor:s.getDiffuseFactor(),specularFactor:s.getSpecularFactor(),glossinessFactor:s.getGlossinessFactor()},s.getDiffuseTexture()){var a=s.getDiffuseTexture(),i=s.getDiffuseTextureInfo(),u=s.getDiffuseTextureSampler();n.extensions[l].diffuseTexture=e.createTextureInfoDef(a,i,u)}if(s.getSpecularGlossinessTexture()){var x=s.getSpecularGlossinessTexture(),p=s.getSpecularGlossinessTextureInfo(),T=s.getSpecularGlossinessTextureSampler();n.extensions[l].specularGlossinessTexture=e.createTextureInfoDef(x,p,T)}}}),this},r}(e.Extension);x.EXTENSION_NAME=l;var p=function(r){function s(){var t;return(t=r.apply(this,arguments)||this).propertyType="Specular",t.parentTypes=[e.PropertyType.MATERIAL],t.extensionName="KHR_materials_specular",t._specularFactor=1,t._specularColorFactor=[1,1,1],t.specularTexture=null,t}t(s,r);var o=s.prototype;return o.copy=function(t,s){return void 0===s&&(s=e.COPY_IDENTITY),r.prototype.copy.call(this,t,s),this._specularFactor=t._specularFactor,t.specularTexture&&(this.setSpecularTexture(s(t.specularTexture.getChild())),this.specularTexture.copy(t.specularTexture)),this},o.getSpecularFactor=function(){return this._specularFactor},o.setSpecularFactor=function(e){return this._specularFactor=e,this},o.getSpecularColorFactor=function(){return this._specularColorFactor},o.setSpecularColorFactor=function(e){return this._specularColorFactor=e,this},o.getSpecularTexture=function(){return this.specularTexture?this.specularTexture.getChild():null},o.getSpecularTextureInfo=function(){return this.specularTexture?this.specularTexture.textureInfo:null},o.getSpecularTextureSampler=function(){return this.specularTexture?this.specularTexture.sampler:null},o.setSpecularTexture=function(e){return this.specularTexture=this.graph.linkTexture("specularTexture",this,e),this},s}(e.ExtensionProperty);p.EXTENSION_NAME="KHR_materials_specular",r([e.GraphChild],p.prototype,"specularTexture",void 0);var T="KHR_materials_specular",f=function(e){function r(){var t;return(t=e.apply(this,arguments)||this).extensionName=T,t}t(r,e);var s=r.prototype;return s.createSpecular=function(){return new p(this.doc.getGraph(),this)},s.read=function(e){var t=this,r=e.nativeDocument,s=r.json.textures||[];return(r.json.materials||[]).forEach(function(r,o){if(r.extensions&&r.extensions[T]){var n=t.createSpecular();if(e.materials[o].setExtension(p,n),void 0!==r.extensions[T].specularFactor&&n.setSpecularFactor(r.extensions[T].specularFactor),void 0!==r.extensions[T].specularColorFactor&&n.setSpecularColorFactor(r.extensions[T].specularColorFactor),void 0!==r.extensions[T].specularTexture){var a=r.extensions[T].specularTexture;n.setSpecularTexture(e.textures[s[a.index].source]),e.setTextureInfo(n.getSpecularTextureInfo(),a),e.setTextureSampler(n.getSpecularTextureSampler(),a)}}}),this},s.write=function(e){var t=e.nativeDocument;return this.doc.getRoot().listMaterials().forEach(function(r){var s=r.getExtension(p);if(s){var o=e.materialIndexMap.get(r),n=t.json.materials[o];if(n.extensions=n.extensions||{},n.extensions[T]={specularFactor:s.getSpecularFactor(),specularColorFactor:s.getSpecularColorFactor()},s.getSpecularTexture()){var a=s.getSpecularTexture(),i=s.getSpecularTextureInfo(),u=s.getSpecularTextureSampler();n.extensions[T].specularTexture=e.createTextureInfoDef(a,i,u)}}}),this},r}(e.Extension);f.EXTENSION_NAME=T;var h=function(r){function s(){var t;return(t=r.apply(this,arguments)||this).propertyType="Transmission",t.parentTypes=[e.PropertyType.MATERIAL],t.extensionName="KHR_materials_transmission",t._transmissionFactor=0,t.transmissionTexture=null,t}t(s,r);var o=s.prototype;return o.copy=function(t,s){return void 0===s&&(s=e.COPY_IDENTITY),r.prototype.copy.call(this,t,s),this._transmissionFactor=t._transmissionFactor,t.transmissionTexture&&(this.setTransmissionTexture(s(t.transmissionTexture.getChild())),this.transmissionTexture.copy(t.transmissionTexture)),this},o.getTransmissionFactor=function(){return this._transmissionFactor},o.setTransmissionFactor=function(e){return this._transmissionFactor=e,this},o.getTransmissionTexture=function(){return this.transmissionTexture?this.transmissionTexture.getChild():null},o.getTransmissionTextureInfo=function(){return this.transmissionTexture?this.transmissionTexture.textureInfo:null},o.getTransmissionTextureSampler=function(){return this.transmissionTexture?this.transmissionTexture.sampler:null},o.setTransmissionTexture=function(e){return this.transmissionTexture=this.graph.linkTexture("transmissionTexture",this,e),this},s}(e.ExtensionProperty);h.EXTENSION_NAME="KHR_materials_transmission",r([e.GraphChild],h.prototype,"transmissionTexture",void 0);var m="KHR_materials_transmission",g=function(e){function r(){var t;return(t=e.apply(this,arguments)||this).extensionName=m,t}t(r,e);var s=r.prototype;return s.createTransmission=function(){return new h(this.doc.getGraph(),this)},s.read=function(e){var t=this,r=e.nativeDocument,s=r.json.textures||[];return(r.json.materials||[]).forEach(function(r,o){if(r.extensions&&r.extensions[m]){var n=t.createTransmission();if(e.materials[o].setExtension(h,n),void 0!==r.extensions[m].transmissionFactor&&n.setTransmissionFactor(r.extensions[m].transmissionFactor),void 0!==r.extensions[m].transmissionTexture){var a=r.extensions[m].transmissionTexture;n.setTransmissionTexture(e.textures[s[a.index].source]),e.setTextureInfo(n.getTransmissionTextureInfo(),a),e.setTextureSampler(n.getTransmissionTextureSampler(),a)}}}),this},s.write=function(e){var t=e.nativeDocument;return this.doc.getRoot().listMaterials().forEach(function(r){var s=r.getExtension(h);if(s){var o=e.materialIndexMap.get(r),n=t.json.materials[o];if(n.extensions=n.extensions||{},n.extensions[m]={transmissionFactor:s.getTransmissionFactor()},s.getTransmissionTexture()){var a=s.getTransmissionTexture(),i=s.getTransmissionTextureInfo(),u=s.getTransmissionTextureSampler();n.extensions[m].transmissionTexture=e.createTextureInfoDef(a,i,u)}}}),this},r}(e.Extension);g.EXTENSION_NAME=m;var v=function(r){function s(){var t;return(t=r.apply(this,arguments)||this).propertyType="Unlit",t.parentTypes=[e.PropertyType.MATERIAL],t.extensionName="KHR_materials_unlit",t}return t(s,r),s}(e.ExtensionProperty);v.EXTENSION_NAME="KHR_materials_unlit";var d="KHR_materials_unlit",_=function(e){function r(){var t;return(t=e.apply(this,arguments)||this).extensionName=d,t}t(r,e);var s=r.prototype;return s.createUnlit=function(){return new v(this.doc.getGraph(),this)},s.read=function(e){var t=this;return(e.nativeDocument.json.materials||[]).forEach(function(r,s){r.extensions&&r.extensions[d]&&e.materials[s].setExtension(v,t.createUnlit())}),this},s.write=function(e){var t=e.nativeDocument;return this.doc.getRoot().listMaterials().forEach(function(r){if(r.getExtension(v)){var s=e.materialIndexMap.get(r),o=t.json.materials[s];o.extensions=o.extensions||{},o.extensions[d]={}}}),this},r}(e.Extension);_.EXTENSION_NAME=d;var N="KHR_mesh_quantization",S=function(e){function r(){var t;return(t=e.apply(this,arguments)||this).extensionName=N,t}t(r,e);var s=r.prototype;return s.read=function(e){return this},s.write=function(e){return this},r}(e.Extension);S.EXTENSION_NAME=N;var y="KHR_texture_basisu",E=function(r){function s(){var t;return(t=r.apply(this,arguments)||this).extensionName=y,t.provideTypes=[e.PropertyType.TEXTURE],t}t(s,r);var o=s.prototype;return o.provide=function(e){return e.nativeDocument.json.textures.forEach(function(e){e.extensions&&e.extensions[y]&&(e.source=e.extensions[y].source)}),this},o.read=function(e){return this},o.write=function(e){var t=e.nativeDocument;return this.doc.getRoot().listTextures().forEach(function(r){if("image/ktx2"===r.getMimeType()){var s=e.imageIndexMap.get(r);t.json.textures.forEach(function(e){e.source===s&&(e.extensions=e.extensions||{},e.extensions[y]={source:e.source},delete e.source)})}}),this},s}(e.Extension);E.EXTENSION_NAME=y;var F=[n,u,x,f,g,_,S,E];exports.Clearcoat=s,exports.IOR=a,exports.KHRONOS_EXTENSIONS=F,exports.MaterialsClearcoat=n,exports.MaterialsIOR=u,exports.MaterialsPBRSpecularGlossiness=x,exports.MaterialsSpecular=f,exports.MaterialsTransmission=g,exports.MaterialsUnlit=_,exports.MeshQuantization=S,exports.PBRSpecularGlossiness=c,exports.Specular=p,exports.TextureBasisu=E,exports.Transmission=h,exports.Unlit=v; | ||
var e,t=require("@gltf-transform/core");function r(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,e.__proto__=t}function s(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,s=new Array(t);r<t;r++)s[r]=e[r];return s}(e=exports.LightType||(exports.LightType={})).POINT="point",e.SPOT="spot",e.DIRECTIONAL="directional";var n=function(e){function s(){var r;return(r=e.apply(this,arguments)||this).propertyType="Light",r.parentTypes=[t.PropertyType.NODE],r.extensionName="KHR_lights_punctual",r._color=[1,1,1],r._intensity=1,r._range=void 0,r._innerConeAngle=0,r._outerConeAngle=Math.PI/4,r}r(s,e);var n=s.prototype;return n.copy=function(r,s){return void 0===s&&(s=t.COPY_IDENTITY),e.prototype.copy.call(this,r,s),this._color=[].concat(r._color),this._intensity=r._intensity,this._type=r._type,this._range=r._range,this._innerConeAngle=r._innerConeAngle,this._outerConeAngle=r._outerConeAngle,this},n.getColor=function(){return this._color},n.setColor=function(e){return this._color=e,this},n.getIntensity=function(){return this._intensity},n.setIntensity=function(e){return this._intensity=e,this},n.getType=function(){return this._type},n.setType=function(e){return this._type=e,this},n.getRange=function(){return this._range},n.setRange=function(e){return this._range=e,this},n.getInnerConeAngle=function(){return this._innerConeAngle},n.setInnerConeAngle=function(e){return this._innerConeAngle=e,this},n.getOuterConeAngle=function(){return this._outerConeAngle},n.setOuterConeAngle=function(e){return this._outerConeAngle=e,this},s}(t.ExtensionProperty);n.EXTENSION_NAME="KHR_lights_punctual";var o="KHR_lights_punctual",a=function(e){function t(){var t;return(t=e.apply(this,arguments)||this).extensionName=o,t}r(t,e);var a=t.prototype;return a.createLight=function(){return new n(this.doc.getGraph(),this)},a.read=function(e){var t=this,r=e.nativeDocument;if(!r.json.extensions||!r.json.extensions[o])return this;var s=(r.json.extensions[o].lights||[]).map(function(e){var r=t.createLight().setName(e.name||"").setType(e.type);return void 0!==e.color&&r.setColor(e.color),void 0!==e.intensity&&r.setIntensity(e.intensity),void 0!==e.range&&r.setRange(e.range),void 0!==e.innerConeAngle&&r.setInnerConeAngle(e.innerConeAngle),void 0!==e.outerConeAngle&&r.setOuterConeAngle(e.outerConeAngle),r});return r.json.nodes.forEach(function(t,r){t.extensions&&t.extensions[o]&&e.nodes[r].setExtension(n,s[t.extensions[o].light])}),this},a.write=function(e){var t=e.nativeDocument;if(0===this.properties.size)return this;for(var r,a=[],i=new Map,u=function(e){var t=0;if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(e=function(e,t){if(e){if("string"==typeof e)return s(e,void 0);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?s(e,void 0):void 0}}(e)))return function(){return t>=e.length?{done:!0}:{done:!1,value:e[t++]}};throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}return(t=e[Symbol.iterator]()).next.bind(t)}(this.properties);!(r=u()).done;){var c=r.value,l={type:c.getType(),color:c.getColor(),intensity:c.getIntensity(),range:c.getRange()};c.getName()&&(l.name=c.getName()),c.getType()===exports.LightType.SPOT&&(l.innerConeAngle=c.getInnerConeAngle(),l.outerConeAngle=c.getOuterConeAngle()),a.push(l),i.set(c,a.length-1)}return this.doc.getRoot().listNodes().forEach(function(r){var s=r.getExtension(n);if(s){var a=e.nodeIndexMap.get(r),u=t.json.nodes[a];u.extensions=u.extensions||{},u.extensions[o]={light:i.get(s)}}}),t.json.extensions=t.json.extensions||{},t.json.extensions[o]={lights:a},this},t}(t.Extension);function i(e,t,r,s){var n,o=arguments.length,a=o<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,r):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,s);else for(var i=e.length-1;i>=0;i--)(n=e[i])&&(a=(o<3?n(a):o>3?n(t,r,a):n(t,r))||a);return o>3&&a&&Object.defineProperty(t,r,a),a}a.EXTENSION_NAME=o;var u=function(e){function s(){var r;return(r=e.apply(this,arguments)||this).propertyType="Clearcoat",r.parentTypes=[t.PropertyType.MATERIAL],r.extensionName="KHR_materials_clearcoat",r._clearcoatFactor=0,r._clearcoatRoughnessFactor=0,r._clearcoatNormalScale=1,r.clearcoatTexture=null,r.clearcoatRoughnessTexture=null,r.clearcoatNormalTexture=null,r}r(s,e);var n=s.prototype;return n.copy=function(r,s){return void 0===s&&(s=t.COPY_IDENTITY),e.prototype.copy.call(this,r,s),this._clearcoatFactor=r._clearcoatFactor,this._clearcoatRoughnessFactor=r._clearcoatRoughnessFactor,this._clearcoatNormalScale=r._clearcoatNormalScale,r.clearcoatTexture&&(this.setClearcoatTexture(s(r.clearcoatTexture.getChild())),this.clearcoatTexture.copy(r.clearcoatTexture)),r.clearcoatRoughnessTexture&&(this.setClearcoatRoughnessTexture(s(r.clearcoatRoughnessTexture.getChild())),this.clearcoatRoughnessTexture.copy(r.clearcoatRoughnessTexture)),r.clearcoatNormalTexture&&(this.setClearcoatNormalTexture(s(r.clearcoatNormalTexture.getChild())),this.clearcoatNormalTexture.copy(r.clearcoatNormalTexture)),this},n.getClearcoatFactor=function(){return this._clearcoatFactor},n.setClearcoatFactor=function(e){return this._clearcoatFactor=e,this},n.getClearcoatTexture=function(){return this.clearcoatTexture?this.clearcoatTexture.getChild():null},n.getClearcoatTextureInfo=function(){return this.clearcoatTexture?this.clearcoatTexture.textureInfo:null},n.getClearcoatTextureSampler=function(){return this.clearcoatTexture?this.clearcoatTexture.sampler:null},n.setClearcoatTexture=function(e){return this.clearcoatTexture=this.graph.linkTexture("clearcoatTexture",this,e),this},n.getClearcoatRoughnessFactor=function(){return this._clearcoatRoughnessFactor},n.setClearcoatRoughnessFactor=function(e){return this._clearcoatRoughnessFactor=e,this},n.getClearcoatRoughnessTexture=function(){return this.clearcoatRoughnessTexture?this.clearcoatRoughnessTexture.getChild():null},n.getClearcoatRoughnessTextureInfo=function(){return this.clearcoatRoughnessTexture?this.clearcoatRoughnessTexture.textureInfo:null},n.getClearcoatRoughnessTextureSampler=function(){return this.clearcoatRoughnessTexture?this.clearcoatRoughnessTexture.sampler:null},n.setClearcoatRoughnessTexture=function(e){return this.clearcoatRoughnessTexture=this.graph.linkTexture("clearcoatRoughnessTexture",this,e),this},n.getClearcoatNormalScale=function(){return this._clearcoatNormalScale},n.setClearcoatNormalScale=function(e){return this._clearcoatNormalScale=e,this},n.getClearcoatNormalTexture=function(){return this.clearcoatNormalTexture?this.clearcoatNormalTexture.getChild():null},n.getClearcoatNormalTextureInfo=function(){return this.clearcoatNormalTexture?this.clearcoatNormalTexture.textureInfo:null},n.getClearcoatNormalTextureSampler=function(){return this.clearcoatNormalTexture?this.clearcoatNormalTexture.sampler:null},n.setClearcoatNormalTexture=function(e){return this.clearcoatNormalTexture=this.graph.linkTexture("clearcoatNormalTexture",this,e),this},s}(t.ExtensionProperty);u.EXTENSION_NAME="KHR_materials_clearcoat",i([t.GraphChild],u.prototype,"clearcoatTexture",void 0),i([t.GraphChild],u.prototype,"clearcoatRoughnessTexture",void 0),i([t.GraphChild],u.prototype,"clearcoatNormalTexture",void 0);var c="KHR_materials_clearcoat",l=function(e){function t(){var t;return(t=e.apply(this,arguments)||this).extensionName=c,t}r(t,e);var s=t.prototype;return s.createClearcoat=function(){return new u(this.doc.getGraph(),this)},s.read=function(e){var t=this,r=e.nativeDocument,s=r.json.textures||[];return(r.json.materials||[]).forEach(function(r,n){if(r.extensions&&r.extensions[c]){var o=t.createClearcoat();if(e.materials[n].setExtension(u,o),void 0!==r.extensions[c].clearcoatFactor&&o.setClearcoatFactor(r.extensions[c].clearcoatFactor),void 0!==r.extensions[c].clearcoatRoughnessFactor&&o.setClearcoatRoughnessFactor(r.extensions[c].clearcoatRoughnessFactor),void 0!==r.extensions[c].clearcoatTexture){var a=r.extensions[c].clearcoatTexture;o.setClearcoatTexture(e.textures[s[a.index].source]),e.setTextureInfo(o.getClearcoatTextureInfo(),a),e.setTextureSampler(o.getClearcoatTextureSampler(),a)}if(void 0!==r.extensions[c].clearcoatRoughnessTexture){var i=r.extensions[c].clearcoatRoughnessTexture;o.setClearcoatRoughnessTexture(e.textures[s[i.index].source]),e.setTextureInfo(o.getClearcoatRoughnessTextureInfo(),i),e.setTextureSampler(o.getClearcoatRoughnessTextureSampler(),i)}if(void 0!==r.extensions[c].clearcoatNormalTexture){var l=r.extensions[c].clearcoatNormalTexture;o.setClearcoatNormalTexture(e.textures[s[l.index].source]),e.setTextureInfo(o.getClearcoatNormalTextureInfo(),l),e.setTextureSampler(o.getClearcoatNormalTextureSampler(),l),void 0!==l.scale&&o.setClearcoatNormalScale(l.scale)}}}),this},s.write=function(e){var t=e.nativeDocument;return this.doc.getRoot().listMaterials().forEach(function(r){var s=r.getExtension(u);if(s){var n=e.materialIndexMap.get(r),o=t.json.materials[n];if(o.extensions=o.extensions||{},o.extensions[c]={clearcoatFactor:s.getClearcoatFactor(),clearcoatRoughnessFactor:s.getClearcoatRoughnessFactor()},s.getClearcoatTexture()){var a=s.getClearcoatTexture(),i=s.getClearcoatTextureInfo(),l=s.getClearcoatTextureSampler();o.extensions[c].clearcoatTexture=e.createTextureInfoDef(a,i,l)}if(s.getClearcoatRoughnessTexture()){var x=s.getClearcoatRoughnessTexture(),p=s.getClearcoatRoughnessTextureInfo(),h=s.getClearcoatRoughnessTextureSampler();o.extensions[c].clearcoatRoughnessTexture=e.createTextureInfoDef(x,p,h)}if(s.getClearcoatNormalTexture()){var f=s.getClearcoatNormalTexture(),T=s.getClearcoatNormalTextureInfo(),g=s.getClearcoatNormalTextureSampler();o.extensions[c].clearcoatNormalTexture=e.createTextureInfoDef(f,T,g),1!==s.getClearcoatNormalScale()&&(o.extensions[c].clearcoatNormalTexture.scale=s.getClearcoatNormalScale())}}}),this},t}(t.Extension);l.EXTENSION_NAME=c;var x=function(e){function s(){var r;return(r=e.apply(this,arguments)||this).propertyType="IOR",r.parentTypes=[t.PropertyType.MATERIAL],r.extensionName="KHR_materials_ior",r._ior=0,r}r(s,e);var n=s.prototype;return n.copy=function(r,s){return void 0===s&&(s=t.COPY_IDENTITY),e.prototype.copy.call(this,r,s),this._ior=r._ior,this},n.getIOR=function(){return this._ior},n.setIOR=function(e){return this._ior=e,this},s}(t.ExtensionProperty);x.EXTENSION_NAME="KHR_materials_ior";var p="KHR_materials_ior",h=function(e){function t(){var t;return(t=e.apply(this,arguments)||this).extensionName=p,t}r(t,e);var s=t.prototype;return s.createIOR=function(){return new x(this.doc.getGraph(),this)},s.read=function(e){var t=this;return(e.nativeDocument.json.materials||[]).forEach(function(r,s){if(r.extensions&&r.extensions[p]){var n=t.createIOR();e.materials[s].setExtension(x,n),void 0!==r.extensions[p].ior&&n.setIOR(r.extensions[p].ior)}}),this},s.write=function(e){var t=e.nativeDocument;return this.doc.getRoot().listMaterials().forEach(function(r){var s=r.getExtension(x);if(s){var n=e.materialIndexMap.get(r),o=t.json.materials[n];o.extensions=o.extensions||{},o.extensions[p]={ior:s.getIOR()}}}),this},t}(t.Extension);h.EXTENSION_NAME=p;var f=function(e){function s(){var r;return(r=e.apply(this,arguments)||this).propertyType="PBRSpecularGlossiness",r.parentTypes=[t.PropertyType.MATERIAL],r.extensionName="KHR_materials_pbrSpecularGlossiness",r._diffuseFactor=[1,1,1,1],r._specularFactor=[1,1,1],r._glossinessFactor=1,r.diffuseTexture=null,r.specularGlossinessTexture=null,r}r(s,e);var n=s.prototype;return n.copy=function(r,s){return void 0===s&&(s=t.COPY_IDENTITY),e.prototype.copy.call(this,r,s),this._diffuseFactor=r._diffuseFactor,this._specularFactor=r._specularFactor,this._glossinessFactor=r._glossinessFactor,r.diffuseTexture&&(this.setDiffuseTexture(s(r.diffuseTexture.getChild())),this.diffuseTexture.copy(r.diffuseTexture)),r.specularGlossinessTexture&&(this.setSpecularGlossinessTexture(s(r.specularGlossinessTexture.getChild())),this.specularGlossinessTexture.copy(r.specularGlossinessTexture)),this},n.getDiffuseFactor=function(){return this._diffuseFactor},n.setDiffuseFactor=function(e){return this._diffuseFactor=e,this},n.getDiffuseTexture=function(){return this.diffuseTexture?this.diffuseTexture.getChild():null},n.getDiffuseTextureInfo=function(){return this.diffuseTexture?this.diffuseTexture.textureInfo:null},n.getDiffuseTextureSampler=function(){return this.diffuseTexture?this.diffuseTexture.sampler:null},n.setDiffuseTexture=function(e){return this.diffuseTexture=this.graph.linkTexture("diffuseTexture",this,e),this},n.getSpecularFactor=function(){return this._specularFactor},n.setSpecularFactor=function(e){return this._specularFactor=e,this},n.getGlossinessFactor=function(){return this._glossinessFactor},n.setGlossinessFactor=function(e){return this._glossinessFactor=e,this},n.getSpecularGlossinessTexture=function(){return this.specularGlossinessTexture?this.specularGlossinessTexture.getChild():null},n.getSpecularGlossinessTextureInfo=function(){return this.specularGlossinessTexture?this.specularGlossinessTexture.textureInfo:null},n.getSpecularGlossinessTextureSampler=function(){return this.specularGlossinessTexture?this.specularGlossinessTexture.sampler:null},n.setSpecularGlossinessTexture=function(e){return this.specularGlossinessTexture=this.graph.linkTexture("specularGlossinessTexture",this,e),this},s}(t.ExtensionProperty);f.EXTENSION_NAME="KHR_materials_pbrSpecularGlossiness",i([t.GraphChild],f.prototype,"diffuseTexture",void 0),i([t.GraphChild],f.prototype,"specularGlossinessTexture",void 0);var T="KHR_materials_pbrSpecularGlossiness",g=function(e){function t(){var t;return(t=e.apply(this,arguments)||this).extensionName=T,t}r(t,e);var s=t.prototype;return s.createPBRSpecularGlossiness=function(){return new f(this.doc.getGraph(),this)},s.read=function(e){var t=this,r=e.nativeDocument,s=r.json.textures||[];return(r.json.materials||[]).forEach(function(r,n){if(r.extensions&&r.extensions[T]){var o=t.createPBRSpecularGlossiness();if(e.materials[n].setExtension(f,o),void 0!==r.extensions[T].diffuseFactor&&o.setDiffuseFactor(r.extensions[T].diffuseFactor),void 0!==r.extensions[T].specularFactor&&o.setSpecularFactor(r.extensions[T].specularFactor),void 0!==r.extensions[T].glossinessFactor&&o.setGlossinessFactor(r.extensions[T].glossinessFactor),void 0!==r.extensions[T].diffuseTexture){var a=r.extensions[T].diffuseTexture;o.setDiffuseTexture(e.textures[s[a.index].source]),e.setTextureInfo(o.getDiffuseTextureInfo(),a),e.setTextureSampler(o.getDiffuseTextureSampler(),a)}if(void 0!==r.extensions[T].specularGlossinessTexture){var i=r.extensions[T].specularGlossinessTexture;o.setSpecularGlossinessTexture(e.textures[s[i.index].source]),e.setTextureInfo(o.getSpecularGlossinessTextureInfo(),i),e.setTextureSampler(o.getSpecularGlossinessTextureSampler(),i)}}}),this},s.write=function(e){var t=e.nativeDocument;return this.doc.getRoot().listMaterials().forEach(function(r){var s=r.getExtension(f);if(s){var n=e.materialIndexMap.get(r),o=t.json.materials[n];if(o.extensions=o.extensions||{},o.extensions[T]={diffuseFactor:s.getDiffuseFactor(),specularFactor:s.getSpecularFactor(),glossinessFactor:s.getGlossinessFactor()},s.getDiffuseTexture()){var a=s.getDiffuseTexture(),i=s.getDiffuseTextureInfo(),u=s.getDiffuseTextureSampler();o.extensions[T].diffuseTexture=e.createTextureInfoDef(a,i,u)}if(s.getSpecularGlossinessTexture()){var c=s.getSpecularGlossinessTexture(),l=s.getSpecularGlossinessTextureInfo(),x=s.getSpecularGlossinessTextureSampler();o.extensions[T].specularGlossinessTexture=e.createTextureInfoDef(c,l,x)}}}),this},t}(t.Extension);g.EXTENSION_NAME=T;var m=function(e){function s(){var r;return(r=e.apply(this,arguments)||this).propertyType="Specular",r.parentTypes=[t.PropertyType.MATERIAL],r.extensionName="KHR_materials_specular",r._specularFactor=1,r._specularColorFactor=[1,1,1],r.specularTexture=null,r}r(s,e);var n=s.prototype;return n.copy=function(r,s){return void 0===s&&(s=t.COPY_IDENTITY),e.prototype.copy.call(this,r,s),this._specularFactor=r._specularFactor,r.specularTexture&&(this.setSpecularTexture(s(r.specularTexture.getChild())),this.specularTexture.copy(r.specularTexture)),this},n.getSpecularFactor=function(){return this._specularFactor},n.setSpecularFactor=function(e){return this._specularFactor=e,this},n.getSpecularColorFactor=function(){return this._specularColorFactor},n.setSpecularColorFactor=function(e){return this._specularColorFactor=e,this},n.getSpecularTexture=function(){return this.specularTexture?this.specularTexture.getChild():null},n.getSpecularTextureInfo=function(){return this.specularTexture?this.specularTexture.textureInfo:null},n.getSpecularTextureSampler=function(){return this.specularTexture?this.specularTexture.sampler:null},n.setSpecularTexture=function(e){return this.specularTexture=this.graph.linkTexture("specularTexture",this,e),this},s}(t.ExtensionProperty);m.EXTENSION_NAME="KHR_materials_specular",i([t.GraphChild],m.prototype,"specularTexture",void 0);var v="KHR_materials_specular",y=function(e){function t(){var t;return(t=e.apply(this,arguments)||this).extensionName=v,t}r(t,e);var s=t.prototype;return s.createSpecular=function(){return new m(this.doc.getGraph(),this)},s.read=function(e){var t=this,r=e.nativeDocument,s=r.json.textures||[];return(r.json.materials||[]).forEach(function(r,n){if(r.extensions&&r.extensions[v]){var o=t.createSpecular();if(e.materials[n].setExtension(m,o),void 0!==r.extensions[v].specularFactor&&o.setSpecularFactor(r.extensions[v].specularFactor),void 0!==r.extensions[v].specularColorFactor&&o.setSpecularColorFactor(r.extensions[v].specularColorFactor),void 0!==r.extensions[v].specularTexture){var a=r.extensions[v].specularTexture;o.setSpecularTexture(e.textures[s[a.index].source]),e.setTextureInfo(o.getSpecularTextureInfo(),a),e.setTextureSampler(o.getSpecularTextureSampler(),a)}}}),this},s.write=function(e){var t=e.nativeDocument;return this.doc.getRoot().listMaterials().forEach(function(r){var s=r.getExtension(m);if(s){var n=e.materialIndexMap.get(r),o=t.json.materials[n];if(o.extensions=o.extensions||{},o.extensions[v]={specularFactor:s.getSpecularFactor(),specularColorFactor:s.getSpecularColorFactor()},s.getSpecularTexture()){var a=s.getSpecularTexture(),i=s.getSpecularTextureInfo(),u=s.getSpecularTextureSampler();o.extensions[v].specularTexture=e.createTextureInfoDef(a,i,u)}}}),this},t}(t.Extension);y.EXTENSION_NAME=v;var _=function(e){function s(){var r;return(r=e.apply(this,arguments)||this).propertyType="Transmission",r.parentTypes=[t.PropertyType.MATERIAL],r.extensionName="KHR_materials_transmission",r._transmissionFactor=0,r.transmissionTexture=null,r}r(s,e);var n=s.prototype;return n.copy=function(r,s){return void 0===s&&(s=t.COPY_IDENTITY),e.prototype.copy.call(this,r,s),this._transmissionFactor=r._transmissionFactor,r.transmissionTexture&&(this.setTransmissionTexture(s(r.transmissionTexture.getChild())),this.transmissionTexture.copy(r.transmissionTexture)),this},n.getTransmissionFactor=function(){return this._transmissionFactor},n.setTransmissionFactor=function(e){return this._transmissionFactor=e,this},n.getTransmissionTexture=function(){return this.transmissionTexture?this.transmissionTexture.getChild():null},n.getTransmissionTextureInfo=function(){return this.transmissionTexture?this.transmissionTexture.textureInfo:null},n.getTransmissionTextureSampler=function(){return this.transmissionTexture?this.transmissionTexture.sampler:null},n.setTransmissionTexture=function(e){return this.transmissionTexture=this.graph.linkTexture("transmissionTexture",this,e),this},s}(t.ExtensionProperty);_.EXTENSION_NAME="KHR_materials_transmission",i([t.GraphChild],_.prototype,"transmissionTexture",void 0);var d="KHR_materials_transmission",C=function(e){function t(){var t;return(t=e.apply(this,arguments)||this).extensionName=d,t}r(t,e);var s=t.prototype;return s.createTransmission=function(){return new _(this.doc.getGraph(),this)},s.read=function(e){var t=this,r=e.nativeDocument,s=r.json.textures||[];return(r.json.materials||[]).forEach(function(r,n){if(r.extensions&&r.extensions[d]){var o=t.createTransmission();if(e.materials[n].setExtension(_,o),void 0!==r.extensions[d].transmissionFactor&&o.setTransmissionFactor(r.extensions[d].transmissionFactor),void 0!==r.extensions[d].transmissionTexture){var a=r.extensions[d].transmissionTexture;o.setTransmissionTexture(e.textures[s[a.index].source]),e.setTextureInfo(o.getTransmissionTextureInfo(),a),e.setTextureSampler(o.getTransmissionTextureSampler(),a)}}}),this},s.write=function(e){var t=e.nativeDocument;return this.doc.getRoot().listMaterials().forEach(function(r){var s=r.getExtension(_);if(s){var n=e.materialIndexMap.get(r),o=t.json.materials[n];if(o.extensions=o.extensions||{},o.extensions[d]={transmissionFactor:s.getTransmissionFactor()},s.getTransmissionTexture()){var a=s.getTransmissionTexture(),i=s.getTransmissionTextureInfo(),u=s.getTransmissionTextureSampler();o.extensions[d].transmissionTexture=e.createTextureInfoDef(a,i,u)}}}),this},t}(t.Extension);C.EXTENSION_NAME=d;var N=function(e){function s(){var r;return(r=e.apply(this,arguments)||this).propertyType="Unlit",r.parentTypes=[t.PropertyType.MATERIAL],r.extensionName="KHR_materials_unlit",r}return r(s,e),s}(t.ExtensionProperty);N.EXTENSION_NAME="KHR_materials_unlit";var E="KHR_materials_unlit",S=function(e){function t(){var t;return(t=e.apply(this,arguments)||this).extensionName=E,t}r(t,e);var s=t.prototype;return s.createUnlit=function(){return new N(this.doc.getGraph(),this)},s.read=function(e){var t=this;return(e.nativeDocument.json.materials||[]).forEach(function(r,s){r.extensions&&r.extensions[E]&&e.materials[s].setExtension(N,t.createUnlit())}),this},s.write=function(e){var t=e.nativeDocument;return this.doc.getRoot().listMaterials().forEach(function(r){if(r.getExtension(N)){var s=e.materialIndexMap.get(r),n=t.json.materials[s];n.extensions=n.extensions||{},n.extensions[E]={}}}),this},t}(t.Extension);S.EXTENSION_NAME=E;var I="KHR_mesh_quantization",R=function(e){function t(){var t;return(t=e.apply(this,arguments)||this).extensionName=I,t}r(t,e);var s=t.prototype;return s.read=function(e){return this},s.write=function(e){return this},t}(t.Extension);R.EXTENSION_NAME=I;var F="KHR_texture_basisu",A=function(e){function s(){var r;return(r=e.apply(this,arguments)||this).extensionName=F,r.provideTypes=[t.PropertyType.TEXTURE],r}r(s,e);var n=s.prototype;return n.provide=function(e){return e.nativeDocument.json.textures.forEach(function(e){e.extensions&&e.extensions[F]&&(e.source=e.extensions[F].source)}),this},n.read=function(e){return this},n.write=function(e){var t=e.nativeDocument;return this.doc.getRoot().listTextures().forEach(function(r){if("image/ktx2"===r.getMimeType()){var s=e.imageIndexMap.get(r);t.json.textures.forEach(function(e){e.source===s&&(e.extensions=e.extensions||{},e.extensions[F]={source:e.source},delete e.source)})}}),this},s}(t.Extension);A.EXTENSION_NAME=F;var G=[a,l,h,g,y,C,S,R,A];exports.Clearcoat=u,exports.IOR=x,exports.KHRONOS_EXTENSIONS=G,exports.Light=n,exports.LightsPunctual=a,exports.MaterialsClearcoat=l,exports.MaterialsIOR=h,exports.MaterialsPBRSpecularGlossiness=g,exports.MaterialsSpecular=y,exports.MaterialsTransmission=C,exports.MaterialsUnlit=S,exports.MeshQuantization=R,exports.PBRSpecularGlossiness=f,exports.Specular=m,exports.TextureBasisu=A,exports.Transmission=_,exports.Unlit=N; | ||
//# sourceMappingURL=extensions.js.map |
@@ -1,2 +0,2 @@ | ||
import{ExtensionProperty as e,PropertyType as t,COPY_IDENTITY as s,GraphChild as r,Extension as o}from"@gltf-transform/core";function a(e,t,s,r){var o,a=arguments.length,n=a<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,s):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,s,r);else for(var i=e.length-1;i>=0;i--)(o=e[i])&&(n=(a<3?o(n):a>3?o(t,s,n):o(t,s))||n);return a>3&&n&&Object.defineProperty(t,s,n),n}class n extends e{constructor(){super(...arguments),this.propertyType="Clearcoat",this.parentTypes=[t.MATERIAL],this.extensionName="KHR_materials_clearcoat",this._clearcoatFactor=0,this._clearcoatRoughnessFactor=0,this._clearcoatNormalScale=1,this.clearcoatTexture=null,this.clearcoatRoughnessTexture=null,this.clearcoatNormalTexture=null}copy(e,t=s){return super.copy(e,t),this._clearcoatFactor=e._clearcoatFactor,this._clearcoatRoughnessFactor=e._clearcoatRoughnessFactor,this._clearcoatNormalScale=e._clearcoatNormalScale,e.clearcoatTexture&&(this.setClearcoatTexture(t(e.clearcoatTexture.getChild())),this.clearcoatTexture.copy(e.clearcoatTexture)),e.clearcoatRoughnessTexture&&(this.setClearcoatRoughnessTexture(t(e.clearcoatRoughnessTexture.getChild())),this.clearcoatRoughnessTexture.copy(e.clearcoatRoughnessTexture)),e.clearcoatNormalTexture&&(this.setClearcoatNormalTexture(t(e.clearcoatNormalTexture.getChild())),this.clearcoatNormalTexture.copy(e.clearcoatNormalTexture)),this}getClearcoatFactor(){return this._clearcoatFactor}setClearcoatFactor(e){return this._clearcoatFactor=e,this}getClearcoatTexture(){return this.clearcoatTexture?this.clearcoatTexture.getChild():null}getClearcoatTextureInfo(){return this.clearcoatTexture?this.clearcoatTexture.textureInfo:null}getClearcoatTextureSampler(){return this.clearcoatTexture?this.clearcoatTexture.sampler:null}setClearcoatTexture(e){return this.clearcoatTexture=this.graph.linkTexture("clearcoatTexture",this,e),this}getClearcoatRoughnessFactor(){return this._clearcoatRoughnessFactor}setClearcoatRoughnessFactor(e){return this._clearcoatRoughnessFactor=e,this}getClearcoatRoughnessTexture(){return this.clearcoatRoughnessTexture?this.clearcoatRoughnessTexture.getChild():null}getClearcoatRoughnessTextureInfo(){return this.clearcoatRoughnessTexture?this.clearcoatRoughnessTexture.textureInfo:null}getClearcoatRoughnessTextureSampler(){return this.clearcoatRoughnessTexture?this.clearcoatRoughnessTexture.sampler:null}setClearcoatRoughnessTexture(e){return this.clearcoatRoughnessTexture=this.graph.linkTexture("clearcoatRoughnessTexture",this,e),this}getClearcoatNormalScale(){return this._clearcoatNormalScale}setClearcoatNormalScale(e){return this._clearcoatNormalScale=e,this}getClearcoatNormalTexture(){return this.clearcoatNormalTexture?this.clearcoatNormalTexture.getChild():null}getClearcoatNormalTextureInfo(){return this.clearcoatNormalTexture?this.clearcoatNormalTexture.textureInfo:null}getClearcoatNormalTextureSampler(){return this.clearcoatNormalTexture?this.clearcoatNormalTexture.sampler:null}setClearcoatNormalTexture(e){return this.clearcoatNormalTexture=this.graph.linkTexture("clearcoatNormalTexture",this,e),this}}n.EXTENSION_NAME="KHR_materials_clearcoat",a([r],n.prototype,"clearcoatTexture",void 0),a([r],n.prototype,"clearcoatRoughnessTexture",void 0),a([r],n.prototype,"clearcoatNormalTexture",void 0);const i="KHR_materials_clearcoat";class u extends o{constructor(){super(...arguments),this.extensionName=i}createClearcoat(){return new n(this.doc.getGraph(),this)}read(e){const t=e.nativeDocument,s=t.json.textures||[];return(t.json.materials||[]).forEach((t,r)=>{if(t.extensions&&t.extensions[i]){const o=this.createClearcoat();if(e.materials[r].setExtension(n,o),void 0!==t.extensions[i].clearcoatFactor&&o.setClearcoatFactor(t.extensions[i].clearcoatFactor),void 0!==t.extensions[i].clearcoatRoughnessFactor&&o.setClearcoatRoughnessFactor(t.extensions[i].clearcoatRoughnessFactor),void 0!==t.extensions[i].clearcoatTexture){const r=t.extensions[i].clearcoatTexture;o.setClearcoatTexture(e.textures[s[r.index].source]),e.setTextureInfo(o.getClearcoatTextureInfo(),r),e.setTextureSampler(o.getClearcoatTextureSampler(),r)}if(void 0!==t.extensions[i].clearcoatRoughnessTexture){const r=t.extensions[i].clearcoatRoughnessTexture;o.setClearcoatRoughnessTexture(e.textures[s[r.index].source]),e.setTextureInfo(o.getClearcoatRoughnessTextureInfo(),r),e.setTextureSampler(o.getClearcoatRoughnessTextureSampler(),r)}if(void 0!==t.extensions[i].clearcoatNormalTexture){const r=t.extensions[i].clearcoatNormalTexture;o.setClearcoatNormalTexture(e.textures[s[r.index].source]),e.setTextureInfo(o.getClearcoatNormalTextureInfo(),r),e.setTextureSampler(o.getClearcoatNormalTextureSampler(),r),void 0!==r.scale&&o.setClearcoatNormalScale(r.scale)}}}),this}write(e){const t=e.nativeDocument;return this.doc.getRoot().listMaterials().forEach(s=>{const r=s.getExtension(n);if(r){const o=e.materialIndexMap.get(s),a=t.json.materials[o];if(a.extensions=a.extensions||{},a.extensions[i]={clearcoatFactor:r.getClearcoatFactor(),clearcoatRoughnessFactor:r.getClearcoatRoughnessFactor()},r.getClearcoatTexture()){const t=r.getClearcoatTexture(),s=r.getClearcoatTextureInfo(),o=r.getClearcoatTextureSampler();a.extensions[i].clearcoatTexture=e.createTextureInfoDef(t,s,o)}if(r.getClearcoatRoughnessTexture()){const t=r.getClearcoatRoughnessTexture(),s=r.getClearcoatRoughnessTextureInfo(),o=r.getClearcoatRoughnessTextureSampler();a.extensions[i].clearcoatRoughnessTexture=e.createTextureInfoDef(t,s,o)}if(r.getClearcoatNormalTexture()){const t=r.getClearcoatNormalTexture(),s=r.getClearcoatNormalTextureInfo(),o=r.getClearcoatNormalTextureSampler();a.extensions[i].clearcoatNormalTexture=e.createTextureInfoDef(t,s,o),1!==r.getClearcoatNormalScale()&&(a.extensions[i].clearcoatNormalTexture.scale=r.getClearcoatNormalScale())}}}),this}}u.EXTENSION_NAME=i;class c extends e{constructor(){super(...arguments),this.propertyType="IOR",this.parentTypes=[t.MATERIAL],this.extensionName="KHR_materials_ior",this._ior=0}copy(e,t=s){return super.copy(e,t),this._ior=e._ior,this}getIOR(){return this._ior}setIOR(e){return this._ior=e,this}}c.EXTENSION_NAME="KHR_materials_ior";const l="KHR_materials_ior";class x extends o{constructor(){super(...arguments),this.extensionName=l}createIOR(){return new c(this.doc.getGraph(),this)}read(e){return(e.nativeDocument.json.materials||[]).forEach((t,s)=>{if(t.extensions&&t.extensions[l]){const r=this.createIOR();e.materials[s].setExtension(c,r),void 0!==t.extensions[l].ior&&r.setIOR(t.extensions[l].ior)}}),this}write(e){const t=e.nativeDocument;return this.doc.getRoot().listMaterials().forEach(s=>{const r=s.getExtension(c);if(r){const o=e.materialIndexMap.get(s),a=t.json.materials[o];a.extensions=a.extensions||{},a.extensions[l]={ior:r.getIOR()}}}),this}}x.EXTENSION_NAME=l;class h extends e{constructor(){super(...arguments),this.propertyType="PBRSpecularGlossiness",this.parentTypes=[t.MATERIAL],this.extensionName="KHR_materials_pbrSpecularGlossiness",this._diffuseFactor=[1,1,1,1],this._specularFactor=[1,1,1],this._glossinessFactor=1,this.diffuseTexture=null,this.specularGlossinessTexture=null}copy(e,t=s){return super.copy(e,t),this._diffuseFactor=e._diffuseFactor,this._specularFactor=e._specularFactor,this._glossinessFactor=e._glossinessFactor,e.diffuseTexture&&(this.setDiffuseTexture(t(e.diffuseTexture.getChild())),this.diffuseTexture.copy(e.diffuseTexture)),e.specularGlossinessTexture&&(this.setSpecularGlossinessTexture(t(e.specularGlossinessTexture.getChild())),this.specularGlossinessTexture.copy(e.specularGlossinessTexture)),this}getDiffuseFactor(){return this._diffuseFactor}setDiffuseFactor(e){return this._diffuseFactor=e,this}getDiffuseTexture(){return this.diffuseTexture?this.diffuseTexture.getChild():null}getDiffuseTextureInfo(){return this.diffuseTexture?this.diffuseTexture.textureInfo:null}getDiffuseTextureSampler(){return this.diffuseTexture?this.diffuseTexture.sampler:null}setDiffuseTexture(e){return this.diffuseTexture=this.graph.linkTexture("diffuseTexture",this,e),this}getSpecularFactor(){return this._specularFactor}setSpecularFactor(e){return this._specularFactor=e,this}getGlossinessFactor(){return this._glossinessFactor}setGlossinessFactor(e){return this._glossinessFactor=e,this}getSpecularGlossinessTexture(){return this.specularGlossinessTexture?this.specularGlossinessTexture.getChild():null}getSpecularGlossinessTextureInfo(){return this.specularGlossinessTexture?this.specularGlossinessTexture.textureInfo:null}getSpecularGlossinessTextureSampler(){return this.specularGlossinessTexture?this.specularGlossinessTexture.sampler:null}setSpecularGlossinessTexture(e){return this.specularGlossinessTexture=this.graph.linkTexture("specularGlossinessTexture",this,e),this}}h.EXTENSION_NAME="KHR_materials_pbrSpecularGlossiness",a([r],h.prototype,"diffuseTexture",void 0),a([r],h.prototype,"specularGlossinessTexture",void 0);const T="KHR_materials_pbrSpecularGlossiness";class p extends o{constructor(){super(...arguments),this.extensionName=T}createPBRSpecularGlossiness(){return new h(this.doc.getGraph(),this)}read(e){const t=e.nativeDocument,s=t.json.textures||[];return(t.json.materials||[]).forEach((t,r)=>{if(t.extensions&&t.extensions[T]){const o=this.createPBRSpecularGlossiness();if(e.materials[r].setExtension(h,o),void 0!==t.extensions[T].diffuseFactor&&o.setDiffuseFactor(t.extensions[T].diffuseFactor),void 0!==t.extensions[T].specularFactor&&o.setSpecularFactor(t.extensions[T].specularFactor),void 0!==t.extensions[T].glossinessFactor&&o.setGlossinessFactor(t.extensions[T].glossinessFactor),void 0!==t.extensions[T].diffuseTexture){const r=t.extensions[T].diffuseTexture;o.setDiffuseTexture(e.textures[s[r.index].source]),e.setTextureInfo(o.getDiffuseTextureInfo(),r),e.setTextureSampler(o.getDiffuseTextureSampler(),r)}if(void 0!==t.extensions[T].specularGlossinessTexture){const r=t.extensions[T].specularGlossinessTexture;o.setSpecularGlossinessTexture(e.textures[s[r.index].source]),e.setTextureInfo(o.getSpecularGlossinessTextureInfo(),r),e.setTextureSampler(o.getSpecularGlossinessTextureSampler(),r)}}}),this}write(e){const t=e.nativeDocument;return this.doc.getRoot().listMaterials().forEach(s=>{const r=s.getExtension(h);if(r){const o=e.materialIndexMap.get(s),a=t.json.materials[o];if(a.extensions=a.extensions||{},a.extensions[T]={diffuseFactor:r.getDiffuseFactor(),specularFactor:r.getSpecularFactor(),glossinessFactor:r.getGlossinessFactor()},r.getDiffuseTexture()){const t=r.getDiffuseTexture(),s=r.getDiffuseTextureInfo(),o=r.getDiffuseTextureSampler();a.extensions[T].diffuseTexture=e.createTextureInfoDef(t,s,o)}if(r.getSpecularGlossinessTexture()){const t=r.getSpecularGlossinessTexture(),s=r.getSpecularGlossinessTextureInfo(),o=r.getSpecularGlossinessTextureSampler();a.extensions[T].specularGlossinessTexture=e.createTextureInfoDef(t,s,o)}}}),this}}p.EXTENSION_NAME=T;class m extends e{constructor(){super(...arguments),this.propertyType="Specular",this.parentTypes=[t.MATERIAL],this.extensionName="KHR_materials_specular",this._specularFactor=1,this._specularColorFactor=[1,1,1],this.specularTexture=null}copy(e,t=s){return super.copy(e,t),this._specularFactor=e._specularFactor,e.specularTexture&&(this.setSpecularTexture(t(e.specularTexture.getChild())),this.specularTexture.copy(e.specularTexture)),this}getSpecularFactor(){return this._specularFactor}setSpecularFactor(e){return this._specularFactor=e,this}getSpecularColorFactor(){return this._specularColorFactor}setSpecularColorFactor(e){return this._specularColorFactor=e,this}getSpecularTexture(){return this.specularTexture?this.specularTexture.getChild():null}getSpecularTextureInfo(){return this.specularTexture?this.specularTexture.textureInfo:null}getSpecularTextureSampler(){return this.specularTexture?this.specularTexture.sampler:null}setSpecularTexture(e){return this.specularTexture=this.graph.linkTexture("specularTexture",this,e),this}}m.EXTENSION_NAME="KHR_materials_specular",a([r],m.prototype,"specularTexture",void 0);const g="KHR_materials_specular";class f extends o{constructor(){super(...arguments),this.extensionName=g}createSpecular(){return new m(this.doc.getGraph(),this)}read(e){const t=e.nativeDocument,s=t.json.textures||[];return(t.json.materials||[]).forEach((t,r)=>{if(t.extensions&&t.extensions[g]){const o=this.createSpecular();if(e.materials[r].setExtension(m,o),void 0!==t.extensions[g].specularFactor&&o.setSpecularFactor(t.extensions[g].specularFactor),void 0!==t.extensions[g].specularColorFactor&&o.setSpecularColorFactor(t.extensions[g].specularColorFactor),void 0!==t.extensions[g].specularTexture){const r=t.extensions[g].specularTexture;o.setSpecularTexture(e.textures[s[r.index].source]),e.setTextureInfo(o.getSpecularTextureInfo(),r),e.setTextureSampler(o.getSpecularTextureSampler(),r)}}}),this}write(e){const t=e.nativeDocument;return this.doc.getRoot().listMaterials().forEach(s=>{const r=s.getExtension(m);if(r){const o=e.materialIndexMap.get(s),a=t.json.materials[o];if(a.extensions=a.extensions||{},a.extensions[g]={specularFactor:r.getSpecularFactor(),specularColorFactor:r.getSpecularColorFactor()},r.getSpecularTexture()){const t=r.getSpecularTexture(),s=r.getSpecularTextureInfo(),o=r.getSpecularTextureSampler();a.extensions[g].specularTexture=e.createTextureInfoDef(t,s,o)}}}),this}}f.EXTENSION_NAME=g;class d extends e{constructor(){super(...arguments),this.propertyType="Transmission",this.parentTypes=[t.MATERIAL],this.extensionName="KHR_materials_transmission",this._transmissionFactor=0,this.transmissionTexture=null}copy(e,t=s){return super.copy(e,t),this._transmissionFactor=e._transmissionFactor,e.transmissionTexture&&(this.setTransmissionTexture(t(e.transmissionTexture.getChild())),this.transmissionTexture.copy(e.transmissionTexture)),this}getTransmissionFactor(){return this._transmissionFactor}setTransmissionFactor(e){return this._transmissionFactor=e,this}getTransmissionTexture(){return this.transmissionTexture?this.transmissionTexture.getChild():null}getTransmissionTextureInfo(){return this.transmissionTexture?this.transmissionTexture.textureInfo:null}getTransmissionTextureSampler(){return this.transmissionTexture?this.transmissionTexture.sampler:null}setTransmissionTexture(e){return this.transmissionTexture=this.graph.linkTexture("transmissionTexture",this,e),this}}d.EXTENSION_NAME="KHR_materials_transmission",a([r],d.prototype,"transmissionTexture",void 0);const _="KHR_materials_transmission";class S extends o{constructor(){super(...arguments),this.extensionName=_}createTransmission(){return new d(this.doc.getGraph(),this)}read(e){const t=e.nativeDocument,s=t.json.textures||[];return(t.json.materials||[]).forEach((t,r)=>{if(t.extensions&&t.extensions[_]){const o=this.createTransmission();if(e.materials[r].setExtension(d,o),void 0!==t.extensions[_].transmissionFactor&&o.setTransmissionFactor(t.extensions[_].transmissionFactor),void 0!==t.extensions[_].transmissionTexture){const r=t.extensions[_].transmissionTexture;o.setTransmissionTexture(e.textures[s[r.index].source]),e.setTextureInfo(o.getTransmissionTextureInfo(),r),e.setTextureSampler(o.getTransmissionTextureSampler(),r)}}}),this}write(e){const t=e.nativeDocument;return this.doc.getRoot().listMaterials().forEach(s=>{const r=s.getExtension(d);if(r){const o=e.materialIndexMap.get(s),a=t.json.materials[o];if(a.extensions=a.extensions||{},a.extensions[_]={transmissionFactor:r.getTransmissionFactor()},r.getTransmissionTexture()){const t=r.getTransmissionTexture(),s=r.getTransmissionTextureInfo(),o=r.getTransmissionTextureSampler();a.extensions[_].transmissionTexture=e.createTextureInfoDef(t,s,o)}}}),this}}S.EXTENSION_NAME=_;class N extends e{constructor(){super(...arguments),this.propertyType="Unlit",this.parentTypes=[t.MATERIAL],this.extensionName="KHR_materials_unlit"}}N.EXTENSION_NAME="KHR_materials_unlit";const F="KHR_materials_unlit";class R extends o{constructor(){super(...arguments),this.extensionName=F}createUnlit(){return new N(this.doc.getGraph(),this)}read(e){return(e.nativeDocument.json.materials||[]).forEach((t,s)=>{t.extensions&&t.extensions[F]&&e.materials[s].setExtension(N,this.createUnlit())}),this}write(e){const t=e.nativeDocument;return this.doc.getRoot().listMaterials().forEach(s=>{if(s.getExtension(N)){const r=e.materialIndexMap.get(s),o=t.json.materials[r];o.extensions=o.extensions||{},o.extensions[F]={}}}),this}}R.EXTENSION_NAME=F;const E="KHR_mesh_quantization";class C extends o{constructor(){super(...arguments),this.extensionName=E}read(e){return this}write(e){return this}}C.EXTENSION_NAME=E;const I="KHR_texture_basisu";class y extends o{constructor(){super(...arguments),this.extensionName=I,this.provideTypes=[t.TEXTURE]}provide(e){return e.nativeDocument.json.textures.forEach(e=>{e.extensions&&e.extensions[I]&&(e.source=e.extensions[I].source)}),this}read(e){return this}write(e){const t=e.nativeDocument;return this.doc.getRoot().listTextures().forEach(s=>{if("image/ktx2"===s.getMimeType()){const r=e.imageIndexMap.get(s);t.json.textures.forEach(e=>{e.source===r&&(e.extensions=e.extensions||{},e.extensions[I]={source:e.source},delete e.source)})}}),this}}y.EXTENSION_NAME=I;const G=[u,x,p,f,S,R,C,y];export{n as Clearcoat,c as IOR,G as KHRONOS_EXTENSIONS,u as MaterialsClearcoat,x as MaterialsIOR,p as MaterialsPBRSpecularGlossiness,f as MaterialsSpecular,S as MaterialsTransmission,R as MaterialsUnlit,C as MeshQuantization,h as PBRSpecularGlossiness,m as Specular,y as TextureBasisu,d as Transmission,N as Unlit}; | ||
import{ExtensionProperty as e,PropertyType as t,COPY_IDENTITY as s,Extension as r,GraphChild as o}from"@gltf-transform/core";var n;!function(e){e.POINT="point",e.SPOT="spot",e.DIRECTIONAL="directional"}(n||(n={}));class a extends e{constructor(){super(...arguments),this.propertyType="Light",this.parentTypes=[t.NODE],this.extensionName="KHR_lights_punctual",this._color=[1,1,1],this._intensity=1,this._range=void 0,this._innerConeAngle=0,this._outerConeAngle=Math.PI/4}copy(e,t=s){return super.copy(e,t),this._color=[...e._color],this._intensity=e._intensity,this._type=e._type,this._range=e._range,this._innerConeAngle=e._innerConeAngle,this._outerConeAngle=e._outerConeAngle,this}getColor(){return this._color}setColor(e){return this._color=e,this}getIntensity(){return this._intensity}setIntensity(e){return this._intensity=e,this}getType(){return this._type}setType(e){return this._type=e,this}getRange(){return this._range}setRange(e){return this._range=e,this}getInnerConeAngle(){return this._innerConeAngle}setInnerConeAngle(e){return this._innerConeAngle=e,this}getOuterConeAngle(){return this._outerConeAngle}setOuterConeAngle(e){return this._outerConeAngle=e,this}}a.EXTENSION_NAME="KHR_lights_punctual";const i="KHR_lights_punctual";class u extends r{constructor(){super(...arguments),this.extensionName=i}createLight(){return new a(this.doc.getGraph(),this)}read(e){const t=e.nativeDocument;if(!t.json.extensions||!t.json.extensions[i])return this;const s=(t.json.extensions[i].lights||[]).map(e=>{const t=this.createLight().setName(e.name||"").setType(e.type);return void 0!==e.color&&t.setColor(e.color),void 0!==e.intensity&&t.setIntensity(e.intensity),void 0!==e.range&&t.setRange(e.range),void 0!==e.innerConeAngle&&t.setInnerConeAngle(e.innerConeAngle),void 0!==e.outerConeAngle&&t.setOuterConeAngle(e.outerConeAngle),t});return t.json.nodes.forEach((t,r)=>{t.extensions&&t.extensions[i]&&e.nodes[r].setExtension(a,s[t.extensions[i].light])}),this}write(e){const t=e.nativeDocument;if(0===this.properties.size)return this;const s=[],r=new Map;for(const e of this.properties){const t=e,o={type:t.getType(),color:t.getColor(),intensity:t.getIntensity(),range:t.getRange()};t.getName()&&(o.name=t.getName()),t.getType()===n.SPOT&&(o.innerConeAngle=t.getInnerConeAngle(),o.outerConeAngle=t.getOuterConeAngle()),s.push(o),r.set(t,s.length-1)}return this.doc.getRoot().listNodes().forEach(s=>{const o=s.getExtension(a);if(o){const n=e.nodeIndexMap.get(s),a=t.json.nodes[n];a.extensions=a.extensions||{},a.extensions[i]={light:r.get(o)}}}),t.json.extensions=t.json.extensions||{},t.json.extensions[i]={lights:s},this}}function c(e,t,s,r){var o,n=arguments.length,a=n<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,s):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,s,r);else for(var i=e.length-1;i>=0;i--)(o=e[i])&&(a=(n<3?o(a):n>3?o(t,s,a):o(t,s))||a);return n>3&&a&&Object.defineProperty(t,s,a),a}u.EXTENSION_NAME=i;class l extends e{constructor(){super(...arguments),this.propertyType="Clearcoat",this.parentTypes=[t.MATERIAL],this.extensionName="KHR_materials_clearcoat",this._clearcoatFactor=0,this._clearcoatRoughnessFactor=0,this._clearcoatNormalScale=1,this.clearcoatTexture=null,this.clearcoatRoughnessTexture=null,this.clearcoatNormalTexture=null}copy(e,t=s){return super.copy(e,t),this._clearcoatFactor=e._clearcoatFactor,this._clearcoatRoughnessFactor=e._clearcoatRoughnessFactor,this._clearcoatNormalScale=e._clearcoatNormalScale,e.clearcoatTexture&&(this.setClearcoatTexture(t(e.clearcoatTexture.getChild())),this.clearcoatTexture.copy(e.clearcoatTexture)),e.clearcoatRoughnessTexture&&(this.setClearcoatRoughnessTexture(t(e.clearcoatRoughnessTexture.getChild())),this.clearcoatRoughnessTexture.copy(e.clearcoatRoughnessTexture)),e.clearcoatNormalTexture&&(this.setClearcoatNormalTexture(t(e.clearcoatNormalTexture.getChild())),this.clearcoatNormalTexture.copy(e.clearcoatNormalTexture)),this}getClearcoatFactor(){return this._clearcoatFactor}setClearcoatFactor(e){return this._clearcoatFactor=e,this}getClearcoatTexture(){return this.clearcoatTexture?this.clearcoatTexture.getChild():null}getClearcoatTextureInfo(){return this.clearcoatTexture?this.clearcoatTexture.textureInfo:null}getClearcoatTextureSampler(){return this.clearcoatTexture?this.clearcoatTexture.sampler:null}setClearcoatTexture(e){return this.clearcoatTexture=this.graph.linkTexture("clearcoatTexture",this,e),this}getClearcoatRoughnessFactor(){return this._clearcoatRoughnessFactor}setClearcoatRoughnessFactor(e){return this._clearcoatRoughnessFactor=e,this}getClearcoatRoughnessTexture(){return this.clearcoatRoughnessTexture?this.clearcoatRoughnessTexture.getChild():null}getClearcoatRoughnessTextureInfo(){return this.clearcoatRoughnessTexture?this.clearcoatRoughnessTexture.textureInfo:null}getClearcoatRoughnessTextureSampler(){return this.clearcoatRoughnessTexture?this.clearcoatRoughnessTexture.sampler:null}setClearcoatRoughnessTexture(e){return this.clearcoatRoughnessTexture=this.graph.linkTexture("clearcoatRoughnessTexture",this,e),this}getClearcoatNormalScale(){return this._clearcoatNormalScale}setClearcoatNormalScale(e){return this._clearcoatNormalScale=e,this}getClearcoatNormalTexture(){return this.clearcoatNormalTexture?this.clearcoatNormalTexture.getChild():null}getClearcoatNormalTextureInfo(){return this.clearcoatNormalTexture?this.clearcoatNormalTexture.textureInfo:null}getClearcoatNormalTextureSampler(){return this.clearcoatNormalTexture?this.clearcoatNormalTexture.sampler:null}setClearcoatNormalTexture(e){return this.clearcoatNormalTexture=this.graph.linkTexture("clearcoatNormalTexture",this,e),this}}l.EXTENSION_NAME="KHR_materials_clearcoat",c([o],l.prototype,"clearcoatTexture",void 0),c([o],l.prototype,"clearcoatRoughnessTexture",void 0),c([o],l.prototype,"clearcoatNormalTexture",void 0);const x="KHR_materials_clearcoat";class h extends r{constructor(){super(...arguments),this.extensionName=x}createClearcoat(){return new l(this.doc.getGraph(),this)}read(e){const t=e.nativeDocument,s=t.json.textures||[];return(t.json.materials||[]).forEach((t,r)=>{if(t.extensions&&t.extensions[x]){const o=this.createClearcoat();if(e.materials[r].setExtension(l,o),void 0!==t.extensions[x].clearcoatFactor&&o.setClearcoatFactor(t.extensions[x].clearcoatFactor),void 0!==t.extensions[x].clearcoatRoughnessFactor&&o.setClearcoatRoughnessFactor(t.extensions[x].clearcoatRoughnessFactor),void 0!==t.extensions[x].clearcoatTexture){const r=t.extensions[x].clearcoatTexture;o.setClearcoatTexture(e.textures[s[r.index].source]),e.setTextureInfo(o.getClearcoatTextureInfo(),r),e.setTextureSampler(o.getClearcoatTextureSampler(),r)}if(void 0!==t.extensions[x].clearcoatRoughnessTexture){const r=t.extensions[x].clearcoatRoughnessTexture;o.setClearcoatRoughnessTexture(e.textures[s[r.index].source]),e.setTextureInfo(o.getClearcoatRoughnessTextureInfo(),r),e.setTextureSampler(o.getClearcoatRoughnessTextureSampler(),r)}if(void 0!==t.extensions[x].clearcoatNormalTexture){const r=t.extensions[x].clearcoatNormalTexture;o.setClearcoatNormalTexture(e.textures[s[r.index].source]),e.setTextureInfo(o.getClearcoatNormalTextureInfo(),r),e.setTextureSampler(o.getClearcoatNormalTextureSampler(),r),void 0!==r.scale&&o.setClearcoatNormalScale(r.scale)}}}),this}write(e){const t=e.nativeDocument;return this.doc.getRoot().listMaterials().forEach(s=>{const r=s.getExtension(l);if(r){const o=e.materialIndexMap.get(s),n=t.json.materials[o];if(n.extensions=n.extensions||{},n.extensions[x]={clearcoatFactor:r.getClearcoatFactor(),clearcoatRoughnessFactor:r.getClearcoatRoughnessFactor()},r.getClearcoatTexture()){const t=r.getClearcoatTexture(),s=r.getClearcoatTextureInfo(),o=r.getClearcoatTextureSampler();n.extensions[x].clearcoatTexture=e.createTextureInfoDef(t,s,o)}if(r.getClearcoatRoughnessTexture()){const t=r.getClearcoatRoughnessTexture(),s=r.getClearcoatRoughnessTextureInfo(),o=r.getClearcoatRoughnessTextureSampler();n.extensions[x].clearcoatRoughnessTexture=e.createTextureInfoDef(t,s,o)}if(r.getClearcoatNormalTexture()){const t=r.getClearcoatNormalTexture(),s=r.getClearcoatNormalTextureInfo(),o=r.getClearcoatNormalTextureSampler();n.extensions[x].clearcoatNormalTexture=e.createTextureInfoDef(t,s,o),1!==r.getClearcoatNormalScale()&&(n.extensions[x].clearcoatNormalTexture.scale=r.getClearcoatNormalScale())}}}),this}}h.EXTENSION_NAME=x;class T extends e{constructor(){super(...arguments),this.propertyType="IOR",this.parentTypes=[t.MATERIAL],this.extensionName="KHR_materials_ior",this._ior=0}copy(e,t=s){return super.copy(e,t),this._ior=e._ior,this}getIOR(){return this._ior}setIOR(e){return this._ior=e,this}}T.EXTENSION_NAME="KHR_materials_ior";const p="KHR_materials_ior";class g extends r{constructor(){super(...arguments),this.extensionName=p}createIOR(){return new T(this.doc.getGraph(),this)}read(e){return(e.nativeDocument.json.materials||[]).forEach((t,s)=>{if(t.extensions&&t.extensions[p]){const r=this.createIOR();e.materials[s].setExtension(T,r),void 0!==t.extensions[p].ior&&r.setIOR(t.extensions[p].ior)}}),this}write(e){const t=e.nativeDocument;return this.doc.getRoot().listMaterials().forEach(s=>{const r=s.getExtension(T);if(r){const o=e.materialIndexMap.get(s),n=t.json.materials[o];n.extensions=n.extensions||{},n.extensions[p]={ior:r.getIOR()}}}),this}}g.EXTENSION_NAME=p;class m extends e{constructor(){super(...arguments),this.propertyType="PBRSpecularGlossiness",this.parentTypes=[t.MATERIAL],this.extensionName="KHR_materials_pbrSpecularGlossiness",this._diffuseFactor=[1,1,1,1],this._specularFactor=[1,1,1],this._glossinessFactor=1,this.diffuseTexture=null,this.specularGlossinessTexture=null}copy(e,t=s){return super.copy(e,t),this._diffuseFactor=e._diffuseFactor,this._specularFactor=e._specularFactor,this._glossinessFactor=e._glossinessFactor,e.diffuseTexture&&(this.setDiffuseTexture(t(e.diffuseTexture.getChild())),this.diffuseTexture.copy(e.diffuseTexture)),e.specularGlossinessTexture&&(this.setSpecularGlossinessTexture(t(e.specularGlossinessTexture.getChild())),this.specularGlossinessTexture.copy(e.specularGlossinessTexture)),this}getDiffuseFactor(){return this._diffuseFactor}setDiffuseFactor(e){return this._diffuseFactor=e,this}getDiffuseTexture(){return this.diffuseTexture?this.diffuseTexture.getChild():null}getDiffuseTextureInfo(){return this.diffuseTexture?this.diffuseTexture.textureInfo:null}getDiffuseTextureSampler(){return this.diffuseTexture?this.diffuseTexture.sampler:null}setDiffuseTexture(e){return this.diffuseTexture=this.graph.linkTexture("diffuseTexture",this,e),this}getSpecularFactor(){return this._specularFactor}setSpecularFactor(e){return this._specularFactor=e,this}getGlossinessFactor(){return this._glossinessFactor}setGlossinessFactor(e){return this._glossinessFactor=e,this}getSpecularGlossinessTexture(){return this.specularGlossinessTexture?this.specularGlossinessTexture.getChild():null}getSpecularGlossinessTextureInfo(){return this.specularGlossinessTexture?this.specularGlossinessTexture.textureInfo:null}getSpecularGlossinessTextureSampler(){return this.specularGlossinessTexture?this.specularGlossinessTexture.sampler:null}setSpecularGlossinessTexture(e){return this.specularGlossinessTexture=this.graph.linkTexture("specularGlossinessTexture",this,e),this}}m.EXTENSION_NAME="KHR_materials_pbrSpecularGlossiness",c([o],m.prototype,"diffuseTexture",void 0),c([o],m.prototype,"specularGlossinessTexture",void 0);const f="KHR_materials_pbrSpecularGlossiness";class _ extends r{constructor(){super(...arguments),this.extensionName=f}createPBRSpecularGlossiness(){return new m(this.doc.getGraph(),this)}read(e){const t=e.nativeDocument,s=t.json.textures||[];return(t.json.materials||[]).forEach((t,r)=>{if(t.extensions&&t.extensions[f]){const o=this.createPBRSpecularGlossiness();if(e.materials[r].setExtension(m,o),void 0!==t.extensions[f].diffuseFactor&&o.setDiffuseFactor(t.extensions[f].diffuseFactor),void 0!==t.extensions[f].specularFactor&&o.setSpecularFactor(t.extensions[f].specularFactor),void 0!==t.extensions[f].glossinessFactor&&o.setGlossinessFactor(t.extensions[f].glossinessFactor),void 0!==t.extensions[f].diffuseTexture){const r=t.extensions[f].diffuseTexture;o.setDiffuseTexture(e.textures[s[r.index].source]),e.setTextureInfo(o.getDiffuseTextureInfo(),r),e.setTextureSampler(o.getDiffuseTextureSampler(),r)}if(void 0!==t.extensions[f].specularGlossinessTexture){const r=t.extensions[f].specularGlossinessTexture;o.setSpecularGlossinessTexture(e.textures[s[r.index].source]),e.setTextureInfo(o.getSpecularGlossinessTextureInfo(),r),e.setTextureSampler(o.getSpecularGlossinessTextureSampler(),r)}}}),this}write(e){const t=e.nativeDocument;return this.doc.getRoot().listMaterials().forEach(s=>{const r=s.getExtension(m);if(r){const o=e.materialIndexMap.get(s),n=t.json.materials[o];if(n.extensions=n.extensions||{},n.extensions[f]={diffuseFactor:r.getDiffuseFactor(),specularFactor:r.getSpecularFactor(),glossinessFactor:r.getGlossinessFactor()},r.getDiffuseTexture()){const t=r.getDiffuseTexture(),s=r.getDiffuseTextureInfo(),o=r.getDiffuseTextureSampler();n.extensions[f].diffuseTexture=e.createTextureInfoDef(t,s,o)}if(r.getSpecularGlossinessTexture()){const t=r.getSpecularGlossinessTexture(),s=r.getSpecularGlossinessTextureInfo(),o=r.getSpecularGlossinessTextureSampler();n.extensions[f].specularGlossinessTexture=e.createTextureInfoDef(t,s,o)}}}),this}}_.EXTENSION_NAME=f;class d extends e{constructor(){super(...arguments),this.propertyType="Specular",this.parentTypes=[t.MATERIAL],this.extensionName="KHR_materials_specular",this._specularFactor=1,this._specularColorFactor=[1,1,1],this.specularTexture=null}copy(e,t=s){return super.copy(e,t),this._specularFactor=e._specularFactor,e.specularTexture&&(this.setSpecularTexture(t(e.specularTexture.getChild())),this.specularTexture.copy(e.specularTexture)),this}getSpecularFactor(){return this._specularFactor}setSpecularFactor(e){return this._specularFactor=e,this}getSpecularColorFactor(){return this._specularColorFactor}setSpecularColorFactor(e){return this._specularColorFactor=e,this}getSpecularTexture(){return this.specularTexture?this.specularTexture.getChild():null}getSpecularTextureInfo(){return this.specularTexture?this.specularTexture.textureInfo:null}getSpecularTextureSampler(){return this.specularTexture?this.specularTexture.sampler:null}setSpecularTexture(e){return this.specularTexture=this.graph.linkTexture("specularTexture",this,e),this}}d.EXTENSION_NAME="KHR_materials_specular",c([o],d.prototype,"specularTexture",void 0);const N="KHR_materials_specular";class C extends r{constructor(){super(...arguments),this.extensionName=N}createSpecular(){return new d(this.doc.getGraph(),this)}read(e){const t=e.nativeDocument,s=t.json.textures||[];return(t.json.materials||[]).forEach((t,r)=>{if(t.extensions&&t.extensions[N]){const o=this.createSpecular();if(e.materials[r].setExtension(d,o),void 0!==t.extensions[N].specularFactor&&o.setSpecularFactor(t.extensions[N].specularFactor),void 0!==t.extensions[N].specularColorFactor&&o.setSpecularColorFactor(t.extensions[N].specularColorFactor),void 0!==t.extensions[N].specularTexture){const r=t.extensions[N].specularTexture;o.setSpecularTexture(e.textures[s[r.index].source]),e.setTextureInfo(o.getSpecularTextureInfo(),r),e.setTextureSampler(o.getSpecularTextureSampler(),r)}}}),this}write(e){const t=e.nativeDocument;return this.doc.getRoot().listMaterials().forEach(s=>{const r=s.getExtension(d);if(r){const o=e.materialIndexMap.get(s),n=t.json.materials[o];if(n.extensions=n.extensions||{},n.extensions[N]={specularFactor:r.getSpecularFactor(),specularColorFactor:r.getSpecularColorFactor()},r.getSpecularTexture()){const t=r.getSpecularTexture(),s=r.getSpecularTextureInfo(),o=r.getSpecularTextureSampler();n.extensions[N].specularTexture=e.createTextureInfoDef(t,s,o)}}}),this}}C.EXTENSION_NAME=N;class S extends e{constructor(){super(...arguments),this.propertyType="Transmission",this.parentTypes=[t.MATERIAL],this.extensionName="KHR_materials_transmission",this._transmissionFactor=0,this.transmissionTexture=null}copy(e,t=s){return super.copy(e,t),this._transmissionFactor=e._transmissionFactor,e.transmissionTexture&&(this.setTransmissionTexture(t(e.transmissionTexture.getChild())),this.transmissionTexture.copy(e.transmissionTexture)),this}getTransmissionFactor(){return this._transmissionFactor}setTransmissionFactor(e){return this._transmissionFactor=e,this}getTransmissionTexture(){return this.transmissionTexture?this.transmissionTexture.getChild():null}getTransmissionTextureInfo(){return this.transmissionTexture?this.transmissionTexture.textureInfo:null}getTransmissionTextureSampler(){return this.transmissionTexture?this.transmissionTexture.sampler:null}setTransmissionTexture(e){return this.transmissionTexture=this.graph.linkTexture("transmissionTexture",this,e),this}}S.EXTENSION_NAME="KHR_materials_transmission",c([o],S.prototype,"transmissionTexture",void 0);const R="KHR_materials_transmission";class F extends r{constructor(){super(...arguments),this.extensionName=R}createTransmission(){return new S(this.doc.getGraph(),this)}read(e){const t=e.nativeDocument,s=t.json.textures||[];return(t.json.materials||[]).forEach((t,r)=>{if(t.extensions&&t.extensions[R]){const o=this.createTransmission();if(e.materials[r].setExtension(S,o),void 0!==t.extensions[R].transmissionFactor&&o.setTransmissionFactor(t.extensions[R].transmissionFactor),void 0!==t.extensions[R].transmissionTexture){const r=t.extensions[R].transmissionTexture;o.setTransmissionTexture(e.textures[s[r.index].source]),e.setTextureInfo(o.getTransmissionTextureInfo(),r),e.setTextureSampler(o.getTransmissionTextureSampler(),r)}}}),this}write(e){const t=e.nativeDocument;return this.doc.getRoot().listMaterials().forEach(s=>{const r=s.getExtension(S);if(r){const o=e.materialIndexMap.get(s),n=t.json.materials[o];if(n.extensions=n.extensions||{},n.extensions[R]={transmissionFactor:r.getTransmissionFactor()},r.getTransmissionTexture()){const t=r.getTransmissionTexture(),s=r.getTransmissionTextureInfo(),o=r.getTransmissionTextureSampler();n.extensions[R].transmissionTexture=e.createTextureInfoDef(t,s,o)}}}),this}}F.EXTENSION_NAME=R;class I extends e{constructor(){super(...arguments),this.propertyType="Unlit",this.parentTypes=[t.MATERIAL],this.extensionName="KHR_materials_unlit"}}I.EXTENSION_NAME="KHR_materials_unlit";const E="KHR_materials_unlit";class y extends r{constructor(){super(...arguments),this.extensionName=E}createUnlit(){return new I(this.doc.getGraph(),this)}read(e){return(e.nativeDocument.json.materials||[]).forEach((t,s)=>{t.extensions&&t.extensions[E]&&e.materials[s].setExtension(I,this.createUnlit())}),this}write(e){const t=e.nativeDocument;return this.doc.getRoot().listMaterials().forEach(s=>{if(s.getExtension(I)){const r=e.materialIndexMap.get(s),o=t.json.materials[r];o.extensions=o.extensions||{},o.extensions[E]={}}}),this}}y.EXTENSION_NAME=E;const A="KHR_mesh_quantization";class v extends r{constructor(){super(...arguments),this.extensionName=A}read(e){return this}write(e){return this}}v.EXTENSION_NAME=A;const G="KHR_texture_basisu";class D extends r{constructor(){super(...arguments),this.extensionName=G,this.provideTypes=[t.TEXTURE]}provide(e){return e.nativeDocument.json.textures.forEach(e=>{e.extensions&&e.extensions[G]&&(e.source=e.extensions[G].source)}),this}read(e){return this}write(e){const t=e.nativeDocument;return this.doc.getRoot().listTextures().forEach(s=>{if("image/ktx2"===s.getMimeType()){const r=e.imageIndexMap.get(s);t.json.textures.forEach(e=>{e.source===r&&(e.extensions=e.extensions||{},e.extensions[G]={source:e.source},delete e.source)})}}),this}}D.EXTENSION_NAME=G;const M=[u,h,g,_,C,F,y,v,D];export{l as Clearcoat,T as IOR,M as KHRONOS_EXTENSIONS,a as Light,n as LightType,u as LightsPunctual,h as MaterialsClearcoat,g as MaterialsIOR,_ as MaterialsPBRSpecularGlossiness,C as MaterialsSpecular,F as MaterialsTransmission,y as MaterialsUnlit,v as MeshQuantization,m as PBRSpecularGlossiness,d as Specular,D as TextureBasisu,S as Transmission,I as Unlit}; | ||
//# sourceMappingURL=extensions.modern.js.map |
@@ -0,1 +1,2 @@ | ||
export declare const KHR_LIGHTS_PUNCTUAL = "KHR_lights_punctual"; | ||
export declare const KHR_MATERIALS_CLEARCOAT = "KHR_materials_clearcoat"; | ||
@@ -2,0 +3,0 @@ export declare const KHR_MATERIALS_IOR = "KHR_materials_ior"; |
@@ -0,1 +1,2 @@ | ||
import { LightsPunctual } from './khr-lights-punctual'; | ||
import { MaterialsClearcoat } from './khr-materials-clearcoat'; | ||
@@ -9,2 +10,3 @@ import { MaterialsIOR } from './khr-materials-ior'; | ||
import { TextureBasisu } from './khr-texture-basisu'; | ||
export * from './khr-lights-punctual'; | ||
export * from './khr-materials-clearcoat'; | ||
@@ -18,2 +20,2 @@ export * from './khr-materials-ior'; | ||
export * from './khr-texture-basisu'; | ||
export declare const KHRONOS_EXTENSIONS: (typeof MaterialsClearcoat | typeof MaterialsIOR | typeof MaterialsPBRSpecularGlossiness | typeof MaterialsSpecular | typeof MaterialsTransmission | typeof MaterialsUnlit | typeof MeshQuantization | typeof TextureBasisu)[]; | ||
export declare const KHRONOS_EXTENSIONS: (typeof LightsPunctual | typeof MaterialsClearcoat | typeof MaterialsIOR | typeof MaterialsPBRSpecularGlossiness | typeof MaterialsSpecular | typeof MaterialsTransmission | typeof MaterialsUnlit | typeof MeshQuantization | typeof TextureBasisu)[]; |
@@ -5,3 +5,3 @@ import { Transform } from '@gltf-transform/core'; | ||
} | ||
interface AOOptions { | ||
export interface AOOptions { | ||
gl?: GLFactory; | ||
@@ -8,0 +8,0 @@ resolution: number; |
import { Transform } from '@gltf-transform/core'; | ||
interface ColorspaceOptions { | ||
export interface ColorspaceOptions { | ||
inputEncoding: string; | ||
@@ -10,2 +10,1 @@ } | ||
export declare function colorspace(options: ColorspaceOptions): Transform; | ||
export {}; |
import { Transform } from '@gltf-transform/core'; | ||
interface DedupOptions { | ||
export interface DedupOptions { | ||
accessors: boolean; | ||
@@ -12,2 +12,1 @@ textures: boolean; | ||
export declare const dedup: (options: DedupOptions) => Transform; | ||
export {}; |
@@ -6,2 +6,3 @@ export * from './ao'; | ||
export * from './partition'; | ||
export * from './sequence'; | ||
export * from './inspect'; |
import { Document } from '@gltf-transform/core'; | ||
interface MetalRoughOptions { | ||
export interface MetalRoughOptions { | ||
} | ||
@@ -9,2 +9,1 @@ /** | ||
export declare function metalRough(options?: MetalRoughOptions): (doc: Document) => Promise<void>; | ||
export {}; |
import { Transform } from '@gltf-transform/core'; | ||
interface PartitionOptions { | ||
export interface PartitionOptions { | ||
meshes: Array<string>; | ||
@@ -4,0 +4,0 @@ } |
{ | ||
"name": "@gltf-transform/extensions", | ||
"version": "0.5.3", | ||
"version": "0.5.4", | ||
"repository": "github:donmccurdy/glTF-Transform", | ||
@@ -24,3 +24,3 @@ "description": "Adds extension support to @gltf-transform/core", | ||
"dependencies": { | ||
"@gltf-transform/core": "^0.5.3" | ||
"@gltf-transform/core": "^0.5.4" | ||
}, | ||
@@ -33,3 +33,3 @@ "files": [ | ||
], | ||
"gitHead": "6cfc741a055c508e9adb823169574b9a08599472" | ||
"gitHead": "9122dbc2f611621270aadd9759876faddc0b689f" | ||
} |
@@ -0,1 +1,2 @@ | ||
export const KHR_LIGHTS_PUNCTUAL = 'KHR_lights_punctual'; | ||
export const KHR_MATERIALS_CLEARCOAT = 'KHR_materials_clearcoat'; | ||
@@ -2,0 +3,0 @@ export const KHR_MATERIALS_IOR = 'KHR_materials_ior'; |
@@ -0,1 +1,2 @@ | ||
import { Light, LightsPunctual } from './khr-lights-punctual'; | ||
import { MaterialsClearcoat } from './khr-materials-clearcoat'; | ||
@@ -10,2 +11,3 @@ import { MaterialsIOR } from './khr-materials-ior'; | ||
export * from './khr-lights-punctual'; | ||
export * from './khr-materials-clearcoat'; | ||
@@ -21,2 +23,3 @@ export * from './khr-materials-ior'; | ||
export const KHRONOS_EXTENSIONS = [ | ||
LightsPunctual, | ||
MaterialsClearcoat, | ||
@@ -23,0 +26,0 @@ MaterialsIOR, |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Minified code
QualityThis package contains minified code. This may be harmless in some cases where minified code is included in packaged libraries, however packages on npm should not minify code.
Found 1 instance in 1 package
4627
3
396908
124
Updated@gltf-transform/core@^0.5.4