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

Wrap VRC dependencies and VRCAvatarDescriptors #504

Merged
merged 13 commits into from
Nov 10, 2023

Conversation

kaikoga
Copy link
Contributor

@kaikoga kaikoga commented Oct 17, 2023

Related issue: #478

This PR wraps everything VRCSDK specific inside #if MA_VRCSDK3_AVATARS and remove any VRCAvatarDescriptor usage outside them (some leftover of #482).

Note: Does not get rid of VRCSDK-specific runtime components (like ModularAvatarPBBlocker or ModularAvatarParameters) yet. It is more strategic than technical change in Runtime only, so I think it deserves a separate PR.

Note: VRCSDK specific MA components in prefabs would be Missing. They are supposed to be removed on processing avatar.

@kaikoga kaikoga marked this pull request as ready for review October 17, 2023 15:55
{
}

#endif
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Copy link
Owner

Choose a reason for hiding this comment

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

AvatarTagComponent was originally used as a workaround for the component whitelist prior to the introduction of IEditorOnly. It's unfortunately part of the public API at this point, but I don't want to recommend its use in newer tools.

@bdunderscore
Copy link
Owner

Thanks for the PR! Sorry - I probably won't have time to review this properly until next week. I'll take a look when I find the time...

@@ -277,13 +281,15 @@ private void AdjustBehavior(StateMachineBehaviour behavior)
{
switch (behavior)
{
#if MA_VRCSDK3_AVATARS
Copy link
Owner

Choose a reason for hiding this comment

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

Move this outside the switch for now

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Should I rather wrap entire AdjustBehavior() method and calls to it, or keep the AdjustBehavior() method empty?

Copy link
Owner

Choose a reason for hiding this comment

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

Leave the method empty for now, I think it's reasonable to keep the method call itself to avoid spreading #ifs all over the codebase

@@ -256,13 +260,15 @@ private void AdjustBehavior(StateMachineBehaviour behavior)
{
switch (behavior)
{
#if MA_VRCSDK3_AVATARS
Copy link
Owner

Choose a reason for hiding this comment

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

Same here (hm, these classes seem duplicated...)

@@ -1,4 +1,6 @@
using System;
#if MA_VRCSDK3_AVATARS
Copy link
Owner

Choose a reason for hiding this comment

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

I wonder if it would be better to move the menu processing (or rather, the VRChat-specific stuff) to a separate asmdef and make it conditionally built...

Copy link
Contributor Author

@kaikoga kaikoga Nov 2, 2023

Choose a reason for hiding this comment

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

I think breaking up asmdef would deserve a separate PR beforeafter this one. I am not certain enough how to move assets into folders, though. (at least I can try... everything VRCSDK under Runtime/VRChat and Editor/VRChat (or another name) I suppose?)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Couldn't try because extracting VRChat asmdef required extracting PluginDefinitions asmdef, too much to include in this PR

Copy link
Owner

Choose a reason for hiding this comment

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

Fair enough. We can work on that in a followup (in any case, I don't think we can move components...)

Editor/Util.cs Outdated
using Object = UnityEngine.Object;

namespace nadena.dev.modular_avatar.core.editor
{

#if MA_VRCSDK3_AVATARS
internal class CleanupTempAssets : IVRCSDKPostprocessAvatarCallback
Copy link
Owner

Choose a reason for hiding this comment

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

This is dead code and can be deleted.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That would be another task before this one.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@bdunderscore
Copy link
Owner

Sorry for how long the reviews took - and thanks!

@bdunderscore bdunderscore merged commit 3667dc3 into bdunderscore:main Nov 10, 2023
@kaikoga kaikoga deleted the wrap_vrc_deps branch December 19, 2023 22:36
enitimeago added a commit to enitimeago/make-it-mmd that referenced this pull request Jan 17, 2024
This is similar to bdunderscore/modular-avatar#504 and anatawa12/AvatarOptimizer#609 which are motivated by supporting non-VRChat avatars. There are no immediate plans on my end to add non-VRChat avatar support yet, but I intend to pull in code from these repositories where appropriate, and this would make syncing with upstream easier.
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