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

Issue 234: Check Rotation Order for selected objects #235

Open
wants to merge 3 commits into
base: develop_v0.3.x
Choose a base branch
from

Conversation

ktonegawa
Copy link
Contributor

@ktonegawa ktonegawa commented Jan 4, 2022

Just creating this to start conversation for #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...?

@ktonegawa ktonegawa changed the base branch from master to develop_v0.3.x January 4, 2022 03:37
@david-cattermole
Copy link
Owner

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.

def tool_context(use_undo_chunk=None,

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.

@david-cattermole david-cattermole added the maya tool A user tool inside Maya. label Jan 5, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
maya tool A user tool inside Maya.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants