Skip to content

Commit 3e86b1d

Browse files
committed
update hair
1 parent 69d579c commit 3e86b1d

File tree

2 files changed

+20
-0
lines changed

2 files changed

+20
-0
lines changed

src/jsm/loaders/GLTFLoader.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,7 @@ import { Material } from "@/materials/Material.js"
122122
import { Texture } from "@/textures/Texture.js"
123123
import { MeshPhysicalMaterial } from "@/materials/MeshPhysicalMaterial.js"
124124
import { Vector2 } from "@/math/Vector2.js"
125+
import { Skeleton } from "@/objects/Skeleton.js"
125126

126127
class GLTFLoader extends Loader {
127128
constructor(manager) {

src/main.js

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -289,6 +289,7 @@ export class App {
289289
this.loadMaterial()
290290
this.loadModel()
291291
// this.loadGLTF()
292+
// this.loadHair()
292293
// this.loadJSON()
293294
// this.loadCustomModel()
294295
if (this.state.postProcessing) {
@@ -735,6 +736,14 @@ export class App {
735736

736737
async loadModel() {
737738
const group = new Group()
739+
const loader = new GLTFLoader(loadingManager)
740+
loader.load("/hair/hair.glb", (gltf) => {
741+
window.OPENHUMAN.gltf = gltf
742+
let scene = gltf.scene || gltf.scenes[0]
743+
group.add(scene)
744+
// this.loadContent(scene, clips)
745+
})
746+
738747
this.scene.add(group)
739748
// const textureLoader = new TextureLoader(loadingManager)
740749

@@ -878,6 +887,16 @@ export class App {
878887
})
879888
}
880889

890+
async loadHair() {
891+
const loader = new GLTFLoader(loadingManager)
892+
loader.load("/hair/hair.glb", (gltf) => {
893+
window.OPENHUMAN.gltf = gltf
894+
let scene = gltf.scene || gltf.scenes[0]
895+
let clips = gltf.animations || []
896+
this.loadContent(scene, clips)
897+
})
898+
}
899+
881900
async loadGLTF() {
882901
const loader = new GLTFLoader(loadingManager)
883902
loader.load("/facetoy/facetoy.glb", (gltf) => {

0 commit comments

Comments
 (0)