VRCSDK 3.9.1-beta.1 breaks the constructor compatibility of VRCPhysBoneBase.PermissionFilter
narazaka
Tools for avatars that handle properties like PhysBone are breaking! (Such as Avatar Menu Creator for MA)
// before
public struct PermissionFilter
{
public PermissionFilter(bool value)
{
allowSelf = value;
allowOthers = value;
}
}
// 3.9.1-beta.1
public class PermissionFilter
{
public PermissionFilter(bool value, DynamicsUsageFlags contentTypes)
{
allowSelf = value;
allowOthers = value;
this.contentTypes = contentTypes;
}
}
// so it breaks!
var f = new PermissionFilter();
var f2 = new PermissionFilter(true);
// Suggestions for maintaining compatibility
// 3.9.1-beta.2 or some
public class PermissionFilter
{
public PermissionFilter(bool value, DynamicsUsageFlags contentTypes)
{
allowSelf = value;
allowOthers = value;
this.contentTypes = contentTypes;
}
// add this
public PermissionFilter(bool value = true) : this(value, DynamicsUsageFlags.Everything) { }
}
Log In
_
_tau_
Merged in a post:
[VRCSDK 3.9.1-beta.1] Making `PermissionFilter` class from struct is breaking changes
anatawa12
VRCPhysBoneBase.PermissionFilter
is changed from struct to class in VRCSDK 3.9.1-beta.1.This is a breaking change for any code that uses
PermissionFilter
so breaking version number should be incremented.This is simple example of breaking the code:
struct MyStruct
{
public VRCPhysBoneBase.PermissionFilter filter;
}
void Method() {
MyStruct s = new MyStruct();
s.filter.allowSelf = true; // This line will cause NullReferenceException at runtime, with VRCSDK 3.9.1-beta.1
}
narazaka
Since Gesture Manager also seems to be broken (for a different reason), it might be better to release it as 3.10 rather than 3.9.1.