@pixiv/three-vrm 0.6.10 → 1.0.0-beta.10

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 (128) hide show
  1. package/README.md +30 -18
  2. package/lib/three-vrm.js +4993 -2572
  3. package/lib/three-vrm.min.js +138 -2
  4. package/lib/three-vrm.module.js +4949 -2546
  5. package/lib/three-vrm.module.min.js +136 -1
  6. package/package.json +19 -13
  7. package/ts3.4/types/VRM.d.ts +11 -82
  8. package/ts3.4/types/VRMLoaderPlugin.d.ts +31 -0
  9. package/ts3.4/types/VRMLoaderPluginOptions.d.ts +25 -0
  10. package/ts3.4/types/VRMParameters.d.ts +11 -0
  11. package/ts3.4/types/{utils/disposer.d.ts → VRMUtils/deepDispose.d.ts} +0 -0
  12. package/ts3.4/types/VRMUtils/index.d.ts +4 -2
  13. package/ts3.4/types/VRMUtils/rotateVRM0.d.ts +2 -0
  14. package/ts3.4/types/index.d.ts +8 -11
  15. package/types/VRM.d.ts +11 -82
  16. package/types/VRMLoaderPlugin.d.ts +31 -0
  17. package/types/VRMLoaderPluginOptions.d.ts +25 -0
  18. package/types/VRMParameters.d.ts +11 -0
  19. package/types/{utils/disposer.d.ts → VRMUtils/deepDispose.d.ts} +0 -0
  20. package/types/VRMUtils/index.d.ts +4 -2
  21. package/types/VRMUtils/rotateVRM0.d.ts +2 -0
  22. package/types/index.d.ts +8 -11
  23. package/ts3.4/types/VRMImporter.d.ts +0 -42
  24. package/ts3.4/types/VRMUtils/extractThumbnailBlob.d.ts +0 -10
  25. package/ts3.4/types/blendshape/VRMBlendShapeGroup.d.ts +0 -50
  26. package/ts3.4/types/blendshape/VRMBlendShapeImporter.d.ts +0 -13
  27. package/ts3.4/types/blendshape/VRMBlendShapeProxy.d.ts +0 -91
  28. package/ts3.4/types/blendshape/index.d.ts +0 -3
  29. package/ts3.4/types/debug/VRMDebug.d.ts +0 -28
  30. package/ts3.4/types/debug/VRMDebugOptions.d.ts +0 -10
  31. package/ts3.4/types/debug/VRMImporterDebug.d.ts +0 -11
  32. package/ts3.4/types/debug/VRMLookAtHeadDebug.d.ts +0 -8
  33. package/ts3.4/types/debug/VRMLookAtImporterDebug.d.ts +0 -9
  34. package/ts3.4/types/debug/VRMSpringBoneDebug.d.ts +0 -14
  35. package/ts3.4/types/debug/VRMSpringBoneImporterDebug.d.ts +0 -10
  36. package/ts3.4/types/debug/VRMSpringBoneManagerDebug.d.ts +0 -11
  37. package/ts3.4/types/debug/index.d.ts +0 -4
  38. package/ts3.4/types/firstperson/VRMFirstPerson.d.ts +0 -116
  39. package/ts3.4/types/firstperson/VRMFirstPersonImporter.d.ts +0 -15
  40. package/ts3.4/types/firstperson/index.d.ts +0 -2
  41. package/ts3.4/types/humanoid/VRMHumanBone.d.ts +0 -22
  42. package/ts3.4/types/humanoid/VRMHumanBoneArray.d.ts +0 -9
  43. package/ts3.4/types/humanoid/VRMHumanBones.d.ts +0 -8
  44. package/ts3.4/types/humanoid/VRMHumanDescription.d.ts +0 -14
  45. package/ts3.4/types/humanoid/VRMHumanLimit.d.ts +0 -12
  46. package/ts3.4/types/humanoid/VRMHumanoid.d.ts +0 -87
  47. package/ts3.4/types/humanoid/VRMHumanoidImporter.d.ts +0 -13
  48. package/ts3.4/types/humanoid/index.d.ts +0 -6
  49. package/ts3.4/types/lookat/VRMCurveMapper.d.ts +0 -36
  50. package/ts3.4/types/lookat/VRMLookAtApplyer.d.ts +0 -18
  51. package/ts3.4/types/lookat/VRMLookAtBlendShapeApplyer.d.ts +0 -26
  52. package/ts3.4/types/lookat/VRMLookAtBoneApplyer.d.ts +0 -28
  53. package/ts3.4/types/lookat/VRMLookAtHead.d.ts +0 -57
  54. package/ts3.4/types/lookat/VRMLookAtImporter.d.ts +0 -23
  55. package/ts3.4/types/lookat/index.d.ts +0 -6
  56. package/ts3.4/types/material/MToonMaterial.d.ts +0 -194
  57. package/ts3.4/types/material/VRMMaterialImporter.d.ts +0 -50
  58. package/ts3.4/types/material/VRMUnlitMaterial.d.ts +0 -44
  59. package/ts3.4/types/material/getTexelDecodingFunction.d.ts +0 -16
  60. package/ts3.4/types/material/index.d.ts +0 -3
  61. package/ts3.4/types/meta/VRMMeta.d.ts +0 -59
  62. package/ts3.4/types/meta/VRMMetaImporter.d.ts +0 -14
  63. package/ts3.4/types/meta/VRMMetaImporterOptions.d.ts +0 -9
  64. package/ts3.4/types/meta/index.d.ts +0 -3
  65. package/ts3.4/types/springbone/VRMSpringBone.d.ts +0 -129
  66. package/ts3.4/types/springbone/VRMSpringBoneColliderGroup.d.ts +0 -15
  67. package/ts3.4/types/springbone/VRMSpringBoneImporter.d.ts +0 -34
  68. package/ts3.4/types/springbone/VRMSpringBoneManager.d.ts +0 -35
  69. package/ts3.4/types/springbone/VRMSpringBoneParameters.d.ts +0 -9
  70. package/ts3.4/types/springbone/index.d.ts +0 -5
  71. package/ts3.4/types/types/GLTFSchema.d.ts +0 -887
  72. package/ts3.4/types/types/VRMSchema.d.ts +0 -440
  73. package/ts3.4/types/types/index.d.ts +0 -3
  74. package/ts3.4/types/types/types.d.ts +0 -73
  75. package/ts3.4/types/utils/gltfExtractPrimitivesFromNode.d.ts +0 -22
  76. package/types/VRMImporter.d.ts +0 -42
  77. package/types/VRMUtils/extractThumbnailBlob.d.ts +0 -10
  78. package/types/blendshape/VRMBlendShapeGroup.d.ts +0 -50
  79. package/types/blendshape/VRMBlendShapeImporter.d.ts +0 -13
  80. package/types/blendshape/VRMBlendShapeProxy.d.ts +0 -91
  81. package/types/blendshape/index.d.ts +0 -3
  82. package/types/debug/VRMDebug.d.ts +0 -28
  83. package/types/debug/VRMDebugOptions.d.ts +0 -10
  84. package/types/debug/VRMImporterDebug.d.ts +0 -11
  85. package/types/debug/VRMLookAtHeadDebug.d.ts +0 -8
  86. package/types/debug/VRMLookAtImporterDebug.d.ts +0 -9
  87. package/types/debug/VRMSpringBoneDebug.d.ts +0 -14
  88. package/types/debug/VRMSpringBoneImporterDebug.d.ts +0 -10
  89. package/types/debug/VRMSpringBoneManagerDebug.d.ts +0 -11
  90. package/types/debug/index.d.ts +0 -4
  91. package/types/firstperson/VRMFirstPerson.d.ts +0 -116
  92. package/types/firstperson/VRMFirstPersonImporter.d.ts +0 -15
  93. package/types/firstperson/index.d.ts +0 -2
  94. package/types/humanoid/VRMHumanBone.d.ts +0 -22
  95. package/types/humanoid/VRMHumanBoneArray.d.ts +0 -9
  96. package/types/humanoid/VRMHumanBones.d.ts +0 -8
  97. package/types/humanoid/VRMHumanDescription.d.ts +0 -14
  98. package/types/humanoid/VRMHumanLimit.d.ts +0 -12
  99. package/types/humanoid/VRMHumanoid.d.ts +0 -87
  100. package/types/humanoid/VRMHumanoidImporter.d.ts +0 -13
  101. package/types/humanoid/index.d.ts +0 -6
  102. package/types/lookat/VRMCurveMapper.d.ts +0 -36
  103. package/types/lookat/VRMLookAtApplyer.d.ts +0 -18
  104. package/types/lookat/VRMLookAtBlendShapeApplyer.d.ts +0 -26
  105. package/types/lookat/VRMLookAtBoneApplyer.d.ts +0 -28
  106. package/types/lookat/VRMLookAtHead.d.ts +0 -57
  107. package/types/lookat/VRMLookAtImporter.d.ts +0 -23
  108. package/types/lookat/index.d.ts +0 -6
  109. package/types/material/MToonMaterial.d.ts +0 -206
  110. package/types/material/VRMMaterialImporter.d.ts +0 -50
  111. package/types/material/VRMUnlitMaterial.d.ts +0 -46
  112. package/types/material/getTexelDecodingFunction.d.ts +0 -13
  113. package/types/material/index.d.ts +0 -3
  114. package/types/meta/VRMMeta.d.ts +0 -59
  115. package/types/meta/VRMMetaImporter.d.ts +0 -14
  116. package/types/meta/VRMMetaImporterOptions.d.ts +0 -9
  117. package/types/meta/index.d.ts +0 -3
  118. package/types/springbone/VRMSpringBone.d.ts +0 -130
  119. package/types/springbone/VRMSpringBoneColliderGroup.d.ts +0 -15
  120. package/types/springbone/VRMSpringBoneImporter.d.ts +0 -34
  121. package/types/springbone/VRMSpringBoneManager.d.ts +0 -35
  122. package/types/springbone/VRMSpringBoneParameters.d.ts +0 -9
  123. package/types/springbone/index.d.ts +0 -5
  124. package/types/types/GLTFSchema.d.ts +0 -887
  125. package/types/types/VRMSchema.d.ts +0 -440
  126. package/types/types/index.d.ts +0 -3
  127. package/types/types/types.d.ts +0 -64
  128. package/types/utils/gltfExtractPrimitivesFromNode.d.ts +0 -22
