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

Missing IK bones on action export? #6

Closed
kevzettler opened this issue Oct 5, 2019 · 4 comments
Closed

Missing IK bones on action export? #6

kevzettler opened this issue Oct 5, 2019 · 4 comments

Comments

@kevzettler
Copy link
Contributor

Hi @chinedufn this is another continuation of chinedufn/blender-actions-to-json#6 the landon action export data seems to be missing some IK bones that blender-actions-to-json is exporting correctly.

blender-actions-to-json

"jointNameIndices": {
    "Root": 0,
    "Knee.L": 1,
    "Elbow.L": 2,
    "Foot.L": 3,
    "Knee.R": 4,
    "Elbow.R": 5,
    "Foot.R": 6,
    "Waist": 7,
    "Chest": 8,
    "Head": 9,
    "Shoulder.L": 10,
    "Bicep.L": 11,
    "Arm.L": 12,
    "Hand.L": 13,
    "Shoulder.R": 14,
    "Bicep.R": 15,
    "Arm.R": 16,
    "Hand.R": 17,
    "Thigh.L": 18,
    "Shin.L": 19,
    "Thigh.R": 20,
    "Shin.R": 21
  }

landon

  "joint_index": {
    "Root": 0,
    "Knee.L": 1,
    "Foot.L": 2,
    "Knee.R": 3,
    "Foot.R": 4,
    "Waist": 5,
    "Chest": 6,
    "Head": 7,
    "Shoulder.L": 8,
    "Bicep.L": 9,
    "Arm.L": 10,
    "Hand.L": 11,
    "Shoulder.R": 12,
    "Bicep.R": 13,
    "Arm.R": 14,
    "Hand.R": 15,
    "Thigh.L": 16,
    "Shin.L": 17,
    "Thigh.R": 18,
    "Shin.R": 19
  }

The missing joints are

"Elbow.L": 2,
"Elbow.R": 5,

These are floating IK bones. They are similar to the Knee.R and Knee.L bones which are exported correctly so I'm not immediately sure what the issue is.
Screenshot 2019-10-05 14 03 29

What are your thoughts on troubleshooting? I can send you the blendfile to look at.

@chinedufn
Copy link
Owner

Right now landon automatically runs blender-iks-to-fks - so that's likely part of the story here

Any bones that have Deform unchecked don't get exported.

It's currently only done that way since I've never needed the IK bones, only the FK bones

image

Is this an issue for you?

@kevzettler
Copy link
Contributor Author

ok adding deform to the bones fixed it.

I might not even need the IK bones. Unsure at the moment will have to experiment....

I now have the game running with the Landon action export JSON and a translation layer

I have a script that does this

RUST_BACKTRACE=1 landon blender export -f ./assets/WiP-punch.blend > landon_export &&
cat landon_export | sed -n '/START_ARMATURE_JSON/,/END_ARMATURE_JSON/{/START_ARMATURE_JSON/!{/END_ARMATURE_JSON/!p;};}' &&
    rm landon_export;

@chinedufn
Copy link
Owner

I might not even need the IK bones

Yeah it's really unlikely that you do since skeletal-animation-system doesn't have any IK code to enforce constraints AND blender-iks-to-fks is effectively baking the effect of your IK constraints onto your FK bones.

So you can probably safely uncheck deform on them and stop exporting them.


Sweet script! Already since you have something working I won't bother tweaking the CLI to be able to just print out JSON - but should be easy to add in the future since we already parse all of this stuff

https://github.com/chinedufn/landon/blob/master/blender-mesh/src/export.rs#L9-L16


Awesome - closing this issue!

@chinedufn
Copy link
Owner

I now have the game running with the Landon action export JSON and a translation layer

@kevzettler landon export now writes JSON to stdout

cargo install -f landon
landon export -f my-file.blend -f my-other-file.blend > out.json

More in the guide: https://chinedufn.github.io/landon/landon-cli/export/index.html

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants