@gltf-transform/core
Advanced tools
Comparing version 4.0.1 to 4.0.2
{ | ||
"name": "@gltf-transform/core", | ||
"version": "4.0.1", | ||
"version": "4.0.2", | ||
"repository": "github:donmccurdy/glTF-Transform", | ||
@@ -54,3 +54,3 @@ "homepage": "https://gltf-transform.dev/", | ||
}, | ||
"gitHead": "2a5ad54ae79afcb34cc60c2f000e90e27f1053f6" | ||
"gitHead": "1bd66c6c1b2706a3c130f08a0a8e8c689add1e96" | ||
} |
@@ -22,2 +22,12 @@ import { GLB_BUFFER, PropertyType, TypedArray, mat4, vec3, vec4, ComponentTypeToTypedArray } from '../constants.js'; | ||
const SUPPORTED_PREREAD_TYPES = new Set<PropertyType>([ | ||
PropertyType.BUFFER, | ||
PropertyType.TEXTURE, | ||
PropertyType.MATERIAL, | ||
PropertyType.MESH, | ||
PropertyType.PRIMITIVE, | ||
PropertyType.NODE, | ||
PropertyType.SCENE, | ||
]); | ||
/** @internal */ | ||
@@ -57,2 +67,3 @@ export class GLTFReader { | ||
if (extensionsUsed.includes(Extension.EXTENSION_NAME)) { | ||
// Create extension. | ||
const extension = document | ||
@@ -62,2 +73,12 @@ .createExtension(Extension as unknown as new (doc: Document) => Extension) | ||
// Warn on unsupported preread hooks. | ||
const unsupportedHooks = extension.prereadTypes.filter((type) => !SUPPORTED_PREREAD_TYPES.has(type)); | ||
if (unsupportedHooks.length) { | ||
options.logger.warn( | ||
`Preread hooks for some types (${unsupportedHooks.join()}), requested by extension ` + | ||
`${extension.extensionName}, are unsupported. Please file an issue or a PR.`, | ||
); | ||
} | ||
// Install dependencies. | ||
for (const key of extension.readDependencies) { | ||
@@ -64,0 +85,0 @@ extension.install(key, options.dependencies[key]); |
@@ -30,2 +30,9 @@ import { | ||
const SUPPORTED_PREWRITE_TYPES = new Set<PropertyType>([ | ||
PropertyType.ACCESSOR, | ||
PropertyType.BUFFER, | ||
PropertyType.MATERIAL, | ||
PropertyType.MESH, | ||
]); | ||
/** | ||
@@ -69,2 +76,12 @@ * @internal | ||
for (const extension of extensionsUsed) { | ||
// Warn on unsupported prewrite hooks. | ||
const unsupportedHooks = extension.prewriteTypes.filter((type) => !SUPPORTED_PREWRITE_TYPES.has(type)); | ||
if (unsupportedHooks.length) { | ||
logger.warn( | ||
`Prewrite hooks for some types (${unsupportedHooks.join()}), requested by extension ` + | ||
`${extension.extensionName}, are unsupported. Please file an issue or a PR.`, | ||
); | ||
} | ||
// Install dependencies. | ||
for (const key of extension.writeDependencies) { | ||
@@ -71,0 +88,0 @@ extension.install(key, options.dependencies[key]); |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
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
2245476
31195