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 variable use in line 1969 of anim_utils.py #158

Open
miquelcampos opened this issue Oct 11, 2022 · 0 comments
Open

Missing variable use in line 1969 of anim_utils.py #158

miquelcampos opened this issue Oct 11, 2022 · 0 comments
Assignees
Labels
bug Something isn't working
Projects

Comments

@miquelcampos
Copy link
Member

miquelcampos commented Oct 11, 2022

reported in the forum
http://forum.mgear-framework.com/t/missing-variable-use-in-line-1969-of-anim-utils-py/3169

mGear version 4.0.2 (but checking the latest version still has this problem)
Maya 2022
Windows 10

Hi, I’ve developed a requested tool by my company’s animation department to multi-bake the RangeSwitching which lets them run a single tool to bake all the limbs from FK → IK, all vice versa, or some FK → IK and others IK → FK. As logic wise this is doing the same thing as the SpaceSwitching tool just multiple times, I used the logic of that tool to build this one. I ended up creating a UI that would plug variables into the methods of toIK or toFK within anim_utils.py, but I ran into the issue of it always baking to FK, even if I was running the toIK method.

What I found was that both toIK and toFK run another method called execute, and in line 1969 of anim_utils.py within the execute method there’s this code:
ui.transfer(startFrame, endFrame, onlyKeyframes, ikRot, switchTo="fk")

The problem is always setting it to “fk” without there being a variable will always bake as fk when running this logic part of the code separate to the SpaceSwitching tool. When I changed this line to instead use the variable ‘switchTo’ that it’s been using to hold either “fk” or “ik” respectively it’s been working as intended and baking to either ik or fk:
ui.transfer(startFrame, endFrame, onlyKeyframes, ikRot, switchTo=switchTo)

With this in mind, it looks to me like it would be best if in the next mGear update this line is changed to have the variable be used compared to always baking to fk.

Thanks,
Branden

@miquelcampos miquelcampos added the bug Something isn't working label Oct 11, 2022
@miquelcampos miquelcampos self-assigned this Oct 11, 2022
@miquelcampos miquelcampos added this to To do in mGear 4.0 via automation Oct 11, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
mGear 4.0
  
To do
Development

No branches or pull requests

1 participant