@pixiv/three-vrm 0.6.7 → 0.6.8
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/LICENSE +22 -0
- package/README.md +2 -2
- package/lib/three-vrm.js +3638 -3500
- package/lib/three-vrm.min.js +1 -1
- package/lib/three-vrm.module.js +3639 -3500
- package/lib/three-vrm.module.min.js +2 -2
- package/package.json +7 -9
- package/ts3.4/types/VRMUtils/index.d.ts +2 -0
- package/ts3.4/types/VRMUtils/removeUnnecessaryVertices.d.ts +12 -0
- package/ts3.4/types/material/getTexelDecodingFunction.d.ts +6 -0
- package/types/VRM.d.ts +110 -110
- package/types/VRMImporter.d.ts +42 -42
- package/types/VRMUtils/extractThumbnailBlob.d.ts +10 -10
- package/types/VRMUtils/index.d.ts +9 -7
- package/types/VRMUtils/removeUnnecessaryJoints.d.ts +9 -9
- package/types/VRMUtils/removeUnnecessaryVertices.d.ts +12 -0
- package/types/blendshape/VRMBlendShapeGroup.d.ts +50 -50
- package/types/blendshape/VRMBlendShapeImporter.d.ts +13 -13
- package/types/blendshape/VRMBlendShapeProxy.d.ts +91 -91
- package/types/blendshape/index.d.ts +3 -3
- package/types/debug/VRMDebug.d.ts +28 -28
- package/types/debug/VRMDebugOptions.d.ts +10 -10
- package/types/debug/VRMImporterDebug.d.ts +11 -11
- package/types/debug/VRMLookAtHeadDebug.d.ts +8 -8
- package/types/debug/VRMLookAtImporterDebug.d.ts +9 -9
- package/types/debug/VRMSpringBoneDebug.d.ts +14 -14
- package/types/debug/VRMSpringBoneImporterDebug.d.ts +10 -10
- package/types/debug/VRMSpringBoneManagerDebug.d.ts +11 -11
- package/types/debug/index.d.ts +4 -4
- package/types/firstperson/VRMFirstPerson.d.ts +116 -116
- package/types/firstperson/VRMFirstPersonImporter.d.ts +15 -15
- package/types/firstperson/index.d.ts +2 -2
- package/types/humanoid/VRMHumanBone.d.ts +22 -22
- package/types/humanoid/VRMHumanBoneArray.d.ts +9 -9
- package/types/humanoid/VRMHumanBones.d.ts +8 -8
- package/types/humanoid/VRMHumanDescription.d.ts +14 -14
- package/types/humanoid/VRMHumanLimit.d.ts +12 -12
- package/types/humanoid/VRMHumanoid.d.ts +87 -87
- package/types/humanoid/VRMHumanoidImporter.d.ts +13 -13
- package/types/humanoid/index.d.ts +6 -6
- package/types/index.d.ts +12 -12
- package/types/lookat/VRMCurveMapper.d.ts +36 -36
- package/types/lookat/VRMLookAtApplyer.d.ts +18 -18
- package/types/lookat/VRMLookAtBlendShapeApplyer.d.ts +26 -26
- package/types/lookat/VRMLookAtBoneApplyer.d.ts +28 -28
- package/types/lookat/VRMLookAtHead.d.ts +57 -57
- package/types/lookat/VRMLookAtImporter.d.ts +23 -23
- package/types/lookat/index.d.ts +6 -6
- package/types/material/MToonMaterial.d.ts +206 -206
- package/types/material/VRMMaterialImporter.d.ts +50 -50
- package/types/material/VRMUnlitMaterial.d.ts +46 -46
- package/types/material/getTexelDecodingFunction.d.ts +9 -3
- package/types/material/index.d.ts +3 -3
- package/types/meta/VRMMeta.d.ts +59 -59
- package/types/meta/VRMMetaImporter.d.ts +14 -14
- package/types/meta/VRMMetaImporterOptions.d.ts +9 -9
- package/types/meta/index.d.ts +3 -3
- package/types/springbone/VRMSpringBone.d.ts +130 -130
- package/types/springbone/VRMSpringBoneColliderGroup.d.ts +15 -15
- package/types/springbone/VRMSpringBoneImporter.d.ts +34 -34
- package/types/springbone/VRMSpringBoneManager.d.ts +35 -35
- package/types/springbone/VRMSpringBoneParameters.d.ts +9 -9
- package/types/springbone/index.d.ts +5 -5
- package/types/types/GLTFSchema.d.ts +887 -887
- package/types/types/VRMSchema.d.ts +440 -440
- package/types/types/index.d.ts +3 -3
- package/types/types/types.d.ts +64 -64
- package/types/utils/Matrix4InverseCache.d.ts +28 -28
- package/types/utils/disposer.d.ts +2 -2
- package/types/utils/gltfExtractPrimitivesFromNode.d.ts +22 -22
- package/types/utils/mat4InvertCompat.d.ts +8 -8
- package/types/utils/math.d.ts +40 -40
- package/types/utils/quatInvertCompat.d.ts +8 -8
- package/types/utils/renameMaterialProperty.d.ts +1 -1
package/types/VRM.d.ts
CHANGED
|
@@ -1,110 +1,110 @@
|
|
|
1
|
-
import * as THREE from 'three';
|
|
2
|
-
import { GLTF } from 'three/examples/jsm/loaders/GLTFLoader';
|
|
3
|
-
import { VRMBlendShapeProxy } from './blendshape';
|
|
4
|
-
import { VRMFirstPerson } from './firstperson';
|
|
5
|
-
import { VRMHumanoid } from './humanoid';
|
|
6
|
-
import { VRMLookAtHead } from './lookat';
|
|
7
|
-
import { VRMMeta } from './meta/VRMMeta';
|
|
8
|
-
import { VRMSpringBoneManager } from './springbone';
|
|
9
|
-
import { VRMImporterOptions } from './VRMImporter';
|
|
10
|
-
/**
|
|
11
|
-
* Parameters for a [[VRM]] class.
|
|
12
|
-
*/
|
|
13
|
-
export interface VRMParameters {
|
|
14
|
-
scene: THREE.Scene | THREE.Group;
|
|
15
|
-
humanoid?: VRMHumanoid;
|
|
16
|
-
blendShapeProxy?: VRMBlendShapeProxy;
|
|
17
|
-
firstPerson?: VRMFirstPerson;
|
|
18
|
-
lookAt?: VRMLookAtHead;
|
|
19
|
-
materials?: THREE.Material[];
|
|
20
|
-
springBoneManager?: VRMSpringBoneManager;
|
|
21
|
-
meta?: VRMMeta;
|
|
22
|
-
}
|
|
23
|
-
/**
|
|
24
|
-
* A class that represents a single VRM model.
|
|
25
|
-
* See the documentation of [[VRM.from]] for the most basic use of VRM.
|
|
26
|
-
*/
|
|
27
|
-
export declare class VRM {
|
|
28
|
-
/**
|
|
29
|
-
* Create a new VRM from a parsed result of GLTF taken from GLTFLoader.
|
|
30
|
-
* It's probably a thing what you want to get started with VRMs.
|
|
31
|
-
*
|
|
32
|
-
* @example Most basic use of VRM
|
|
33
|
-
* ```
|
|
34
|
-
* const scene = new THREE.Scene();
|
|
35
|
-
*
|
|
36
|
-
* new THREE.GLTFLoader().load( 'models/three-vrm-girl.vrm', ( gltf ) => {
|
|
37
|
-
*
|
|
38
|
-
* THREE.VRM.from( gltf ).then( ( vrm ) => {
|
|
39
|
-
*
|
|
40
|
-
* scene.add( vrm.scene );
|
|
41
|
-
*
|
|
42
|
-
* } );
|
|
43
|
-
*
|
|
44
|
-
* } );
|
|
45
|
-
* ```
|
|
46
|
-
*
|
|
47
|
-
* @param gltf A parsed GLTF object taken from GLTFLoader
|
|
48
|
-
* @param options Options that will be used in importer
|
|
49
|
-
*/
|
|
50
|
-
static from(gltf: GLTF, options?: VRMImporterOptions): Promise<VRM>;
|
|
51
|
-
/**
|
|
52
|
-
* `THREE.Scene` or `THREE.Group` (depends on your three.js revision) that contains the entire VRM.
|
|
53
|
-
*/
|
|
54
|
-
readonly scene: THREE.Scene | THREE.Group;
|
|
55
|
-
/**
|
|
56
|
-
* Contains [[VRMHumanoid]] of the VRM.
|
|
57
|
-
* You can control each bones using [[VRMHumanoid.getBoneNode]].
|
|
58
|
-
*
|
|
59
|
-
* @TODO Add a link to VRM spec
|
|
60
|
-
*/
|
|
61
|
-
readonly humanoid?: VRMHumanoid;
|
|
62
|
-
/**
|
|
63
|
-
* Contains [[VRMBlendShapeProxy]] of the VRM.
|
|
64
|
-
* You might want to control these facial expressions via [[VRMBlendShapeProxy.setValue]].
|
|
65
|
-
*/
|
|
66
|
-
readonly blendShapeProxy?: VRMBlendShapeProxy;
|
|
67
|
-
/**
|
|
68
|
-
* Contains [[VRMFirstPerson]] of the VRM.
|
|
69
|
-
* You can use various feature of the firstPerson field.
|
|
70
|
-
*/
|
|
71
|
-
readonly firstPerson?: VRMFirstPerson;
|
|
72
|
-
/**
|
|
73
|
-
* Contains [[VRMLookAtHead]] of the VRM.
|
|
74
|
-
* You might want to use [[VRMLookAtHead.target]] to control the eye direction of your VRMs.
|
|
75
|
-
*/
|
|
76
|
-
readonly lookAt?: VRMLookAtHead;
|
|
77
|
-
/**
|
|
78
|
-
* Contains materials of the VRM.
|
|
79
|
-
* `updateVRMMaterials` method of these materials will be called via its [[VRM.update]] method.
|
|
80
|
-
*/
|
|
81
|
-
readonly materials?: THREE.Material[];
|
|
82
|
-
/**
|
|
83
|
-
* Contains meta fields of the VRM.
|
|
84
|
-
* You might want to refer these license fields before use your VRMs.
|
|
85
|
-
*/
|
|
86
|
-
readonly meta?: VRMMeta;
|
|
87
|
-
/**
|
|
88
|
-
* A [[VRMSpringBoneManager]] manipulates all spring bones attached on the VRM.
|
|
89
|
-
* Usually you don't have to care about this property.
|
|
90
|
-
*/
|
|
91
|
-
readonly springBoneManager?: VRMSpringBoneManager;
|
|
92
|
-
/**
|
|
93
|
-
* Create a new VRM instance.
|
|
94
|
-
*
|
|
95
|
-
* @param params [[VRMParameters]] that represents components of the VRM
|
|
96
|
-
*/
|
|
97
|
-
constructor(params: VRMParameters);
|
|
98
|
-
/**
|
|
99
|
-
* **You need to call this on your update loop.**
|
|
100
|
-
*
|
|
101
|
-
* This function updates every VRM components.
|
|
102
|
-
*
|
|
103
|
-
* @param delta deltaTime
|
|
104
|
-
*/
|
|
105
|
-
update(delta: number): void;
|
|
106
|
-
/**
|
|
107
|
-
* Dispose everything about the VRM instance.
|
|
108
|
-
*/
|
|
109
|
-
dispose(): void;
|
|
110
|
-
}
|
|
1
|
+
import * as THREE from 'three';
|
|
2
|
+
import { GLTF } from 'three/examples/jsm/loaders/GLTFLoader';
|
|
3
|
+
import { VRMBlendShapeProxy } from './blendshape';
|
|
4
|
+
import { VRMFirstPerson } from './firstperson';
|
|
5
|
+
import { VRMHumanoid } from './humanoid';
|
|
6
|
+
import { VRMLookAtHead } from './lookat';
|
|
7
|
+
import { VRMMeta } from './meta/VRMMeta';
|
|
8
|
+
import { VRMSpringBoneManager } from './springbone';
|
|
9
|
+
import { VRMImporterOptions } from './VRMImporter';
|
|
10
|
+
/**
|
|
11
|
+
* Parameters for a [[VRM]] class.
|
|
12
|
+
*/
|
|
13
|
+
export interface VRMParameters {
|
|
14
|
+
scene: THREE.Scene | THREE.Group;
|
|
15
|
+
humanoid?: VRMHumanoid;
|
|
16
|
+
blendShapeProxy?: VRMBlendShapeProxy;
|
|
17
|
+
firstPerson?: VRMFirstPerson;
|
|
18
|
+
lookAt?: VRMLookAtHead;
|
|
19
|
+
materials?: THREE.Material[];
|
|
20
|
+
springBoneManager?: VRMSpringBoneManager;
|
|
21
|
+
meta?: VRMMeta;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* A class that represents a single VRM model.
|
|
25
|
+
* See the documentation of [[VRM.from]] for the most basic use of VRM.
|
|
26
|
+
*/
|
|
27
|
+
export declare class VRM {
|
|
28
|
+
/**
|
|
29
|
+
* Create a new VRM from a parsed result of GLTF taken from GLTFLoader.
|
|
30
|
+
* It's probably a thing what you want to get started with VRMs.
|
|
31
|
+
*
|
|
32
|
+
* @example Most basic use of VRM
|
|
33
|
+
* ```
|
|
34
|
+
* const scene = new THREE.Scene();
|
|
35
|
+
*
|
|
36
|
+
* new THREE.GLTFLoader().load( 'models/three-vrm-girl.vrm', ( gltf ) => {
|
|
37
|
+
*
|
|
38
|
+
* THREE.VRM.from( gltf ).then( ( vrm ) => {
|
|
39
|
+
*
|
|
40
|
+
* scene.add( vrm.scene );
|
|
41
|
+
*
|
|
42
|
+
* } );
|
|
43
|
+
*
|
|
44
|
+
* } );
|
|
45
|
+
* ```
|
|
46
|
+
*
|
|
47
|
+
* @param gltf A parsed GLTF object taken from GLTFLoader
|
|
48
|
+
* @param options Options that will be used in importer
|
|
49
|
+
*/
|
|
50
|
+
static from(gltf: GLTF, options?: VRMImporterOptions): Promise<VRM>;
|
|
51
|
+
/**
|
|
52
|
+
* `THREE.Scene` or `THREE.Group` (depends on your three.js revision) that contains the entire VRM.
|
|
53
|
+
*/
|
|
54
|
+
readonly scene: THREE.Scene | THREE.Group;
|
|
55
|
+
/**
|
|
56
|
+
* Contains [[VRMHumanoid]] of the VRM.
|
|
57
|
+
* You can control each bones using [[VRMHumanoid.getBoneNode]].
|
|
58
|
+
*
|
|
59
|
+
* @TODO Add a link to VRM spec
|
|
60
|
+
*/
|
|
61
|
+
readonly humanoid?: VRMHumanoid;
|
|
62
|
+
/**
|
|
63
|
+
* Contains [[VRMBlendShapeProxy]] of the VRM.
|
|
64
|
+
* You might want to control these facial expressions via [[VRMBlendShapeProxy.setValue]].
|
|
65
|
+
*/
|
|
66
|
+
readonly blendShapeProxy?: VRMBlendShapeProxy;
|
|
67
|
+
/**
|
|
68
|
+
* Contains [[VRMFirstPerson]] of the VRM.
|
|
69
|
+
* You can use various feature of the firstPerson field.
|
|
70
|
+
*/
|
|
71
|
+
readonly firstPerson?: VRMFirstPerson;
|
|
72
|
+
/**
|
|
73
|
+
* Contains [[VRMLookAtHead]] of the VRM.
|
|
74
|
+
* You might want to use [[VRMLookAtHead.target]] to control the eye direction of your VRMs.
|
|
75
|
+
*/
|
|
76
|
+
readonly lookAt?: VRMLookAtHead;
|
|
77
|
+
/**
|
|
78
|
+
* Contains materials of the VRM.
|
|
79
|
+
* `updateVRMMaterials` method of these materials will be called via its [[VRM.update]] method.
|
|
80
|
+
*/
|
|
81
|
+
readonly materials?: THREE.Material[];
|
|
82
|
+
/**
|
|
83
|
+
* Contains meta fields of the VRM.
|
|
84
|
+
* You might want to refer these license fields before use your VRMs.
|
|
85
|
+
*/
|
|
86
|
+
readonly meta?: VRMMeta;
|
|
87
|
+
/**
|
|
88
|
+
* A [[VRMSpringBoneManager]] manipulates all spring bones attached on the VRM.
|
|
89
|
+
* Usually you don't have to care about this property.
|
|
90
|
+
*/
|
|
91
|
+
readonly springBoneManager?: VRMSpringBoneManager;
|
|
92
|
+
/**
|
|
93
|
+
* Create a new VRM instance.
|
|
94
|
+
*
|
|
95
|
+
* @param params [[VRMParameters]] that represents components of the VRM
|
|
96
|
+
*/
|
|
97
|
+
constructor(params: VRMParameters);
|
|
98
|
+
/**
|
|
99
|
+
* **You need to call this on your update loop.**
|
|
100
|
+
*
|
|
101
|
+
* This function updates every VRM components.
|
|
102
|
+
*
|
|
103
|
+
* @param delta deltaTime
|
|
104
|
+
*/
|
|
105
|
+
update(delta: number): void;
|
|
106
|
+
/**
|
|
107
|
+
* Dispose everything about the VRM instance.
|
|
108
|
+
*/
|
|
109
|
+
dispose(): void;
|
|
110
|
+
}
|
package/types/VRMImporter.d.ts
CHANGED
|
@@ -1,42 +1,42 @@
|
|
|
1
|
-
import { GLTF } from 'three/examples/jsm/loaders/GLTFLoader';
|
|
2
|
-
import { VRMBlendShapeImporter } from './blendshape';
|
|
3
|
-
import { VRMFirstPersonImporter } from './firstperson';
|
|
4
|
-
import { VRMHumanoidImporter } from './humanoid/VRMHumanoidImporter';
|
|
5
|
-
import { VRMLookAtImporter } from './lookat/VRMLookAtImporter';
|
|
6
|
-
import { VRMMaterialImporter } from './material';
|
|
7
|
-
import { VRMMetaImporter } from './meta/VRMMetaImporter';
|
|
8
|
-
import { VRMSpringBoneImporter } from './springbone/VRMSpringBoneImporter';
|
|
9
|
-
import { VRM } from './VRM';
|
|
10
|
-
export interface VRMImporterOptions {
|
|
11
|
-
metaImporter?: VRMMetaImporter;
|
|
12
|
-
lookAtImporter?: VRMLookAtImporter;
|
|
13
|
-
humanoidImporter?: VRMHumanoidImporter;
|
|
14
|
-
blendShapeImporter?: VRMBlendShapeImporter;
|
|
15
|
-
firstPersonImporter?: VRMFirstPersonImporter;
|
|
16
|
-
materialImporter?: VRMMaterialImporter;
|
|
17
|
-
springBoneImporter?: VRMSpringBoneImporter;
|
|
18
|
-
}
|
|
19
|
-
/**
|
|
20
|
-
* An importer that imports a [[VRM]] from a VRM extension of a GLTF.
|
|
21
|
-
*/
|
|
22
|
-
export declare class VRMImporter {
|
|
23
|
-
protected readonly _metaImporter: VRMMetaImporter;
|
|
24
|
-
protected readonly _blendShapeImporter: VRMBlendShapeImporter;
|
|
25
|
-
protected readonly _lookAtImporter: VRMLookAtImporter;
|
|
26
|
-
protected readonly _humanoidImporter: VRMHumanoidImporter;
|
|
27
|
-
protected readonly _firstPersonImporter: VRMFirstPersonImporter;
|
|
28
|
-
protected readonly _materialImporter: VRMMaterialImporter;
|
|
29
|
-
protected readonly _springBoneImporter: VRMSpringBoneImporter;
|
|
30
|
-
/**
|
|
31
|
-
* Create a new VRMImporter.
|
|
32
|
-
*
|
|
33
|
-
* @param options [[VRMImporterOptions]], optionally contains importers for each component
|
|
34
|
-
*/
|
|
35
|
-
constructor(options?: VRMImporterOptions);
|
|
36
|
-
/**
|
|
37
|
-
* Receive a GLTF object retrieved from `THREE.GLTFLoader` and create a new [[VRM]] instance.
|
|
38
|
-
*
|
|
39
|
-
* @param gltf A parsed result of GLTF taken from GLTFLoader
|
|
40
|
-
*/
|
|
41
|
-
import(gltf: GLTF): Promise<VRM>;
|
|
42
|
-
}
|
|
1
|
+
import { GLTF } from 'three/examples/jsm/loaders/GLTFLoader';
|
|
2
|
+
import { VRMBlendShapeImporter } from './blendshape';
|
|
3
|
+
import { VRMFirstPersonImporter } from './firstperson';
|
|
4
|
+
import { VRMHumanoidImporter } from './humanoid/VRMHumanoidImporter';
|
|
5
|
+
import { VRMLookAtImporter } from './lookat/VRMLookAtImporter';
|
|
6
|
+
import { VRMMaterialImporter } from './material';
|
|
7
|
+
import { VRMMetaImporter } from './meta/VRMMetaImporter';
|
|
8
|
+
import { VRMSpringBoneImporter } from './springbone/VRMSpringBoneImporter';
|
|
9
|
+
import { VRM } from './VRM';
|
|
10
|
+
export interface VRMImporterOptions {
|
|
11
|
+
metaImporter?: VRMMetaImporter;
|
|
12
|
+
lookAtImporter?: VRMLookAtImporter;
|
|
13
|
+
humanoidImporter?: VRMHumanoidImporter;
|
|
14
|
+
blendShapeImporter?: VRMBlendShapeImporter;
|
|
15
|
+
firstPersonImporter?: VRMFirstPersonImporter;
|
|
16
|
+
materialImporter?: VRMMaterialImporter;
|
|
17
|
+
springBoneImporter?: VRMSpringBoneImporter;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* An importer that imports a [[VRM]] from a VRM extension of a GLTF.
|
|
21
|
+
*/
|
|
22
|
+
export declare class VRMImporter {
|
|
23
|
+
protected readonly _metaImporter: VRMMetaImporter;
|
|
24
|
+
protected readonly _blendShapeImporter: VRMBlendShapeImporter;
|
|
25
|
+
protected readonly _lookAtImporter: VRMLookAtImporter;
|
|
26
|
+
protected readonly _humanoidImporter: VRMHumanoidImporter;
|
|
27
|
+
protected readonly _firstPersonImporter: VRMFirstPersonImporter;
|
|
28
|
+
protected readonly _materialImporter: VRMMaterialImporter;
|
|
29
|
+
protected readonly _springBoneImporter: VRMSpringBoneImporter;
|
|
30
|
+
/**
|
|
31
|
+
* Create a new VRMImporter.
|
|
32
|
+
*
|
|
33
|
+
* @param options [[VRMImporterOptions]], optionally contains importers for each component
|
|
34
|
+
*/
|
|
35
|
+
constructor(options?: VRMImporterOptions);
|
|
36
|
+
/**
|
|
37
|
+
* Receive a GLTF object retrieved from `THREE.GLTFLoader` and create a new [[VRM]] instance.
|
|
38
|
+
*
|
|
39
|
+
* @param gltf A parsed result of GLTF taken from GLTFLoader
|
|
40
|
+
*/
|
|
41
|
+
import(gltf: GLTF): Promise<VRM>;
|
|
42
|
+
}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import * as THREE from 'three';
|
|
2
|
-
import { VRM } from '../VRM';
|
|
3
|
-
/**
|
|
4
|
-
* Extract a thumbnail image blob from a {@link VRM}.
|
|
5
|
-
* If the vrm does not have a thumbnail, it will throw an error.
|
|
6
|
-
* @param renderer Renderer
|
|
7
|
-
* @param vrm VRM with a thumbnail
|
|
8
|
-
* @param size width / height of the image
|
|
9
|
-
*/
|
|
10
|
-
export declare function extractThumbnailBlob(renderer: THREE.WebGLRenderer, vrm: VRM, size?: number): Promise<Blob>;
|
|
1
|
+
import * as THREE from 'three';
|
|
2
|
+
import { VRM } from '../VRM';
|
|
3
|
+
/**
|
|
4
|
+
* Extract a thumbnail image blob from a {@link VRM}.
|
|
5
|
+
* If the vrm does not have a thumbnail, it will throw an error.
|
|
6
|
+
* @param renderer Renderer
|
|
7
|
+
* @param vrm VRM with a thumbnail
|
|
8
|
+
* @param size width / height of the image
|
|
9
|
+
*/
|
|
10
|
+
export declare function extractThumbnailBlob(renderer: THREE.WebGLRenderer, vrm: VRM, size?: number): Promise<Blob>;
|
|
@@ -1,7 +1,9 @@
|
|
|
1
|
-
import { extractThumbnailBlob } from './extractThumbnailBlob';
|
|
2
|
-
import { removeUnnecessaryJoints } from './removeUnnecessaryJoints';
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
static
|
|
7
|
-
|
|
1
|
+
import { extractThumbnailBlob } from './extractThumbnailBlob';
|
|
2
|
+
import { removeUnnecessaryJoints } from './removeUnnecessaryJoints';
|
|
3
|
+
import { removeUnnecessaryVertices } from './removeUnnecessaryVertices';
|
|
4
|
+
export declare class VRMUtils {
|
|
5
|
+
private constructor();
|
|
6
|
+
static extractThumbnailBlob: typeof extractThumbnailBlob;
|
|
7
|
+
static removeUnnecessaryJoints: typeof removeUnnecessaryJoints;
|
|
8
|
+
static removeUnnecessaryVertices: typeof removeUnnecessaryVertices;
|
|
9
|
+
}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import * as THREE from 'three';
|
|
2
|
-
/**
|
|
3
|
-
* Traverse given object and remove unnecessarily bound joints from every `THREE.SkinnedMesh`.
|
|
4
|
-
* Some environments like mobile devices have a lower limit of bones and might be unable to perform mesh skinning, this function might resolve such an issue.
|
|
5
|
-
* Also this function might greatly improve the performance of mesh skinning.
|
|
6
|
-
*
|
|
7
|
-
* @param root Root object that will be traversed
|
|
8
|
-
*/
|
|
9
|
-
export declare function removeUnnecessaryJoints(root: THREE.Object3D): void;
|
|
1
|
+
import * as THREE from 'three';
|
|
2
|
+
/**
|
|
3
|
+
* Traverse given object and remove unnecessarily bound joints from every `THREE.SkinnedMesh`.
|
|
4
|
+
* Some environments like mobile devices have a lower limit of bones and might be unable to perform mesh skinning, this function might resolve such an issue.
|
|
5
|
+
* Also this function might greatly improve the performance of mesh skinning.
|
|
6
|
+
*
|
|
7
|
+
* @param root Root object that will be traversed
|
|
8
|
+
*/
|
|
9
|
+
export declare function removeUnnecessaryJoints(root: THREE.Object3D): void;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import * as THREE from 'three';
|
|
2
|
+
/**
|
|
3
|
+
* Traverse given object and remove unnecessary vertices from every BufferGeometries.
|
|
4
|
+
* This only processes buffer geometries with index buffer.
|
|
5
|
+
*
|
|
6
|
+
* Three.js creates morph textures for each geometries and it sometimes consumes unnecessary amount of VRAM for certain models.
|
|
7
|
+
* This function will optimize geometries to reduce the size of morph texture.
|
|
8
|
+
* See: https://github.com/mrdoob/three.js/issues/23095
|
|
9
|
+
*
|
|
10
|
+
* @param root Root object that will be traversed
|
|
11
|
+
*/
|
|
12
|
+
export declare function removeUnnecessaryVertices(root: THREE.Object3D): void;
|
|
@@ -1,50 +1,50 @@
|
|
|
1
|
-
import * as THREE from 'three';
|
|
2
|
-
import { GLTFPrimitive } from '../types';
|
|
3
|
-
export interface VRMBlendShapeBind {
|
|
4
|
-
meshes: GLTFPrimitive[];
|
|
5
|
-
morphTargetIndex: number;
|
|
6
|
-
weight: number;
|
|
7
|
-
}
|
|
8
|
-
declare enum VRMBlendShapeMaterialValueType {
|
|
9
|
-
NUMBER = 0,
|
|
10
|
-
VECTOR2 = 1,
|
|
11
|
-
VECTOR3 = 2,
|
|
12
|
-
VECTOR4 = 3,
|
|
13
|
-
COLOR = 4
|
|
14
|
-
}
|
|
15
|
-
export interface VRMBlendShapeMaterialValue {
|
|
16
|
-
material: THREE.Material;
|
|
17
|
-
propertyName: string;
|
|
18
|
-
defaultValue: number | THREE.Vector2 | THREE.Vector3 | THREE.Vector4 | THREE.Color;
|
|
19
|
-
targetValue: number | THREE.Vector2 | THREE.Vector3 | THREE.Vector4 | THREE.Color;
|
|
20
|
-
deltaValue: number | THREE.Vector2 | THREE.Vector3 | THREE.Vector4 | THREE.Color;
|
|
21
|
-
type: VRMBlendShapeMaterialValueType;
|
|
22
|
-
}
|
|
23
|
-
export declare class VRMBlendShapeGroup extends THREE.Object3D {
|
|
24
|
-
weight: number;
|
|
25
|
-
isBinary: boolean;
|
|
26
|
-
private _binds;
|
|
27
|
-
private _materialValues;
|
|
28
|
-
constructor(expressionName: string);
|
|
29
|
-
addBind(args: {
|
|
30
|
-
meshes: GLTFPrimitive[];
|
|
31
|
-
morphTargetIndex: number;
|
|
32
|
-
weight: number;
|
|
33
|
-
}): void;
|
|
34
|
-
addMaterialValue(args: {
|
|
35
|
-
material: THREE.Material;
|
|
36
|
-
propertyName: string;
|
|
37
|
-
targetValue: number[];
|
|
38
|
-
defaultValue?: number | THREE.Vector2 | THREE.Vector3 | THREE.Vector4 | THREE.Color;
|
|
39
|
-
}): void;
|
|
40
|
-
/**
|
|
41
|
-
* Apply weight to every assigned blend shapes.
|
|
42
|
-
* Should be called via {@link BlendShapeMaster#update}.
|
|
43
|
-
*/
|
|
44
|
-
applyWeight(): void;
|
|
45
|
-
/**
|
|
46
|
-
* Clear previously assigned blend shapes.
|
|
47
|
-
*/
|
|
48
|
-
clearAppliedWeight(): void;
|
|
49
|
-
}
|
|
50
|
-
export {};
|
|
1
|
+
import * as THREE from 'three';
|
|
2
|
+
import { GLTFPrimitive } from '../types';
|
|
3
|
+
export interface VRMBlendShapeBind {
|
|
4
|
+
meshes: GLTFPrimitive[];
|
|
5
|
+
morphTargetIndex: number;
|
|
6
|
+
weight: number;
|
|
7
|
+
}
|
|
8
|
+
declare enum VRMBlendShapeMaterialValueType {
|
|
9
|
+
NUMBER = 0,
|
|
10
|
+
VECTOR2 = 1,
|
|
11
|
+
VECTOR3 = 2,
|
|
12
|
+
VECTOR4 = 3,
|
|
13
|
+
COLOR = 4
|
|
14
|
+
}
|
|
15
|
+
export interface VRMBlendShapeMaterialValue {
|
|
16
|
+
material: THREE.Material;
|
|
17
|
+
propertyName: string;
|
|
18
|
+
defaultValue: number | THREE.Vector2 | THREE.Vector3 | THREE.Vector4 | THREE.Color;
|
|
19
|
+
targetValue: number | THREE.Vector2 | THREE.Vector3 | THREE.Vector4 | THREE.Color;
|
|
20
|
+
deltaValue: number | THREE.Vector2 | THREE.Vector3 | THREE.Vector4 | THREE.Color;
|
|
21
|
+
type: VRMBlendShapeMaterialValueType;
|
|
22
|
+
}
|
|
23
|
+
export declare class VRMBlendShapeGroup extends THREE.Object3D {
|
|
24
|
+
weight: number;
|
|
25
|
+
isBinary: boolean;
|
|
26
|
+
private _binds;
|
|
27
|
+
private _materialValues;
|
|
28
|
+
constructor(expressionName: string);
|
|
29
|
+
addBind(args: {
|
|
30
|
+
meshes: GLTFPrimitive[];
|
|
31
|
+
morphTargetIndex: number;
|
|
32
|
+
weight: number;
|
|
33
|
+
}): void;
|
|
34
|
+
addMaterialValue(args: {
|
|
35
|
+
material: THREE.Material;
|
|
36
|
+
propertyName: string;
|
|
37
|
+
targetValue: number[];
|
|
38
|
+
defaultValue?: number | THREE.Vector2 | THREE.Vector3 | THREE.Vector4 | THREE.Color;
|
|
39
|
+
}): void;
|
|
40
|
+
/**
|
|
41
|
+
* Apply weight to every assigned blend shapes.
|
|
42
|
+
* Should be called via {@link BlendShapeMaster#update}.
|
|
43
|
+
*/
|
|
44
|
+
applyWeight(): void;
|
|
45
|
+
/**
|
|
46
|
+
* Clear previously assigned blend shapes.
|
|
47
|
+
*/
|
|
48
|
+
clearAppliedWeight(): void;
|
|
49
|
+
}
|
|
50
|
+
export {};
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { GLTF } from 'three/examples/jsm/loaders/GLTFLoader';
|
|
2
|
-
import { VRMBlendShapeProxy } from './VRMBlendShapeProxy';
|
|
3
|
-
/**
|
|
4
|
-
* An importer that imports a [[VRMBlendShape]] from a VRM extension of a GLTF.
|
|
5
|
-
*/
|
|
6
|
-
export declare class VRMBlendShapeImporter {
|
|
7
|
-
/**
|
|
8
|
-
* Import a [[VRMBlendShape]] from a VRM.
|
|
9
|
-
*
|
|
10
|
-
* @param gltf A parsed result of GLTF taken from GLTFLoader
|
|
11
|
-
*/
|
|
12
|
-
import(gltf: GLTF): Promise<VRMBlendShapeProxy | null>;
|
|
13
|
-
}
|
|
1
|
+
import { GLTF } from 'three/examples/jsm/loaders/GLTFLoader';
|
|
2
|
+
import { VRMBlendShapeProxy } from './VRMBlendShapeProxy';
|
|
3
|
+
/**
|
|
4
|
+
* An importer that imports a [[VRMBlendShape]] from a VRM extension of a GLTF.
|
|
5
|
+
*/
|
|
6
|
+
export declare class VRMBlendShapeImporter {
|
|
7
|
+
/**
|
|
8
|
+
* Import a [[VRMBlendShape]] from a VRM.
|
|
9
|
+
*
|
|
10
|
+
* @param gltf A parsed result of GLTF taken from GLTFLoader
|
|
11
|
+
*/
|
|
12
|
+
import(gltf: GLTF): Promise<VRMBlendShapeProxy | null>;
|
|
13
|
+
}
|