ndmf icon indicating copy to clipboard operation
ndmf copied to clipboard

[Platform Support] Question with Apply On Play with non-VRChat avatars

Open kaikoga opened this issue 3 months ago • 3 comments

Currently, in Apply On Play, every avatar marked by any of the INDMFPlatformProvider.AvatarRootComponentTypes would be processed by SyncPlatformConfigPass and converted into an avatar of AmbientPlatform.DefaultPlatform, which is usually VRChatPlatform, because platform Scope is not specified in Apply On Play.

Is this intended design? For example, for cases when a single avatar scene contains VRChat and VRM avatars, should Apply On Play convert all VRM avatars into VRChat avatars, or vice versa, depending on default platform settings? (This makes sense to some extent, because without this behavior, we need some another way to specify avatar platform conversion targets...)

If So:

I would go ahead and think how to save AmbientPlatform.DefaultPlatform defaults, because I need to change AmbientPlatform.DefaultPlatform to build non-VRChat avatars.

If Not:

May I request Apply On Play respect PlatformRegistry.GetPrimaryPlatformForAvatar(), so non-VRChat avatars can also benefit from Apply on Play?

Maybe related: #672

kaikoga avatar Sep 04 '25 14:09 kaikoga

Apply on play is something I've not looked into too much yet, since it's not practical for Resonite. The main issue is that we need to play well with emulation systems like Av3Emulator that might be present (in which case we are essentially forced into VRChat mode, I think?). We'd also want a way to change the platform in use when the primary platform is different (eg - if you specifically want to test a VRChat avatar in VRM mode).

I generally consider Apply on Play to be a form of debugging UI, and so what gets converted into what is a question of what implementation would be most convenient for debugging. That being said, this also means this isn't a save format compatibility concern, so I'd be open to merging a PR to experiment with better UI here, as long as it doesn't degrade functionality for VRChat projects.

bdunderscore avatar Sep 11 '25 01:09 bdunderscore

I would like to say both use cases are valid. One would want to try a VRChat avatar one-click converted with NDMF into VRM, or vice versa, and see the result in Play Mode. And other would want to check if a VRChat avatar's PhysBones would swing just like a VRM avatar's SpringBones in Play Mode (it just works without NDMF), then power both avatars with NDMF. Speaking with Av3Emulator, I doubt it should do anything to a non-VRChat avatar that is not converted into VRChat on Play, even with NDMF.

So, to cover all use cases involving Apply on Play, we need these options:

  • Convert a VRM avatar into a VRChat avatar in Play Mode
  • Convert a VRChat avatar into a VRM avatar in Play Mode
  • Keep VRM and VRChat avatars in Play Mode

Maybe 1. Saving Default Platform and make it configurable and 2. Adding a "Convert on Play" experimental option would fulfill all the needs? (or is it too much?)

On the other side, this is a VRM project specific problem; in the current state, only VRChat has Av3Emulator, and only VRM (strictly speaking, only VRM0 and VRM1) can coexist (debatable, though) in arbitrary other platform project while having a Play Mode feature (Resonite also can piggyback on VRChat+ projects but does not have the idea of Play Mode), so a generic solution is overkill here: a VRChat + Warudo project is not possible, Something + VRM + Resonite (plus maybe plain glTF or other formats that would not mess up with Play Mode) is the maximum we can achieve now.

Is a Platform Play Mode feature Grabs Unity Project
VRChat Yes Yes Yes
VRM Yes Yes No
Resonite Yes No No
ChilloutVR Yes Yes Yes
Warudo Yes (I don't know) Yes

kaikoga avatar Sep 16 '25 17:09 kaikoga

I'm adding to this issue since it's slightly related; I've noticed this on Basis Framework avatars: When I explicitly define ((BasisFrameworkPlatform))AvatarRootComponentType = typeof(BasisAvatar), entering Play Mode will process that avatar if Apply on Play is enabled.

However, in Basis Framework projects, Play Mode is actually the game itself running, it is not just a test scene.

To wear and test an avatar that has not been built, the user has to press a button "Test in Editor", which actually causes the game to load that avatar as the player's avatar in the game, with support for IK, voice, and everything (not emulated, but other players won't the avatar).

I have currently rigged the "Test in Editor" button to invoke NDMF, which is the moment when I would expect avatars to be processed.

I don't think Apply on Play by default is appropriate for Basis Framework projects.

hai-vr avatar Sep 30 '25 08:09 hai-vr