@pixiv/three-vrm-core 1.0.0-beta.9 → 1.0.1

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.
Files changed (108) hide show
  1. package/lib/three-vrm-core.js +3367 -2551
  2. package/lib/three-vrm-core.min.js +2 -2
  3. package/lib/three-vrm-core.module.js +3365 -2552
  4. package/lib/three-vrm-core.module.min.js +2 -2
  5. package/package.json +12 -12
  6. package/ts3.4/types/VRMCore.d.ts +7 -7
  7. package/ts3.4/types/VRMCoreLoaderPluginOptions.d.ts +1 -0
  8. package/ts3.4/types/VRMCoreParameters.d.ts +2 -2
  9. package/ts3.4/types/expressions/VRMExpression.d.ts +1 -1
  10. package/ts3.4/types/expressions/VRMExpressionMaterialColorBind.d.ts +3 -0
  11. package/ts3.4/types/expressions/VRMExpressionMaterialColorType.d.ts +4 -0
  12. package/ts3.4/types/humanoid/VRMHumanBoneList.d.ts +5 -0
  13. package/ts3.4/types/humanoid/VRMHumanBoneName.d.ts +7 -2
  14. package/ts3.4/types/humanoid/VRMHumanBoneParentMap.d.ts +9 -0
  15. package/ts3.4/types/humanoid/VRMHumanoid.d.ts +130 -21
  16. package/ts3.4/types/humanoid/VRMHumanoidLoaderPlugin.d.ts +9 -1
  17. package/ts3.4/types/humanoid/VRMHumanoidLoaderPluginOptions.d.ts +15 -0
  18. package/ts3.4/types/humanoid/VRMHumanoidRig.d.ts +31 -0
  19. package/ts3.4/types/humanoid/VRMRig.d.ts +62 -0
  20. package/ts3.4/types/humanoid/helpers/VRMHumanoidHelper.d.ts +9 -0
  21. package/ts3.4/types/humanoid/helpers/index.d.ts +1 -0
  22. package/ts3.4/types/humanoid/index.d.ts +4 -0
  23. package/ts3.4/types/lookAt/VRMLookAt.d.ts +48 -6
  24. package/ts3.4/types/lookAt/VRMLookAtApplier.d.ts +8 -2
  25. package/ts3.4/types/lookAt/VRMLookAtBoneApplier.d.ts +35 -2
  26. package/ts3.4/types/lookAt/VRMLookAtExpressionApplier.d.ts +7 -2
  27. package/ts3.4/types/lookAt/tests/VRMLookAt.test.d.ts +1 -0
  28. package/ts3.4/types/lookAt/tests/VRMLookAtBoneApplier.test.d.ts +1 -0
  29. package/ts3.4/types/lookAt/utils/calcAzimuthAltitude.d.ts +16 -0
  30. package/ts3.4/types/lookAt/utils/sanitizeAngle.d.ts +11 -0
  31. package/ts3.4/types/lookAt/utils/tests/calcAzimuthAltitude.test.d.ts +1 -0
  32. package/ts3.4/types/lookAt/utils/tests/sanitizeAngle.test.d.ts +1 -0
  33. package/ts3.4/types/meta/VRMMetaLoaderPlugin.d.ts +1 -1
  34. package/ts3.4/types/meta/VRMMetaLoaderPluginOptions.d.ts +1 -1
  35. package/ts3.4/types/tests/matchers/toBeCloseToQuaternion.d.ts +10 -0
  36. package/ts3.4/types/tests/matchers/toBeCloseToVector3.d.ts +10 -0
  37. package/ts3.4/types/utils/renameMaterialProperty.d.ts +1 -0
  38. package/types/VRMCore.d.ts +58 -58
  39. package/types/VRMCoreLoaderPlugin.d.ts +18 -18
  40. package/types/VRMCoreLoaderPluginOptions.d.ts +19 -18
  41. package/types/VRMCoreParameters.d.ts +16 -16
  42. package/types/expressions/VRMExpression.d.ts +64 -64
  43. package/types/expressions/VRMExpressionBind.d.ts +11 -11
  44. package/types/expressions/VRMExpressionLoaderPlugin.d.ts +23 -23
  45. package/types/expressions/VRMExpressionManager.d.ts +124 -124
  46. package/types/expressions/VRMExpressionMaterialColorBind.d.ts +45 -42
  47. package/types/expressions/VRMExpressionMaterialColorType.d.ts +12 -8
  48. package/types/expressions/VRMExpressionMorphTargetBind.d.ts +35 -35
  49. package/types/expressions/VRMExpressionOverrideType.d.ts +6 -6
  50. package/types/expressions/VRMExpressionPresetName.d.ts +21 -21
  51. package/types/expressions/VRMExpressionTextureTransformBind.d.ts +40 -40
  52. package/types/expressions/index.d.ts +10 -10
  53. package/types/firstPerson/VRMFirstPerson.d.ts +84 -84
  54. package/types/firstPerson/VRMFirstPersonLoaderPlugin.d.ts +20 -20
  55. package/types/firstPerson/VRMFirstPersonMeshAnnotation.d.ts +5 -5
  56. package/types/firstPerson/VRMFirstPersonMeshAnnotationType.d.ts +7 -7
  57. package/types/firstPerson/index.d.ts +4 -4
  58. package/types/humanoid/VRMHumanBone.d.ts +10 -10
  59. package/types/humanoid/VRMHumanBoneList.d.ts +5 -0
  60. package/types/humanoid/VRMHumanBoneName.d.ts +63 -58
  61. package/types/humanoid/VRMHumanBoneParentMap.d.ts +9 -0
  62. package/types/humanoid/VRMHumanBones.d.ts +11 -11
  63. package/types/humanoid/VRMHumanoid.d.ts +182 -73
  64. package/types/humanoid/VRMHumanoidLoaderPlugin.d.ts +32 -24
  65. package/types/humanoid/VRMHumanoidLoaderPluginOptions.d.ts +15 -0
  66. package/types/humanoid/VRMHumanoidRig.d.ts +31 -0
  67. package/types/humanoid/VRMPose.d.ts +24 -24
  68. package/types/humanoid/VRMPoseTransform.d.ts +15 -15
  69. package/types/humanoid/VRMRequiredHumanBoneName.d.ts +18 -18
  70. package/types/humanoid/VRMRig.d.ts +62 -0
  71. package/types/humanoid/helpers/VRMHumanoidHelper.d.ts +9 -0
  72. package/types/humanoid/helpers/index.d.ts +1 -0
  73. package/types/humanoid/index.d.ts +12 -8
  74. package/types/index.d.ts +9 -9
  75. package/types/lookAt/VRMLookAt.d.ts +148 -104
  76. package/types/lookAt/VRMLookAtApplier.d.ts +18 -12
  77. package/types/lookAt/VRMLookAtBoneApplier.d.ts +83 -50
  78. package/types/lookAt/VRMLookAtExpressionApplier.d.ts +56 -51
  79. package/types/lookAt/VRMLookAtLoaderPlugin.d.ts +30 -30
  80. package/types/lookAt/VRMLookAtLoaderPluginOptions.d.ts +8 -8
  81. package/types/lookAt/VRMLookAtRangeMap.d.ts +23 -23
  82. package/types/lookAt/VRMLookAtTypeName.d.ts +8 -8
  83. package/types/lookAt/helpers/VRMLookAtHelper.d.ts +11 -11
  84. package/types/lookAt/helpers/index.d.ts +1 -1
  85. package/types/lookAt/helpers/utils/FanBufferGeometry.d.ts +13 -13
  86. package/types/lookAt/helpers/utils/LineAndSphereBufferGeometry.d.ts +13 -13
  87. package/types/lookAt/index.d.ts +8 -8
  88. package/types/lookAt/tests/VRMLookAt.test.d.ts +1 -0
  89. package/types/lookAt/tests/VRMLookAtBoneApplier.test.d.ts +1 -0
  90. package/types/lookAt/utils/calcAzimuthAltitude.d.ts +13 -0
  91. package/types/lookAt/utils/sanitizeAngle.d.ts +11 -0
  92. package/types/lookAt/utils/tests/calcAzimuthAltitude.test.d.ts +1 -0
  93. package/types/lookAt/utils/tests/sanitizeAngle.test.d.ts +1 -0
  94. package/types/meta/VRM0Meta.d.ts +62 -62
  95. package/types/meta/VRM1Meta.d.ts +86 -86
  96. package/types/meta/VRMMeta.d.ts +6 -6
  97. package/types/meta/VRMMetaLoaderPlugin.d.ts +32 -32
  98. package/types/meta/VRMMetaLoaderPluginOptions.d.ts +22 -22
  99. package/types/meta/index.d.ts +5 -5
  100. package/types/tests/matchers/toBeCloseToQuaternion.d.ts +10 -0
  101. package/types/tests/matchers/toBeCloseToVector3.d.ts +10 -0
  102. package/types/utils/getWorldQuaternionLite.d.ts +8 -8
  103. package/types/utils/gltfExtractPrimitivesFromNode.d.ts +21 -21
  104. package/types/utils/gltfGetAssociatedMaterialIndex.d.ts +10 -10
  105. package/types/utils/quatInvertCompat.d.ts +8 -8
  106. package/types/utils/renameMaterialProperty.d.ts +1 -0
  107. package/types/utils/resolveURL.d.ts +4 -4
  108. package/types/utils/saturate.d.ts +6 -6
@@ -1,16 +1,16 @@
1
- import type { VRMExpressionManager } from './expressions/VRMExpressionManager';
2
- import type { VRMFirstPerson } from './firstPerson/VRMFirstPerson';
3
- import type { VRMHumanoid } from './humanoid/VRMHumanoid';
4
- import type { VRMLookAt } from './lookAt/VRMLookAt';
5
- import type { VRMMeta } from './meta/VRMMeta';
6
- /**
7
- * Parameters for a {@link VRMCore} class.
8
- */
9
- export interface VRMCoreParameters {
10
- scene: THREE.Group;
11
- humanoid?: VRMHumanoid;
12
- expressionManager?: VRMExpressionManager;
13
- firstPerson?: VRMFirstPerson;
14
- lookAt?: VRMLookAt;
15
- meta?: VRMMeta;
16
- }
1
+ import type { VRMExpressionManager } from './expressions/VRMExpressionManager';
2
+ import type { VRMFirstPerson } from './firstPerson/VRMFirstPerson';
3
+ import type { VRMHumanoid } from './humanoid/VRMHumanoid';
4
+ import type { VRMLookAt } from './lookAt/VRMLookAt';
5
+ import type { VRMMeta } from './meta/VRMMeta';
6
+ /**
7
+ * Parameters for a {@link VRMCore} class.
8
+ */
9
+ export interface VRMCoreParameters {
10
+ scene: THREE.Group;
11
+ meta: VRMMeta;
12
+ humanoid: VRMHumanoid;
13
+ expressionManager?: VRMExpressionManager;
14
+ firstPerson?: VRMFirstPerson;
15
+ lookAt?: VRMLookAt;
16
+ }
@@ -1,64 +1,64 @@
1
- import * as THREE from 'three';
2
- import { VRMExpressionBind } from './VRMExpressionBind';
3
- import type { VRMExpressionOverrideType } from './VRMExpressionOverrideType';
4
- export declare class VRMExpression extends THREE.Object3D {
5
- /**
6
- * Name of this expression.
7
- * Distinguished with `name` since `name` will be conflicted with Object3D.
8
- */
9
- expressionName: string;
10
- /**
11
- * The current weight of the expression.
12
- */
13
- weight: number;
14
- /**
15
- * Interpret non-zero values as 1.
16
- */
17
- isBinary: boolean;
18
- /**
19
- * Specify how the expression overrides blink expressions.
20
- */
21
- overrideBlink: VRMExpressionOverrideType;
22
- /**
23
- * Specify how the expression overrides lookAt expressions.
24
- */
25
- overrideLookAt: VRMExpressionOverrideType;
26
- /**
27
- * Specify how the expression overrides mouth expressions.
28
- */
29
- overrideMouth: VRMExpressionOverrideType;
30
- private _binds;
31
- /**
32
- * A value represents how much it should override blink expressions.
33
- * `0.0` == no override at all, `1.0` == completely block the expressions.
34
- */
35
- get overrideBlinkAmount(): number;
36
- /**
37
- * A value represents how much it should override lookAt expressions.
38
- * `0.0` == no override at all, `1.0` == completely block the expressions.
39
- */
40
- get overrideLookAtAmount(): number;
41
- /**
42
- * A value represents how much it should override mouth expressions.
43
- * `0.0` == no override at all, `1.0` == completely block the expressions.
44
- */
45
- get overrideMouthAmount(): number;
46
- constructor(expressionName: string);
47
- addBind(bind: VRMExpressionBind): void;
48
- /**
49
- * Apply weight to every assigned blend shapes.
50
- * Should be called every frame.
51
- */
52
- applyWeight(options?: {
53
- /**
54
- * Multiplies a value to its weight to apply.
55
- * Intended to be used for overriding an expression weight by another expression.
56
- * See also: {@link overrideBlink}, {@link overrideLookAt}, {@link overrideMouth}
57
- */
58
- multiplier?: number;
59
- }): void;
60
- /**
61
- * Clear previously assigned blend shapes.
62
- */
63
- clearAppliedWeight(): void;
64
- }
1
+ import * as THREE from 'three';
2
+ import { VRMExpressionBind } from './VRMExpressionBind';
3
+ import type { VRMExpressionOverrideType } from './VRMExpressionOverrideType';
4
+ export declare class VRMExpression extends THREE.Object3D {
5
+ /**
6
+ * Name of this expression.
7
+ * Distinguished with `name` since `name` will be conflicted with Object3D.
8
+ */
9
+ expressionName: string;
10
+ /**
11
+ * The current weight of the expression.
12
+ */
13
+ weight: number;
14
+ /**
15
+ * Interpret values greater than 0.5 as 1.0, ortherwise 0.0.
16
+ */
17
+ isBinary: boolean;
18
+ /**
19
+ * Specify how the expression overrides blink expressions.
20
+ */
21
+ overrideBlink: VRMExpressionOverrideType;
22
+ /**
23
+ * Specify how the expression overrides lookAt expressions.
24
+ */
25
+ overrideLookAt: VRMExpressionOverrideType;
26
+ /**
27
+ * Specify how the expression overrides mouth expressions.
28
+ */
29
+ overrideMouth: VRMExpressionOverrideType;
30
+ private _binds;
31
+ /**
32
+ * A value represents how much it should override blink expressions.
33
+ * `0.0` == no override at all, `1.0` == completely block the expressions.
34
+ */
35
+ get overrideBlinkAmount(): number;
36
+ /**
37
+ * A value represents how much it should override lookAt expressions.
38
+ * `0.0` == no override at all, `1.0` == completely block the expressions.
39
+ */
40
+ get overrideLookAtAmount(): number;
41
+ /**
42
+ * A value represents how much it should override mouth expressions.
43
+ * `0.0` == no override at all, `1.0` == completely block the expressions.
44
+ */
45
+ get overrideMouthAmount(): number;
46
+ constructor(expressionName: string);
47
+ addBind(bind: VRMExpressionBind): void;
48
+ /**
49
+ * Apply weight to every assigned blend shapes.
50
+ * Should be called every frame.
51
+ */
52
+ applyWeight(options?: {
53
+ /**
54
+ * Multiplies a value to its weight to apply.
55
+ * Intended to be used for overriding an expression weight by another expression.
56
+ * See also: {@link overrideBlink}, {@link overrideLookAt}, {@link overrideMouth}
57
+ */
58
+ multiplier?: number;
59
+ }): void;
60
+ /**
61
+ * Clear previously assigned blend shapes.
62
+ */
63
+ clearAppliedWeight(): void;
64
+ }
@@ -1,11 +1,11 @@
1
- export interface VRMExpressionBind {
2
- /**
3
- * Apply a weight to this bind.
4
- * Applied weights will be accumulated until {@link clearAppliedWeight} is called.
5
- */
6
- applyWeight(weight: number): void;
7
- /**
8
- * Clear previously applied weights.
9
- */
10
- clearAppliedWeight(): void;
11
- }
1
+ export interface VRMExpressionBind {
2
+ /**
3
+ * Apply a weight to this bind.
4
+ * Applied weights will be accumulated until {@link clearAppliedWeight} is called.
5
+ */
6
+ applyWeight(weight: number): void;
7
+ /**
8
+ * Clear previously applied weights.
9
+ */
10
+ clearAppliedWeight(): void;
11
+ }
@@ -1,23 +1,23 @@
1
- import type * as V0VRM from '@pixiv/types-vrm-0.0';
2
- import { GLTF, GLTFLoaderPlugin, GLTFParser } from 'three/examples/jsm/loaders/GLTFLoader.js';
3
- import { VRMExpressionPresetName } from './VRMExpressionPresetName';
4
- /**
5
- * A plugin of GLTFLoader that imports a {@link VRMExpressionManager} from a VRM extension of a GLTF.
6
- */
7
- export declare class VRMExpressionLoaderPlugin implements GLTFLoaderPlugin {
8
- static readonly v0v1PresetNameMap: {
9
- [v0Name in V0VRM.BlendShapePresetName]?: VRMExpressionPresetName;
10
- };
11
- readonly parser: GLTFParser;
12
- get name(): string;
13
- constructor(parser: GLTFParser);
14
- afterRoot(gltf: GLTF): Promise<void>;
15
- /**
16
- * Import a {@link VRMExpressionManager} from a VRM.
17
- *
18
- * @param gltf A parsed result of GLTF taken from GLTFLoader
19
- */
20
- private _import;
21
- private _v1Import;
22
- private _v0Import;
23
- }
1
+ import type * as V0VRM from '@pixiv/types-vrm-0.0';
2
+ import { GLTF, GLTFLoaderPlugin, GLTFParser } from 'three/examples/jsm/loaders/GLTFLoader.js';
3
+ import { VRMExpressionPresetName } from './VRMExpressionPresetName';
4
+ /**
5
+ * A plugin of GLTFLoader that imports a {@link VRMExpressionManager} from a VRM extension of a GLTF.
6
+ */
7
+ export declare class VRMExpressionLoaderPlugin implements GLTFLoaderPlugin {
8
+ static readonly v0v1PresetNameMap: {
9
+ [v0Name in V0VRM.BlendShapePresetName]?: VRMExpressionPresetName;
10
+ };
11
+ readonly parser: GLTFParser;
12
+ get name(): string;
13
+ constructor(parser: GLTFParser);
14
+ afterRoot(gltf: GLTF): Promise<void>;
15
+ /**
16
+ * Import a {@link VRMExpressionManager} from a VRM.
17
+ *
18
+ * @param gltf A parsed result of GLTF taken from GLTFLoader
19
+ */
20
+ private _import;
21
+ private _v1Import;
22
+ private _v0Import;
23
+ }
@@ -1,124 +1,124 @@
1
- import { VRMExpressionPresetName } from './VRMExpressionPresetName';
2
- import type { VRMExpression } from './VRMExpression';
3
- export declare class VRMExpressionManager {
4
- /**
5
- * A set of name or preset name of expressions that will be overridden by {@link VRMExpression.overrideBlink}.
6
- */
7
- blinkExpressionNames: string[];
8
- /**
9
- * A set of name or preset name of expressions that will be overridden by {@link VRMExpression.overrideLookAt}.
10
- */
11
- lookAtExpressionNames: string[];
12
- /**
13
- * A set of name or preset name of expressions that will be overridden by {@link VRMExpression.overrideMouth}.
14
- */
15
- mouthExpressionNames: string[];
16
- /**
17
- * A set of {@link VRMExpression}.
18
- * When you want to register expressions, use {@link registerExpression}
19
- */
20
- private _expressions;
21
- get expressions(): VRMExpression[];
22
- /**
23
- * A map from name to expression.
24
- */
25
- private _expressionMap;
26
- get expressionMap(): {
27
- [name: string]: VRMExpression;
28
- };
29
- /**
30
- * A map from name to expression, but excluding custom expressions.
31
- */
32
- get presetExpressionMap(): {
33
- [name in VRMExpressionPresetName]?: VRMExpression;
34
- };
35
- /**
36
- * A map from name to expression, but excluding preset expressions.
37
- */
38
- get customExpressionMap(): {
39
- [name: string]: VRMExpression;
40
- };
41
- /**
42
- * Create a new {@link VRMExpressionManager}.
43
- */
44
- constructor();
45
- /**
46
- * Copy the given {@link VRMExpressionManager} into this one.
47
- * @param source The {@link VRMExpressionManager} you want to copy
48
- * @returns this
49
- */
50
- copy(source: VRMExpressionManager): this;
51
- /**
52
- * Returns a clone of this {@link VRMExpressionManager}.
53
- * @returns Copied {@link VRMExpressionManager}
54
- */
55
- clone(): VRMExpressionManager;
56
- /**
57
- * Return a registered expression.
58
- * If it cannot find an expression, it will return `null` instead.
59
- *
60
- * @param name Name or preset name of the expression
61
- */
62
- getExpression(name: VRMExpressionPresetName | string): VRMExpression | null;
63
- /**
64
- * Register an expression.
65
- *
66
- * @param expression {@link VRMExpression} that describes the expression
67
- */
68
- registerExpression(expression: VRMExpression): void;
69
- /**
70
- * Unregister an expression.
71
- *
72
- * @param expression The expression you want to unregister
73
- */
74
- unregisterExpression(expression: VRMExpression): void;
75
- /**
76
- * Get the current weight of the specified expression.
77
- * If it doesn't have an expression of given name, it will return `null` instead.
78
- *
79
- * @param name Name of the expression
80
- */
81
- getValue(name: VRMExpressionPresetName | string): number | null;
82
- /**
83
- * Set a weight to the specified expression.
84
- *
85
- * @param name Name of the expression
86
- * @param weight Weight
87
- */
88
- setValue(name: VRMExpressionPresetName | string, weight: number): void;
89
- /**
90
- * Get a track name of specified expression.
91
- * This track name is needed to manipulate its expression via keyframe animations.
92
- *
93
- * @example Manipulate an expression using keyframe animation
94
- * ```js
95
- * const trackName = vrm.expressionManager.getExpressionTrackName( 'blink' );
96
- * const track = new THREE.NumberKeyframeTrack(
97
- * name,
98
- * [ 0.0, 0.5, 1.0 ], // times
99
- * [ 0.0, 1.0, 0.0 ] // values
100
- * );
101
- *
102
- * const clip = new THREE.AnimationClip(
103
- * 'blink', // name
104
- * 1.0, // duration
105
- * [ track ] // tracks
106
- * );
107
- *
108
- * const mixer = new THREE.AnimationMixer( vrm.scene );
109
- * const action = mixer.clipAction( clip );
110
- * action.play();
111
- * ```
112
- *
113
- * @param name Name of the expression
114
- */
115
- getExpressionTrackName(name: VRMExpressionPresetName | string): string | null;
116
- /**
117
- * Update every expressions.
118
- */
119
- update(): void;
120
- /**
121
- * Calculate sum of override amounts to see how much we should multiply weights of certain expressions.
122
- */
123
- private _calculateWeightMultipliers;
124
- }
1
+ import { VRMExpressionPresetName } from './VRMExpressionPresetName';
2
+ import type { VRMExpression } from './VRMExpression';
3
+ export declare class VRMExpressionManager {
4
+ /**
5
+ * A set of name or preset name of expressions that will be overridden by {@link VRMExpression.overrideBlink}.
6
+ */
7
+ blinkExpressionNames: string[];
8
+ /**
9
+ * A set of name or preset name of expressions that will be overridden by {@link VRMExpression.overrideLookAt}.
10
+ */
11
+ lookAtExpressionNames: string[];
12
+ /**
13
+ * A set of name or preset name of expressions that will be overridden by {@link VRMExpression.overrideMouth}.
14
+ */
15
+ mouthExpressionNames: string[];
16
+ /**
17
+ * A set of {@link VRMExpression}.
18
+ * When you want to register expressions, use {@link registerExpression}
19
+ */
20
+ private _expressions;
21
+ get expressions(): VRMExpression[];
22
+ /**
23
+ * A map from name to expression.
24
+ */
25
+ private _expressionMap;
26
+ get expressionMap(): {
27
+ [name: string]: VRMExpression;
28
+ };
29
+ /**
30
+ * A map from name to expression, but excluding custom expressions.
31
+ */
32
+ get presetExpressionMap(): {
33
+ [name in VRMExpressionPresetName]?: VRMExpression;
34
+ };
35
+ /**
36
+ * A map from name to expression, but excluding preset expressions.
37
+ */
38
+ get customExpressionMap(): {
39
+ [name: string]: VRMExpression;
40
+ };
41
+ /**
42
+ * Create a new {@link VRMExpressionManager}.
43
+ */
44
+ constructor();
45
+ /**
46
+ * Copy the given {@link VRMExpressionManager} into this one.
47
+ * @param source The {@link VRMExpressionManager} you want to copy
48
+ * @returns this
49
+ */
50
+ copy(source: VRMExpressionManager): this;
51
+ /**
52
+ * Returns a clone of this {@link VRMExpressionManager}.
53
+ * @returns Copied {@link VRMExpressionManager}
54
+ */
55
+ clone(): VRMExpressionManager;
56
+ /**
57
+ * Return a registered expression.
58
+ * If it cannot find an expression, it will return `null` instead.
59
+ *
60
+ * @param name Name or preset name of the expression
61
+ */
62
+ getExpression(name: VRMExpressionPresetName | string): VRMExpression | null;
63
+ /**
64
+ * Register an expression.
65
+ *
66
+ * @param expression {@link VRMExpression} that describes the expression
67
+ */
68
+ registerExpression(expression: VRMExpression): void;
69
+ /**
70
+ * Unregister an expression.
71
+ *
72
+ * @param expression The expression you want to unregister
73
+ */
74
+ unregisterExpression(expression: VRMExpression): void;
75
+ /**
76
+ * Get the current weight of the specified expression.
77
+ * If it doesn't have an expression of given name, it will return `null` instead.
78
+ *
79
+ * @param name Name of the expression
80
+ */
81
+ getValue(name: VRMExpressionPresetName | string): number | null;
82
+ /**
83
+ * Set a weight to the specified expression.
84
+ *
85
+ * @param name Name of the expression
86
+ * @param weight Weight
87
+ */
88
+ setValue(name: VRMExpressionPresetName | string, weight: number): void;
89
+ /**
90
+ * Get a track name of specified expression.
91
+ * This track name is needed to manipulate its expression via keyframe animations.
92
+ *
93
+ * @example Manipulate an expression using keyframe animation
94
+ * ```js
95
+ * const trackName = vrm.expressionManager.getExpressionTrackName( 'blink' );
96
+ * const track = new THREE.NumberKeyframeTrack(
97
+ * name,
98
+ * [ 0.0, 0.5, 1.0 ], // times
99
+ * [ 0.0, 1.0, 0.0 ] // values
100
+ * );
101
+ *
102
+ * const clip = new THREE.AnimationClip(
103
+ * 'blink', // name
104
+ * 1.0, // duration
105
+ * [ track ] // tracks
106
+ * );
107
+ *
108
+ * const mixer = new THREE.AnimationMixer( vrm.scene );
109
+ * const action = mixer.clipAction( clip );
110
+ * action.play();
111
+ * ```
112
+ *
113
+ * @param name Name of the expression
114
+ */
115
+ getExpressionTrackName(name: VRMExpressionPresetName | string): string | null;
116
+ /**
117
+ * Update every expressions.
118
+ */
119
+ update(): void;
120
+ /**
121
+ * Calculate sum of override amounts to see how much we should multiply weights of certain expressions.
122
+ */
123
+ private _calculateWeightMultipliers;
124
+ }
@@ -1,42 +1,45 @@
1
- import * as THREE from 'three';
2
- import type { VRMExpressionBind } from './VRMExpressionBind';
3
- import type { VRMExpressionMaterialColorType } from './VRMExpressionMaterialColorType';
4
- /**
5
- * A bind of expression influences to a material color.
6
- */
7
- export declare class VRMExpressionMaterialColorBind implements VRMExpressionBind {
8
- private static _propertyNameMapMap;
9
- /**
10
- * The target material.
11
- */
12
- readonly material: THREE.Material;
13
- /**
14
- * The type of the target property of the material.
15
- */
16
- readonly type: VRMExpressionMaterialColorType;
17
- /**
18
- * The target color.
19
- */
20
- readonly targetValue: THREE.Color;
21
- /**
22
- * Its state.
23
- * If it cannot find the target property in constructor, it will be null instead.
24
- */
25
- private _state;
26
- constructor({ material, type, targetValue, }: {
27
- /**
28
- * The target material.
29
- */
30
- material: THREE.Material;
31
- /**
32
- * The type of the target property of the material.
33
- */
34
- type: VRMExpressionMaterialColorType;
35
- /**
36
- * The target color.
37
- */
38
- targetValue: THREE.Color;
39
- });
40
- applyWeight(weight: number): void;
41
- clearAppliedWeight(): void;
42
- }
1
+ import * as THREE from 'three';
2
+ import type { VRMExpressionBind } from './VRMExpressionBind';
3
+ import type { VRMExpressionMaterialColorType } from './VRMExpressionMaterialColorType';
4
+ /**
5
+ * A bind of expression influences to a material color.
6
+ */
7
+ export declare class VRMExpressionMaterialColorBind implements VRMExpressionBind {
8
+ /**
9
+ * Mapping of property names from VRMC/materialColorBinds.type to three.js/Material.
10
+ */
11
+ private static _propertyNameMapMap;
12
+ /**
13
+ * The target material.
14
+ */
15
+ readonly material: THREE.Material;
16
+ /**
17
+ * The type of the target property of the material.
18
+ */
19
+ readonly type: VRMExpressionMaterialColorType;
20
+ /**
21
+ * The target color.
22
+ */
23
+ readonly targetValue: THREE.Color;
24
+ /**
25
+ * Its state.
26
+ * If it cannot find the target property in constructor, it will be null instead.
27
+ */
28
+ private _state;
29
+ constructor({ material, type, targetValue, }: {
30
+ /**
31
+ * The target material.
32
+ */
33
+ material: THREE.Material;
34
+ /**
35
+ * The type of the target property of the material.
36
+ */
37
+ type: VRMExpressionMaterialColorType;
38
+ /**
39
+ * The target color.
40
+ */
41
+ targetValue: THREE.Color;
42
+ });
43
+ applyWeight(weight: number): void;
44
+ clearAppliedWeight(): void;
45
+ }
@@ -1,8 +1,12 @@
1
- export declare const VRMExpressionMaterialColorType: {
2
- readonly Color: "color";
3
- readonly EmissionColor: "emissionColor";
4
- readonly ShadeColor: "shadeColor";
5
- readonly RimColor: "rimColor";
6
- readonly OutlineColor: "outlineColor";
7
- };
8
- export declare type VRMExpressionMaterialColorType = typeof VRMExpressionMaterialColorType[keyof typeof VRMExpressionMaterialColorType];
1
+ export declare const VRMExpressionMaterialColorType: {
2
+ readonly Color: "color";
3
+ readonly EmissionColor: "emissionColor";
4
+ readonly ShadeColor: "shadeColor";
5
+ readonly MatcapColor: "matcapColor";
6
+ readonly RimColor: "rimColor";
7
+ readonly OutlineColor: "outlineColor";
8
+ };
9
+ export declare type VRMExpressionMaterialColorType = typeof VRMExpressionMaterialColorType[keyof typeof VRMExpressionMaterialColorType];
10
+ export declare const v0ExpressionMaterialColorMap: {
11
+ [key: string]: VRMExpressionMaterialColorType | undefined;
12
+ };
@@ -1,35 +1,35 @@
1
- import type * as THREE from 'three';
2
- import type { VRMExpressionBind } from './VRMExpressionBind';
3
- /**
4
- * A bind of {@link VRMExpression} influences to morph targets.
5
- */
6
- export declare class VRMExpressionMorphTargetBind implements VRMExpressionBind {
7
- /**
8
- * The mesh primitives that attached to target mesh.
9
- */
10
- readonly primitives: THREE.Mesh[];
11
- /**
12
- * The index of the morph target in the mesh.
13
- */
14
- readonly index: number;
15
- /**
16
- * The weight value of target morph target. Ranging in [0.0 - 1.0].
17
- */
18
- readonly weight: number;
19
- constructor({ primitives, index, weight, }: {
20
- /**
21
- * The mesh primitives that attached to target mesh.
22
- */
23
- primitives: THREE.Mesh[];
24
- /**
25
- * The index of the morph target in the mesh.
26
- */
27
- index: number;
28
- /**
29
- * The weight value of target morph target. Ranging in [0.0 - 1.0].
30
- */
31
- weight: number;
32
- });
33
- applyWeight(weight: number): void;
34
- clearAppliedWeight(): void;
35
- }
1
+ import type * as THREE from 'three';
2
+ import type { VRMExpressionBind } from './VRMExpressionBind';
3
+ /**
4
+ * A bind of {@link VRMExpression} influences to morph targets.
5
+ */
6
+ export declare class VRMExpressionMorphTargetBind implements VRMExpressionBind {
7
+ /**
8
+ * The mesh primitives that attached to target mesh.
9
+ */
10
+ readonly primitives: THREE.Mesh[];
11
+ /**
12
+ * The index of the morph target in the mesh.
13
+ */
14
+ readonly index: number;
15
+ /**
16
+ * The weight value of target morph target. Ranging in [0.0 - 1.0].
17
+ */
18
+ readonly weight: number;
19
+ constructor({ primitives, index, weight, }: {
20
+ /**
21
+ * The mesh primitives that attached to target mesh.
22
+ */
23
+ primitives: THREE.Mesh[];
24
+ /**
25
+ * The index of the morph target in the mesh.
26
+ */
27
+ index: number;
28
+ /**
29
+ * The weight value of target morph target. Ranging in [0.0 - 1.0].
30
+ */
31
+ weight: number;
32
+ });
33
+ applyWeight(weight: number): void;
34
+ clearAppliedWeight(): void;
35
+ }