SDK Bug & Feature Requests

Please check out the following rules and use the provided template when posting a bug report! Off-topic posts will be deleted.http://bit.ly/vrchat-bug-reports
Improve VRCPlayerAPI.GetPlayers()
Motivation In Udon Sharp, syntactically, the following is nonsensical: var players = new VRCPlayerApi[VRCPlayerApi.GetPlayerCount()]; VRCPlayerApi.GetPlayers(players); Why doesn't GetPlayers() just… return a preconstructed array of players in the instance already? Why do I need to first create an empty array? In Udon Sharp, at least, one can easy replace or initialize an array with something else like so: int[] arrayOfNumbers; void someFunction() { arrayOfNumbers = someClassInstance.AFunctionThatReturnsAnIntArray() } There is no need to preset the size of the array, as the actual array construction is handled by another function. But in the VRCSDK we are required to pass a prebuilt array to this function??? Make it make sense. Solutions One, Update UDON so GetPlayers() no longer requires passing in an empty VRCPlayerAPI[] sized to the number of players when compiled with a newer SDK; The UDON VM would support both the old and the new behavior. This would have the benefit of, at least in UDON Sharp, being syntactically valid, as the initialized VRCPlayerAPI[] would become effectively an optional variable. If passed, it would follow the current behavior. If not passed, the function will create an array sized to the current number of players currently in the instance automatically. Two, create a separate GetPlayerList() , which would return a VRCPlayerAPI[] of the appropriate size (which could then be stored as a variable), and deprecate GetPlayers(VRCPlayerAPI[] players) in favor of the new function. This would have the benefit of easier backwards compatibility and avoid changing default behavior of an existing function.
5
·
Feature Request
·
available in future release
[VRCCameraSettings] Property to tell which camera is currently rendering
Within a render callback such as OnWillRenderObject, it's useful to be able to check which camera is rendering. Unity has "Camera.current" for this, but it's not exposed to Udon. The new camera API is awesome, but without a property like that, I still can't make my UdonPortals prefab render correctly in the hand-held camera because there's no way to tell which camera is currently triggering OnWillRenderObject. I'd like a property to tell which camera is responsible for the render. A really simple implementation would be a new read-only property like: VRCCameraSettings.CurrentCameraType: An enum consisting of the values "ScreenCamera" or "PhotoCamera". However, I think this API could be extended further to be even more useful. In particular, if a Camera that was created by the world (and so is already accessible to Udon) is rendering, it would be great to be able to access the actual Camera object! Just like Unity's "Camera.current", but only limited to world-created Cameras. An API might look like this: VRCCameraSettings.CurrentCameraType: Enum consisting of the values "ScreenCamera", "PhotoCamera", "WorldCamera", or "Other". "WorldCamera" would be any camera created by the current world, i.e. a Camera that's accessible to Udon. "Other" would be anything else that isn't (yet!) accessible to Udon, e.g. avatar cameras or the screenshot camera. VRCCameraSettings.CurrentCamera: A reference to the current Camera object, just like Unity's Camera.current, except it's only set when CurrentCameraType is "WorldCamera". Otherwise, it's null.
4
·
Feature Request
·
available in future release