@needle-tools/materialx 1.0.1-next.7bd39cb → 1.0.1-next.9e2a592
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/loader/loader.three.ts +4 -2
- package/src/materialx.ts +1 -1
package/package.json
CHANGED
|
@@ -214,8 +214,9 @@ export class MaterialXLoader implements GLTFLoaderPlugin {
|
|
|
214
214
|
*/
|
|
215
215
|
|
|
216
216
|
if (!renderableElement) {
|
|
217
|
-
console.warn(
|
|
217
|
+
console.warn(`[MaterialX] No renderable element found in MaterialX document (${material_extension.name})`);
|
|
218
218
|
const fallbackMaterial = new MeshStandardMaterial();
|
|
219
|
+
fallbackMaterial.color.set(0xff00ff);
|
|
219
220
|
fallbackMaterial.userData.materialX = material_extension;
|
|
220
221
|
fallbackMaterial.name = `MaterialX_NoRenderable_${material_extension.name}`;
|
|
221
222
|
return fallbackMaterial;
|
|
@@ -287,9 +288,10 @@ export class MaterialXLoader implements GLTFLoaderPlugin {
|
|
|
287
288
|
|
|
288
289
|
} catch (error) {
|
|
289
290
|
// This is a wasm error (an int) that we need to resolve
|
|
290
|
-
console.error(
|
|
291
|
+
console.error(`[MaterialX] Error creating MaterialX material (${material_extension.name}):`, error);
|
|
291
292
|
// Return a fallback material with stored MaterialX data
|
|
292
293
|
const fallbackMaterial = new MeshStandardMaterial();
|
|
294
|
+
fallbackMaterial.color.set(0xff00ff);
|
|
293
295
|
fallbackMaterial.userData.materialX = material_extension;
|
|
294
296
|
fallbackMaterial.name = `MaterialX_Error_${material_extension.name}`;
|
|
295
297
|
return fallbackMaterial;
|
package/src/materialx.ts
CHANGED
|
@@ -98,7 +98,7 @@ export async function ready(): Promise<void> {
|
|
|
98
98
|
// This prewarms the shader generation context to have all light types
|
|
99
99
|
await registerLights(state.materialXModule, state.materialXGenContext);
|
|
100
100
|
|
|
101
|
-
if (debug) console.log("[MaterialX]
|
|
101
|
+
if (debug) console.log("[MaterialX] Generator initialized successfully");
|
|
102
102
|
} catch (error) {
|
|
103
103
|
console.error("[MaterialX] Failed to load MaterialX module:", error);
|
|
104
104
|
throw error;
|