mbt-3d 0.4.3 → 0.4.5
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 +60 -0
- package/dist/mbt-3d.cjs +2 -2
- package/dist/mbt-3d.cjs.map +1 -1
- package/dist/mbt-3d.js +813 -707
- package/dist/mbt-3d.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -33,7 +33,9 @@ declare interface AmbientLightConfig {
|
|
|
33
33
|
*
|
|
34
34
|
* The ref provides these methods:
|
|
35
35
|
* - `playAnimation(name, options)` - Play an animation with optional loop/restore
|
|
36
|
+
* - `playAnimationLayers(layers)` - Play multiple animation layers in parallel
|
|
36
37
|
* - `stopAnimation()` - Stop current animation
|
|
38
|
+
* - `stopAnimationLayers()` - Stop all active animation layers
|
|
37
39
|
* - `getAnimationNames()` - Get list of available animations
|
|
38
40
|
* - `getGroup()` - Get the THREE.Group for advanced manipulation
|
|
39
41
|
* - `setMorphTarget(name, value)` - Set morph target value
|
|
@@ -45,6 +47,8 @@ declare interface AmbientLightConfig {
|
|
|
45
47
|
* @param rotation - Model rotation in radians as [x, y, z]. Example: `[0, Math.PI, 0]`. Default: `[0, 0, 0]`
|
|
46
48
|
* @param scale - Uniform scale (number) or per-axis scale [x, y, z]. Examples: `0.5` or `[1, 2, 1]`. Default: `1`
|
|
47
49
|
* @param defaultAnimation - Name of animation to play on load. If not specified, plays first animation. Example: `"Idle"`
|
|
50
|
+
* @param animation - Controlled single animation name
|
|
51
|
+
* @param animationLayers - Controlled parallel animation layers (takes priority over `animation`)
|
|
48
52
|
* @param morphTargets - Morph target values as key-value pairs where value is 0-1. Example: `{ muscular: 0.5, thin: 0.2 }`
|
|
49
53
|
* @param meshVisibility - Mesh visibility as key-value pairs. Example: `{ "Hairgirl1": true, "Hairgirl2": false }`
|
|
50
54
|
* @param materialColors - Material colors as key-value pairs. Example: `{ "Hair_girl_1": "#ff0000" }`
|
|
@@ -79,6 +83,40 @@ declare interface AmbientLightConfig {
|
|
|
79
83
|
*/
|
|
80
84
|
export declare const AnimatedModel: ForwardRefExoticComponent<AnimatedModelProps & RefAttributes<AnimatedModelHandle>>;
|
|
81
85
|
|
|
86
|
+
/**
|
|
87
|
+
* Single animation layer configuration for parallel playback.
|
|
88
|
+
*/
|
|
89
|
+
export declare interface AnimatedModelAnimationLayer {
|
|
90
|
+
/** Animation name (supports exact and partial matching) */
|
|
91
|
+
name: string;
|
|
92
|
+
/** Loop layer continuously. Default: true */
|
|
93
|
+
loop?: boolean;
|
|
94
|
+
/** Layer weight. Default: 1 */
|
|
95
|
+
weight?: number;
|
|
96
|
+
/** Playback speed multiplier. Default: 1 */
|
|
97
|
+
timeScale?: number;
|
|
98
|
+
/** Fade-in duration in seconds. Default: 0.2 */
|
|
99
|
+
fadeIn?: number;
|
|
100
|
+
/** Optional mask to apply this layer only to selected nodes */
|
|
101
|
+
mask?: AnimatedModelAnimationMask;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
/**
|
|
105
|
+
* Animation layer input (short form string or full config).
|
|
106
|
+
*/
|
|
107
|
+
export declare type AnimatedModelAnimationLayerInput = string | AnimatedModelAnimationLayer;
|
|
108
|
+
|
|
109
|
+
/**
|
|
110
|
+
* Node mask for animation layer tracks.
|
|
111
|
+
* Use node names from `onLoad` (`meshes` and `bones`) to limit where a layer applies.
|
|
112
|
+
*/
|
|
113
|
+
export declare interface AnimatedModelAnimationMask {
|
|
114
|
+
/** Only tracks targeting these nodes will be played */
|
|
115
|
+
includeNodes?: string[];
|
|
116
|
+
/** Tracks targeting these nodes will be removed from the layer */
|
|
117
|
+
excludeNodes?: string[];
|
|
118
|
+
}
|
|
119
|
+
|
|
82
120
|
/**
|
|
83
121
|
* Imperative handle for AnimatedModel (accessed via ref)
|
|
84
122
|
*
|
|
@@ -104,6 +142,13 @@ export declare interface AnimatedModelHandle {
|
|
|
104
142
|
}) => void;
|
|
105
143
|
/** Stop the currently playing animation */
|
|
106
144
|
stopAnimation: () => void;
|
|
145
|
+
/**
|
|
146
|
+
* Play multiple animations in parallel layers
|
|
147
|
+
* @param layers - List of animation layer configs (or plain names)
|
|
148
|
+
*/
|
|
149
|
+
playAnimationLayers: (layers: AnimatedModelAnimationLayerInput[]) => void;
|
|
150
|
+
/** Stop all currently active animation layers */
|
|
151
|
+
stopAnimationLayers: () => void;
|
|
107
152
|
/** Get array of all available animation names */
|
|
108
153
|
getAnimationNames: () => string[];
|
|
109
154
|
/** Get the THREE.Group object for advanced manipulation */
|
|
@@ -188,6 +233,18 @@ export declare interface AnimatedModelProps extends Omit<ModelProps, 'onLoad'> {
|
|
|
188
233
|
defaultAnimation?: string;
|
|
189
234
|
/** Controlled animation name. When changed, AnimatedModel switches to this animation */
|
|
190
235
|
animation?: string;
|
|
236
|
+
/**
|
|
237
|
+
* Controlled parallel animation layers.
|
|
238
|
+
* If provided, takes priority over `animation`.
|
|
239
|
+
*
|
|
240
|
+
* @example
|
|
241
|
+
* animationLayers={[
|
|
242
|
+
* 'Idleger1',
|
|
243
|
+
* { name: 'GirlFaceidle.007', mask: { includeNodes: ['Eyewitegirl', 'Girlbody_1'] } },
|
|
244
|
+
* { name: 'Lashesgirl6idle.013', mask: { includeNodes: ['Lashesgirl'] } },
|
|
245
|
+
* ]}
|
|
246
|
+
*/
|
|
247
|
+
animationLayers?: AnimatedModelAnimationLayerInput[];
|
|
191
248
|
/** Morph target values as key-value pairs { targetName: value } where value is 0-1 */
|
|
192
249
|
morphTargets?: Record<string, number>;
|
|
193
250
|
/** Mesh visibility as key-value pairs { meshName: visible }. Example: { "Hairgirl1": true, "Hairgirl2": false } */
|
|
@@ -660,6 +717,7 @@ export declare interface RendererConfig {
|
|
|
660
717
|
* @param contactShadows.position - Shadow position as [x, y, z]. Example: `[0, -1, 0]`. Default: `[0, -1, 0]`
|
|
661
718
|
* @param contactShadows.opacity - Shadow opacity (0-1). Example: `0.5`. Default: `0.5`
|
|
662
719
|
* @param contactShadows.blur - Shadow blur amount. Example: `2`. Default: `2`
|
|
720
|
+
* @param showLoadingOverlay - Show loading overlay while assets are loading. Default: `true`
|
|
663
721
|
* @param style - Container style object. Example: `{ width: 400, height: 500 }`
|
|
664
722
|
* @param className - Container CSS class name
|
|
665
723
|
*
|
|
@@ -827,6 +885,8 @@ export declare function useAnimationController(animations: THREE.AnimationClip[]
|
|
|
827
885
|
restoreDefault?: boolean;
|
|
828
886
|
}) => void;
|
|
829
887
|
stopAnimation: () => void;
|
|
888
|
+
playAnimationLayers: (layers: AnimatedModelAnimationLayerInput[]) => void;
|
|
889
|
+
stopAnimationLayers: () => void;
|
|
830
890
|
getAnimationNames: () => string[];
|
|
831
891
|
actions: {
|
|
832
892
|
[x: string]: THREE.AnimationAction | null;
|