-
Notifications
You must be signed in to change notification settings - Fork 523
Implemented feedback feature for avatar bones. #860
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
base: main
Are you sure you want to change the base?
Implemented feedback feature for avatar bones. #860
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
Adds a visual feedback panel in the GLTF importer’s Animation tab that shows which humanoid bones are assigned, grouped by body part, and uses custom dot icons to indicate required vs. optional bones.
- Introduces static icon textures and tab/group mappings for bones
- Implements
PopulateBoneInfo()to cache model transforms and avatar assignments - Extends
AnimationInspectorGUI()to render a tabbed list of bones with assignment status
Comments suppressed due to low confidence (2)
Editor/Scripts/GLTFImporterInspector.cs:135
- The new
PopulateBoneInfologic and its effect on UI are not covered by automated tests. Consider adding unit or integration tests to verify that transforms and assigned names are populated correctly.
void PopulateBoneInfo()
Editor/Scripts/GLTFImporterInspector.cs:310
- [nitpick] Local variable
MecanimBoneNamestarts with an uppercase letter, which conflicts with C# naming conventions for locals. Consider renaming tomecanimBoneNameor simplyboneName.
for (var i = 0; i < allMecanimBonesCount; i++)
| void PopulateBoneInfo() | ||
| { | ||
| var modelAsset = AssetDatabase.LoadAssetAtPath<GameObject>(importer.assetPath); | ||
| boneTransforms.Clear(); |
Copilot
AI
Jun 8, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You clear boneTransforms but don't clear assignedBoneNames before repopulating, which can lead to stale entries if OnEnable is called multiple times. Add assignedBoneNames.Clear(); alongside clearing boneTransforms.
| boneTransforms.Clear(); | |
| boneTransforms.Clear(); | |
| assignedBoneNames.Clear(); |
| for (var i = 0; i < allMecanimBonesCount; i++) | ||
| { | ||
| var MecanimBoneName = HumanTrait.BoneName[i]; | ||
| if (boneGroupTabs[selectedBoneGroupTab] != boneGroups[MecanimBoneName]) continue; |
Copilot
AI
Jun 8, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Accessing boneGroups[MecanimBoneName] can throw if a bone name isn’t in the dictionary. Use boneGroups.TryGetValue or check ContainsKey before indexing to avoid runtime exceptions.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi GPT. I didn't expect to see you here. I was surprised :)
There are only 4 bone groups defined in the code and this line is querying just those four of them. If there was an exception here, I would point to a data error in the dictionary which we would fix immediately. This data is not user driven so there is no issue here.
| static Texture BoneAssignmentDotFrameIcon; | ||
| static Texture BoneAssignmentDotFrameDottedIcon; | ||
|
|
||
| static string[] boneGroupTabs = { "Body", "Head", "Left Hand", "Right Hand" }; |
Copilot
AI
Jun 8, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[nitpick] The new keyword hides any inherited member and can be confusing. Rename or remove hiding to follow best practices, or explicitly qualify intent with a comment.
| static string[] boneGroupTabs = { "Body", "Head", "Left Hand", "Right Hand" }; | |
| static string[] boneGroupTabs = { "Body", "Head", "Left Hand", "Right Hand" }; | |
| // The 'new' keyword is used here to hide the 'boneGroups' member in the base class. | |
| // This is intentional to provide a different implementation specific to GLTFImporterInspector. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What "new" keyword GPT? Are we hallucinating again? :)
…kes finding the desired avatar in the project easier.
|
I just committed one more change which I forgot when first sending the PR. Sorry. |
|
Renamed MecanimBoneName to lowercase. |
|
Added missing assignedBoneNames.Clear call. |
|
Hello again @hybridherbst. I addressed the parts GPT mentioned. You can check if you want. Thanks again. |
|
hey, looks great! Please give us some time for reviewing and testing :) |
|
Yea, no problem. Thou, even it looks much, it's very simple implementation. Let me know if I can help in any way. Thank you for this great project! |
|
Hello guys. I am sure you are busy with lots of other stuff but, since it's been a while, and since I've put a lot of effort into my PRs, I wanted to ask if you will be able to check this PR and my other PRs hopefully soon? Also, I have a question in one of my issues. |
|
Hey, don't worry.. we will definitely take look at that and appreciate your efford. Please keep in mind, that none of us is a fulltime developer of this repo. So sometimes it can take some time. |
This PR resolves the problem described in #859.
Here is how it looks: