mayaMatchMoveSolver
mayaMatchMoveSolver copied to clipboard
Issue 234: Check Rotation Order for selected objects
Just creating this to start conversation for https://github.com/david-cattermole/mayaMatchMoveSolver/issues/234
I just took Morgan Loomis' loadTips() method and modified it in its own file to make it work for multiple objects and just prints out a simple text in the Script Editor of the results (not the most elegant looking result).
Example output:
pCube1 | xyz -- Current rotate order -- | yzx (0%) Gimballed. | zxy (0%) Gimballed.<-- [RECOMMENDED] | xzy (0%) Gimballed.<-- [RECOMMENDED] | yxz (0%) Gimballed. | zyx (0%) Gimballed.
^^ This object is not currently gimballing, and it looks like it's a worldspace control.
pCube2 | xyz -- Current rotate order -- | yzx (0%) Gimballed. | zxy (0%) Gimballed.<-- [RECOMMENDED] | xzy (0%) Gimballed.<-- [RECOMMENDED] | yxz (0%) Gimballed. | zyx (0%) Gimballed.
^^ This object is not currently gimballing, and it looks like it's a worldspace control.
I don't really understand this bit:
Something that might be tricky about this tool is that the original "ml Convert Rotation Order" tool only checks the current frame, however I think the tool would ideally check the 'gimballed' percentage for each keyframe on each object.
Should we be taking the entire length of a given scene's frame range and getting an average of that for the gimbal percentage...?
Hey @ktonegawa,
Thanks for this! It looks like a good start - first new code of 2022 :)
Should we be taking the entire length of a given scene's frame range and getting an average of that for the gimbal percentage...?
Yes, the tool will need to loop over all frames. I mentioned "keyframes" because we could reduce the frames checked to only the frames that have keyframes.
Please note that I don't think the ml tools have the ability to query gimbal values at different frames therefore I'm expecting you'll need to use maya.cmds.setCurrentTime() before calling the functions. To speed up the viewport while this time change happens, use the mmSolver.utils.tools.tool_context() decorator.
https://github.com/david-cattermole/mayaMatchMoveSolver/blob/30312d2a3c7ae18158d27ac3ac7e50273230f944/python/mmSolver/utils/tools.py#L34
I think the maximum gimbal percentage is a better metric rather than the average, because a transform might be fine on 99 frames but gimbal flip on the last frame and the average wouldn't capture this issue.