Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bone groups and layers importing albam.engines.mtframework.Mod156 #26

Closed
Brachi opened this issue May 20, 2017 · 0 comments
Closed

Bone groups and layers importing albam.engines.mtframework.Mod156 #26

Brachi opened this issue May 20, 2017 · 0 comments
Assignees
Milestone

Comments

@Brachi
Copy link
Owner

Brachi commented May 20, 2017

Mod156 has a field called unk_13 that is a fixed array of 256 bytes. It turns out it's actually a mapping used for animations. Apparently, every index represents a hard-coded bone type.
For example, based on uPl00ChrisNormal.arc->pl0000.mod and uPl01ShebaNormal.arc->pl0100.mod, indices 16 and 20 represent the upper left and right leg respectively. This can be confirmed parsing both mod files and taking the bone indices visually when they were imported:

>>> from albam.engines.mtframework import Mod156
>>> mod = Mod156('pl0000.mod')
>>> mod2 = Mod156('pl0100.mod')
>>> chris_right_leg = 112  # taken from blender
>>> chris_left_leg = 117
>>> sheva_right_leg = 2
>>> sheva_left_leg = 8
>>> assert list(mod.unk_13).index(chris_right_leg) == list(mod2.unk_13).index(sheva_right_leg)
>>> assert list(mod.unk_13).index(chris_left_leg) == list(mod2.unk_13).index(sheva_left_leg)

Knowing this, it would be useful for modding to classify them all and create bone groups and layers.
For example, the first layer should include the most important bone: spine, legs, arms, head bone, etc.
This way, automatic weighting can also be done in layers, refining or omitting more detailed bones.

@Brachi Brachi added this to the 0.3.0 milestone May 20, 2017
@Brachi Brachi assigned Brachi and unassigned Brachi May 20, 2017
@Brachi Brachi self-assigned this May 28, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant