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

Fixed the mirroring bug that occurs when using a custom control naming pattern or when side names 'L' and 'R' are changed. #285

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

joji2468ng
Copy link
Member

@joji2468ng joji2468ng commented Sep 23, 2023

The fix involves swapping the side label in control names based on the rig’s naming convention. It adapts dynamically by using guide data’s naming patterns to identify and swap the current side label, e.g., from ‘L’ to ‘R’ and vice versa."

The function uses the guide data's naming patterns to identify the current side label,
(e.g., "L", "R", etc.) in the provided name, and swap it to the opposite side.

Reported:
http://forum.mgear-framework.com/t/control-mirroring-broken/3687

…g convention

It fixes the mirroring issue with custom naming conventions.

The function uses the guide data's naming patterns to identify the current side label
(e.g., "L", "R", etc.) in the provided name, and swaps it to the opposite side.

If the side is "center" or not recognized, the original name is returned.
@joji2468ng joji2468ng changed the title Fixed the mirroring bug that occurs when using a custom control naming pattern. Fixed the mirroring bug that occurs when using a custom control naming pattern or changing the side names of L and R. Sep 23, 2023
@joji2468ng joji2468ng changed the title Fixed the mirroring bug that occurs when using a custom control naming pattern or changing the side names of L and R. Fixed the mirroring bug that occurs when using a custom control naming pattern or when side names 'L' and 'R' are changed. Sep 23, 2023
@miquelcampos
Copy link
Member

@joji2468ng Thanks for all the hard work on this. I still need to check this one, but in general, I think accessing the embedded data of the guide is not a good idea in this case.
The main reasons are:

  • old rigs will not have the embedded data. And I may make this data optional in new rigs
  • Probably not the fastest way to find
  • Ideally should support not mGear rigs. But this is not a high priority

We have the information about custom side labels in each control.
image

I need to review the code I did because this issue also affects other tools like mirror pose. I would like to take some time here and work consistently across all the tools.

Feel free to keep researching this, but please understand that I will be very picky in this area. 🙇‍♂️ 🙏

@joji2468ng joji2468ng self-assigned this Nov 11, 2023
@joji2468ng joji2468ng added the enhancement New feature or request label Nov 11, 2023
@joji2468ng joji2468ng added this to To Do in mGear 4.x via automation Nov 11, 2023
@joji2468ng
Copy link
Member Author

Sorry for the late reply to this.

The main reasons are:

  • old rigs will not have the embedded data. And I may make this data optional in new rigs
  • Probably not the fastest way to find
  • Ideally should support not mGear rigs. But this is not a high priority

All I need in a rig node is to embed naming rules for both controllers and joints. Simply having the side label on a controller node isn't sufficient information to replace the side label if the name rule was changed by a user. It could be a must-have metadata to add for naming rules and extensions naming on the rig data if you consider making the guide data optional there.

I've already tested the other tool like mirroring pose using the viewport menu.
All function works with the new code.

When it comes to the guide data not existing on an old rig, we can add a conditional statement for rig version checking to avoid the non-existing attribute. If it doesn't exist, the name replacement process could work with what we have right now.

スクリーンショット 2023-11-19 103831

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Development

Successfully merging this pull request may close these issues.

None yet

2 participants