OpenMLTD / MLTDTools

Tools for THE iDOLM@STER Million Live! Theater Days (MLTD/MiriShita/ミリシタ) / 偶像大师百万演唱会剧场时光工具箱
BSD 3-Clause Clear License
136 stars 16 forks source link

broken vertices when converted to generic mmd #47

Open akaneP opened 3 years ago

akaneP commented 3 years ago

when converted to mmd, there are a bunch of (hidden) bones that affect the vertices of the leg. even when deleting these bones, they still seem to be pulled towards something. it isn't noticeable in mmd on its own, but is present in transform views motion player and mikumikumoving video is of a base model after conversion in transform view (also, broken shadows?) https://streamable.com/dxwooz

Sozuke commented 3 years ago

in generic mmd the bones have cryptic names like bone1fa2003 this apparently is a bug in the program (if you export your model without translating the bones you will see that this weird bone becomes something like INT_KUBI_ROTx50)

those bones have utility in unity but not in mmd except for the elbows and knees.

removing them does not solve the problem, it generates others with the weight of the vertices.

akaneP commented 3 years ago

in generic mmd the bones have cryptic names like bone1fa2003 this apparently is a bug in the program (if you export your model without translating the bones you will see that this weird bone becomes something like INT_KUBI_ROTx50)

those bones have utility in unity but not in mmd except for the elbows and knees.

removing them does not solve the problem, it generates others with the weight of the vertices.

oh, so they're leftovers from the usual naming convention of imas models? you said removing them doesn't solve the problem, but does that apply to just the translated bones? at least in the case of the console models, i swear removing them worked fine.

Sozuke commented 3 years ago

if you compare the structure of the untranslated bones you will notice that some of them have a z x y at the end of the name next to a number for example int_ashi_momo_z50 or int_kubi_x0

the first one means that this bone rotates the same as ashi (the knee) and is related to momo (the leg) the z is the axis of rotation and the 50 means the intensity (in percentage, translated to mmd would be like .5)

the second one means that the bone will not rotate at all but its parent is kubi, usually the ones with 0 at the end have nothing rigged so those are ok to eliminate, unfortunately you have to do the ik by hand because when loading them by code or from another model mmd assumes that only those are in the chain and ignores the other bones (that's why it looks like the leg is broken)

hozuki commented 3 years ago

Actually... the weired naming is not a bug. It's designed to limit the bone names to 15 bytes (in Shift-JIS encoding). The limit does not present in PMX (it uses null-terminated strings); it is due to VMD (it uses fixed-length strings). I should add an option to not truncating these names if you only want the PMX model. But beware, PMXs without bone name truncation will not work with VMDs.