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

fix: CVRAvatar prevents removal of Animator #260

Merged

Conversation

hai-vr
Copy link
Contributor

@hai-vr hai-vr commented Jun 11, 2024

The error "Can't remove Animator because CVRAvatar (Script) depends on it" occurs in ChilloutVR avatars during the recreation of the Animator component.

This is because CVRAvatar has a RequireComponent annotation for Animator.

This commit fixes this issue by removing CVRAvatar first, and recreates it in the same way.

Tested on ChilloutVR CCK v3.9 RELEASE

Comment on lines 128 to 130
var t_CVRAvatar = AppDomain.CurrentDomain.GetAssemblies()
.SelectMany(assembly => assembly.GetTypes())
.FirstOrDefault(t => t.FullName == "ABI.CCK.Components.CVRAvatar");
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this be generalized to components that depend on Animator in general? That would avoid NDMF core needing to know about CVR CCK (and thus make writing a test for this behavior much easier)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You want to enumerate the sibling components on the Animator and find out which ones have the RequireComponent attribute?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Addressing in 85a213c

hai-vr and others added 3 commits June 12, 2024 19:51
The error "Can't remove Animator because CVRAvatar (Script) depends on it" occurs in ChilloutVR avatars during the recreation of the Animator component.
This is because CVRAvatar has a RequireComponent annotation for Animator.
This commit fixes this issue by removing CVRAvatar first, and recreates it in the same way.

Tested on ChilloutVR CCK v3.9 RELEASE
@bdunderscore bdunderscore force-pushed the cvr-cvravatar-prevents-animator-removal branch from 85a213c to 35ece3e Compare June 13, 2024 02:52
@bdunderscore bdunderscore merged commit 9ea8e65 into bdunderscore:main Jun 13, 2024
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants