mbt-3d 0.4.1 → 0.4.3

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/dist/index.d.ts CHANGED
@@ -49,6 +49,7 @@ declare interface AmbientLightConfig {
49
49
  * @param meshVisibility - Mesh visibility as key-value pairs. Example: `{ "Hairgirl1": true, "Hairgirl2": false }`
50
50
  * @param materialColors - Material colors as key-value pairs. Example: `{ "Hair_girl_1": "#ff0000" }`
51
51
  * @param materialTextures - Material texture maps. Example: `{ "Metal": { map: "/tex.webp", normalMap: "/normal.webp" } }`
52
+ * @param materialTextureLogging - Enable verbose material texture logs for this model instance. Default: `false`
52
53
  * @param children - Child components, typically BoneAttachment components for attaching items
53
54
  * @param onLoad - Callback when model loads. Receives AnimatedModelInfo object: `{ meshes, materials, bones, nodeCount, animations, morphTargetNames }`
54
55
  * @param onError - Callback when model fails to load. Receives Error object
@@ -195,6 +196,8 @@ export declare interface AnimatedModelProps extends Omit<ModelProps, 'onLoad'> {
195
196
  materialColors?: Record<string, string | [number, number, number]>;
196
197
  /** Material textures as key-value pairs { materialName: textures }. Example: { "Metal": { map: "/tex.webp" } } */
197
198
  materialTextures?: Record<string, MaterialTextures | string>;
199
+ /** Enable verbose material texture logs for this model instance. Default: false */
200
+ materialTextureLogging?: boolean;
198
201
  /** Callback when model loads with extended metadata including animations */
199
202
  onLoad?: (info: AnimatedModelInfo) => void;
200
203
  }
@@ -376,6 +379,7 @@ declare interface MaterialTextures_2 {
376
379
  * @param meshVisibility - Mesh visibility as key-value pairs. Example: `{ "Part1": true, "Part2": false }`
377
380
  * @param materialColors - Material colors as key-value pairs. Example: `{ "MaterialName": "#ff0000" }`
378
381
  * @param materialTextures - Material texture maps. Example: `{ "Metal": { map: "/tex.webp", normalMap: "/normal.webp" } }`
382
+ * @param materialTextureLogging - Enable verbose material texture logs for this model instance. Default: `false`
379
383
  * @param onLoad - Callback when model finishes loading. Receives ModelInfo object with metadata: `{ meshes, materials, bones, nodeCount }`
380
384
  * @param onError - Callback when model fails to load. Receives Error object
381
385
  *
@@ -391,7 +395,7 @@ declare interface MaterialTextures_2 {
391
395
  * />
392
396
  * ```
393
397
  */
394
- export declare function Model({ url, position, rotation, scale, meshVisibility, materialColors, materialTextures, onLoad, onError: _onError, }: ModelProps): JSX_2.Element;
398
+ export declare function Model({ url, position, rotation, scale, meshVisibility, materialColors, materialTextures, materialTextureLogging, onLoad, onError: _onError, }: ModelProps): JSX_2.Element;
395
399
 
396
400
  export declare namespace Model {
397
401
  var preload: (url: string) => void;
@@ -439,6 +443,8 @@ export declare interface ModelProps {
439
443
  materialColors?: Record<string, string | [number, number, number]>;
440
444
  /** Material textures as key-value pairs { materialName: textures }. Example: { "Metal": { map: "/tex.webp" } } */
441
445
  materialTextures?: Record<string, MaterialTextures | string>;
446
+ /** Enable verbose material texture logs for this model instance. Default: false */
447
+ materialTextureLogging?: boolean;
442
448
  /** Callback when model finishes loading with metadata */
443
449
  onLoad?: (info: ModelInfo) => void;
444
450
  /** Callback when model fails to load */
@@ -469,6 +475,7 @@ export declare interface ModelProps {
469
475
  * @param meshVisibility - Mesh visibility as key-value pairs. Example: `{ "Hairgirl1": true, "Hairgirl2": false }`
470
476
  * @param materialColors - Material colors as key-value pairs. Example: `{ "Hair_girl_1": "#ff0000" }`
471
477
  * @param materialTextures - Material texture maps. Example: `{ "Metal": { map: "/tex.webp", normalMap: "/normal.webp" } }`
478
+ * @param materialTextureLogging - Enable verbose material texture logs for this model instance. Default: `false`
472
479
  * @param onMorphTargetsFound - Callback when morph targets are discovered from the model. Receives array of morph target names: `["muscular", "thin", "fat"]`
473
480
  * @param onLoad - Callback when model finishes loading. Receives ModelInfo object with metadata: `{ meshes, materials, bones, nodeCount }`
474
481
  * @param onError - Callback when model fails to load. Receives Error object
@@ -569,6 +576,8 @@ export declare interface MorphableModelProps extends ModelProps {
569
576
  materialColors?: Record<string, string | [number, number, number]>;
570
577
  /** Material textures as key-value pairs { materialName: textures }. Example: { "Metal": { map: "/tex.webp" } } */
571
578
  materialTextures?: Record<string, MaterialTextures | string>;
579
+ /** Enable verbose material texture logs for this model instance. Default: false */
580
+ materialTextureLogging?: boolean;
572
581
  /** Callback when morph targets are discovered from the model */
573
582
  onMorphTargetsFound?: (names: string[]) => void;
574
583
  }
@@ -857,14 +866,25 @@ export declare function useMaterialColor(scene: THREE.Object3D, initialColors?:
857
866
  *
858
867
  * @param scene - The THREE.Object3D scene containing meshes with materials
859
868
  * @param textures - Initial texture maps for materials { materialName: textureConfig }
869
+ * @param options - Hook runtime options
860
870
  * @returns Methods to control material textures
861
871
  */
862
- export declare function useMaterialTexture(scene: THREE.Object3D, textures?: Record<string, MaterialTextures_2 | string>): {
872
+ export declare function useMaterialTexture(scene: THREE.Object3D, textures?: Record<string, MaterialTextures_2 | string>, options?: UseMaterialTextureOptions): {
863
873
  setMaterialTextures: (materialName: string, textureConfig: MaterialTextures_2 | string) => void;
864
874
  getMaterialNames: () => string[];
865
875
  clearMaterialTextures: (materialName: string) => void;
866
876
  };
867
877
 
878
+ /**
879
+ * Runtime options for useMaterialTexture hook.
880
+ */
881
+ declare interface UseMaterialTextureOptions {
882
+ /**
883
+ * Enable verbose texture lifecycle logs (disabled by default).
884
+ */
885
+ enableLogging?: boolean;
886
+ }
887
+
868
888
  /**
869
889
  * Hook for managing mesh visibility in a 3D scene
870
890
  *