[VRCSDK 3.8.1-beta.1] VRCSDK 3.8.1-beta.1 has breaking changes for `IVRCSdkAvatarBuilderApi.BuildAndUpload`
available in future release
anatawa12
Summary
VRCSDK 3.8.1-beta.1 has breaking changes for
IVRCSdkAvatarBuilderApi.BuildAndUpload
that requiring referencing more assemblies than before to access the method.VRCSDK 3.8.1-beta.1 requires
VRC.SDK3A
assembly to be referenced in addition to VRC.SDK3A.Editor
and VRC.SDKBase.Editor
.This breaks Upload without preCheck and VRC Quest Tools.
Description
VRCSDK 3.8.1-beta.1 added overload for
IVRCSdkAvatarBuilderApi.BuildAndUpload
that has List<VRCPerPlatformOverride.PlatformOverrideOption>
as a parameter.The
VRCPerPlatformOverride.PlatformOverrideOption
is defined in VRC.SDK3A
assembly so the C# compiler requires VRC.SDK3A
assembly to be referenced to access the BuildAndUpload
method for overload resolution.This is a breaking change because
VRC.SDK3A
assembly is not necessary to be referenced in the previous version of VRCSDK.This Gist is the minimum reproducible code to reproduce the issue.
Download zip and extract to the
Assets
folder of Unity project with VRCSDK 3.8.1-beta.1 installed.It will fails to compile with CS0012 error.
Possible Solutions
There is a solution to this problem without bumping the breaking version, and I hope this improves API design of VRCSDK.
That is to add struct similar to
PlatformOverrideOption
into VRC.SDK3A.Editor
assembly, and copy the contents to VRCPerPlatformOverride.PlatformOverrideOption
in the Build
or BuildAndUpload
.This will resolve (revert) the breaking changes and will continue to work with existing code.
This shields the internal implementation of PlatformOverride by not exposing the
VRCPerPlatformOverride
component which is currently used for multi-platform build.By exposing
VRCPerPlatformOverride.PlatformOverrideOption
onto the [PublicAPI]
surface, it will (partially) expose the fact multi platform build is implemented with component, but it can be changed over the time so designing the API to be flexible is better.In addition, Developers won't need to write long type name
VRCPerPlatformOverride.PlatformOverrideOption
in their code so this makes code easier to read.Additional Notes
This is not a fatal but
IVRCSdkAvatarBuilderApi.BuildAndUpload
and their properties are not marked as [PublicAPI]
that should be.Log In
This post was marked as
available in future release
orels
Hey! Thanks for the report
One issue with the proposed solution that I can see is that it would not be able to provide methods for actually assigning overrides (which are currently static methods on the
VRCPerPlatformOverride
class.Making a shim struct that gets copied over might cause confusion for which one you're supposed to use if you actually want to declare overrides in code and save them on the avatar (without creating a custom storage solution).
So we'd have to also create another API in the SDK editor assembly that expose that (to avoid requiring referencing SDK3A runtime assembly directly).
We're gonna discuss what is the best way forward. But if you have any thoughts on that specific aspect of it - please let me know!
anatawa12
orels
> One issue with the proposed solution that I can see is that it would not be able to provide methods for actually assigning overrides (which are currently static methods on the VRCPerPlatformOverride class.
> So we'd have to also create another API in the SDK editor assembly that expose that (to avoid requiring referencing SDK3A runtime assembly directly).
Sorry, I didn’t really check out the new static API in detail.
I think having static methods in the editor assembly with the same struct as the BuilderApi makes sense, like you mentioned.
orels
anatawa12anatawa12: got it, thanks!
We're going ahead with making a new class that handles all of these interactions in the VRC.SDK3A.Editor assembly. The class added in beta.1 will be marked internal and used only for the final data storage. All of the interactions would need to go through
PerPlatformOverrides
class.This also shortens the classname for the options to just
PerPlatformOverrides.Option
StormRel
tracked