package/README.md CHANGED
@@ -10,7 +10,7 @@ Use [VRM](https://vrm.dev/) on [three.js](https://threejs.org/)
10
10
 
11
11
  [Documentation](https://pixiv.github.io/three-vrm/packages/three-vrm/docs)
12
12
 
13
- ## Usage
13
+ ## How to Use
14
14
 
15
15
  ### from HTML
16
16
 
@@ -33,6 +33,14 @@ Code like this:
33
33
  const scene = new THREE.Scene();
34
34
 
35
35
  const loader = new THREE.GLTFLoader();
36
+
37
+ // Install GLTFLoader plugin
38
+ loader.register( ( parser ) => {
39
+
40
+ return new THREE_VRM.VRMLoaderPlugin( parser );
41
+
42
+ } );
43
+
36
44
  loader.load(
37
45
 
38
46
  // URL of the VRM you want to load
@@ -41,16 +49,14 @@ loader.load(
41
49
  // called when the resource is loaded
42
50
  ( gltf ) => {
43
51
 
44
- // generate a VRM instance from gltf
45
- THREE.VRM.from( gltf ).then( ( vrm ) => {
46
-
47
- // add the loaded vrm to the scene
48
- scene.add( vrm.scene );
52
+ // retrieve a VRM instance from gltf
53
+ const vrm = gltf.userData.vrm;
49
54
 
50
- // deal with vrm features
51
- console.log( vrm );
55
+ // add the loaded vrm to the scene
56
+ scene.add( vrm.scene );
52
57
 
53
- } );
58
+ // deal with vrm features
59
+ console.log( vrm );
54
60
 
55
61
  },
56
62
 
@@ -77,11 +83,19 @@ Code like this:
77
83
  ```javascript
78
84
  import * as THREE from 'three';
79
85
  import { GLTFLoader } from 'three/examples/jsm/loaders/GLTFLoader';
80
- import { VRM } from '@pixiv/three-vrm';
86
+ import { VRMLoaderPlugin } from '@pixiv/three-vrm';
81
87
 
82
88
  const scene = new THREE.Scene();
83
89
 
84
90
  const loader = new GLTFLoader();
91
+
92
+ // Install GLTFLoader plugin
93
+ loader.register( ( parser ) => {
94
+
95
+ return new VRMLoaderPlugin( parser );
96
+
97
+ } );
98
+
85
99
  loader.load(
86
100
 
87
101
  // URL of the VRM you want to load
@@ -90,16 +104,14 @@ loader.load(
90
104
  // called when the resource is loaded
91
105
  ( gltf ) => {
92
106
 
93
- // generate a VRM instance from gltf
94
- VRM.from( gltf ).then( ( vrm ) => {
95
-
96
- // add the loaded vrm to the scene
97
- scene.add( vrm.scene );
107
+ // retrieve a VRM instance from gltf
108
+ const vrm = gltf.userData.vrm;
98
109
 
99
- // deal with vrm features
100
- console.log( vrm );
110
+ // add the loaded vrm to the scene
111
+ scene.add( vrm.scene );
101
112
 
102
- } );
113
+ // deal with vrm features
114
+ console.log( vrm );
103
115
 
104
116
  },
105
117