ZView::SetSetting throws exception inconsistently

0 votes
asked May 6, 2016 by aspartamed (196 points)
ZViewManager:OnConnectionAccepted calling _zView.SetSetting(connection, ZView.SettingKey.ImageHeight, (UInt16)1080); some times throws a 'zSpace.zView.InvalidSettingKeyException'

Is there a property or event to wait for to know when the ZView.SettingKey.ImageHeight is considered valid?

-------------------------- Stack -----------------------------

Unable to set ZView image settings zSpace.zView.InvalidSettingKeyException: Exception of type 'zSpace.zView.InvalidSettingKeyException' was thrown.
  at zSpace.zView.ZView.SetSetting (IntPtr connection, SettingKey key, UInt16 value) [0x0000f] in C:\dev\git\Assets\zSpace\zView\Scripts\ZView.cs:3284
  at ZViewManager.OnConnectionAccepted() [0x000d7] in C:\dev\git\ZViewManager.cs:100
UnityEngine.Debug:Log(Object)
ZViewManager:OnConnectionAccepted() (at Assets/Scripts/ZViewManager.cs:107)

--------------------------- CODE-------------------------------------

      _zView.BeginSettingsBatch(connection);
        _zView.SetSetting(connection, ZView.SettingKey.VideoRecordingQuality, (UInt32)ZView.VideoRecordingQuality.Resolution1080p);
        _zView.SetSetting(connection, ZView.SettingKey.ImageHeight, (UInt16)1080);
        _zView.SetSetting(connection, ZView.SettingKey.ImageWidth, (UInt16)1920);
        _zView.EndSettingsBatch(connection);
commented Dec 14, 2016 by dtwilleagerinfinitez-com (275 points)
Sorry for the delayed response.  Setting the image dimensions in the connection accepted callback is usually too early.  You aren't in a mode
at that point, so it will sometimes fail.  Our sample in the Unity Zview SDK shows how to reliably set the image dimensions.  Look for                     UpdateImageResolution() in the VirtualCameraStandard class for an example.
...