noname0310/babylon-mmd

The project won't work

Closed this issue · 16 comments

I cloned this project, but after executing the readme, the project reported an error and did not work properly.
The same goes for npm packages

Please tell me the details of the error with the code

When I run, I get the following error
image

pmx and vmd files are required. Due to licensing issues, the assets are not included in the source.

You must load vmd with VmdLoader.

Aren't you using BvmdLoader?

I used the vmdloader to load the vmd, but did not use the bvmdloader

So is bvmd necessary?

bvmd is optional. And I think it's a CORS problem. Please host the static files locally and give them a try.

No, I had the same problem with it locally, you can download it and test it

There is not enough information to know the cause

I fixed it now, so you can use the 0.5.0 version.

How to make pmx file execute vmd animation, I tested seems not to work

If you could show me the code, I might be able to identify the problem.

const pmxLoader = new PmxLoader();
SceneLoader.RegisterPlugin(pmxLoader);
const model = await SceneLoader.ImportMeshAsync(
'',
'/models/pmx/[MODELS] Lovesick girls ver.1/[LSG] Jennie (Miku) ver.1.pmx',
'',
).then((result) => result.meshes[0]);
console.log('model', model);
const vmdLoader = new VmdLoader(scene);
const modelMotion = await vmdLoader.loadAsync("", "https://a-cdn.qbox.net/test/models/vmd/wavefile_v2.vmd");
const mmdRuntime = new MmdRuntime();
const mmdModel = mmdRuntime.createMmdModel(model);
mmdModel.addAnimation(modelMotion);
mmdModel.setAnimation("model_motion_1");
mmdRuntime.register(scene);

const pmxLoader = new PmxLoader();
SceneLoader.RegisterPlugin(pmxLoader);
const model = await SceneLoader.ImportMeshAsync(
  '',
  '/models/pmx/[MODELS] Lovesick girls ver.1/[LSG] Jennie (Miku) ver.1.pmx',
  '',
).then((result) => result.meshes[0]);
console.log('model', model);
const vmdLoader = new VmdLoader(scene);
const modelMotion = await vmdLoader.loadAsync("model_motion_1", "https://a-cdn.qbox.net/test/models/vmd/wavefile_v2.vmd");
const mmdRuntime = new MmdRuntime();
const mmdModel = mmdRuntime.createMmdModel(model);
mmdModel.addAnimation(modelMotion);
mmdModel.setAnimation("model_motion_1");
mmdRuntime.register(scene);
mmdRuntime.playAnimation();

It should be work