MMD.js icon indicating copy to clipboard operation
MMD.js copied to clipboard

Support pmx file?

Open Comamoca opened this issue 3 years ago • 0 comments

Hello. I am trying to use this library, with the pmx model. bat, I specify MMD.Model() to pmx file, get the error.

Reproduction problem

The MMD model is to arrange on the MMD.js/model directory. Use model URL And pmx file in the Koyori_220603_1/Koyori/PMX/ directory.

directory tree().

.
└─── model
    ├── Dammy_Bone.pmd
    ├── Haku_Yowane.pmd
    ├── KAITO.pmd
    ├── Koyori_220603_1
    │   └── Koyori
    │       ├── PMX
    │       │   ├── Koyori_HakuiOFF.pmx
    │       │   └── Koyori_HakuiON.pmx    <--- copy to...
    │       └── texture
    │           ├── KYR_Bottle_tex.tga
    │           ├── KYR_Cloth_Shoes_HakuiOFF_tex.tga
    │           ├── KYR_Cloth_Shoes_re_tex.tga
    │           ├── KYR_Cloth_Shoes_tex.tga
    │           ├── KYR_Eye_tex.tga
    │           ├── KYR_Face_tex.tga
    │           ├── KYR_Glasses_tex.tga
    │           ├── KYR_Hair_shadow_tex.tga
    │           ├── KYR_Hair_tex.tga
    │           ├── KYR_Hakui_re_tex.tga
    │           ├── KYR_Hakui_tex.tga
    │           ├── KYR_Hyoujo_tex.tga
    │           ├── KYR_Metal_tex.tga
    │           ├── KYR_Robo_tex.tga
    │           ├── KYR_Skin.tga
    │           ├── KYR_Skin_HakuiOFF_tex.tga
    │           ├── KYR_Tail_tex.tga
    │           ├── S_1.bmp
    │           ├── S_hair.bmp
    │           └── S_metal.png
    └─── Koyori_HakuiON.pmx    <--- Here!!

MMD.js/main.js change to this Code.

MMD.js/main.js line 16
var koyori = new MMD.Model("model", "Koyori_HakuiON.pmx")

MMD.js/main.js line 24
mmd.addModel(koyori);

Serve Python http.server

# run on the project root
python -m http.server
# access to http://0.0.0.0:8000/
parse: 20ms - タイマー終了 [MMD.js:958:17](http://0.0.0.0:8000/MMD.js)
Uncaught TypeError: model.vertices is null
    initVertices http://0.0.0.0:8000/MMD.js:88
    initBuffers http://0.0.0.0:8000/MMD.js:80
    onload http://0.0.0.0:8000/main.js:26
    onload http://0.0.0.0:8000/MMD.js:959
    load http://0.0.0.0:8000/MMD.js:955
    onload http://0.0.0.0:8000/main.js:23
    EventHandlerNonNull* http://0.0.0.0:8000/main.js:1
[MMD.js:88:7](http://0.0.0.0:8000/MMD.js)
    initVertices http://0.0.0.0:8000/MMD.js:88
    initBuffers http://0.0.0.0:8000/MMD.js:80
    onload http://0.0.0.0:8000/main.js:26
    onload http://0.0.0.0:8000/MMD.js:959
    (非同期: EventHandlerNonNull)
    load http://0.0.0.0:8000/MMD.js:955
    onload http://0.0.0.0:8000/main.js:23
    (非同期: EventHandlerNonNull)
    <匿名> http://0.0.0.0:8000/main.js:1

how to use the pmx file on MMD.js or do you plan to support the pmx file? thank you.

Comamoca avatar Oct 12 '22 16:10 Comamoca