diff --git a/UnityProject/Assets/Settings/DeviceSetting.asset b/UnityProject/Assets/Settings/AzureSettings.asset similarity index 93% rename from UnityProject/Assets/Settings/DeviceSetting.asset rename to UnityProject/Assets/Settings/AzureSettings.asset index 5ba309f..62f9de6 100644 --- a/UnityProject/Assets/Settings/DeviceSetting.asset +++ b/UnityProject/Assets/Settings/AzureSettings.asset @@ -10,7 +10,7 @@ MonoBehaviour: m_Enabled: 1 m_EditorHideFlags: 0 m_Script: {fileID: 11500000, guid: daa4216d09a83dc479a7ee221b2a5bf9, type: 3} - m_Name: DeviceSetting + m_Name: AzureSettings m_EditorClassIdentifier: _autoExposure: 1 _exposure: 0.5 @@ -24,3 +24,4 @@ MonoBehaviour: _enableBlc: 0 _powerIs60Hz: 1 _maxDepth: 1 + _depthMode: 2 diff --git a/UnityProject/Assets/Settings/DeviceSetting.asset.meta b/UnityProject/Assets/Settings/AzureSettings.asset.meta similarity index 79% rename from UnityProject/Assets/Settings/DeviceSetting.asset.meta rename to UnityProject/Assets/Settings/AzureSettings.asset.meta index d48626d..1cf963b 100644 --- a/UnityProject/Assets/Settings/DeviceSetting.asset.meta +++ b/UnityProject/Assets/Settings/AzureSettings.asset.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: f8122729f4736dd4ab99617ee19feec3 +guid: c681badc1a8be8243af1e0c53d337b50 NativeFormatImporter: externalObjects: {} mainObjectFileID: 11400000 diff --git a/UnityProject/Assets/ThridParty/Keijiro/DeviceSettings.cs b/UnityProject/Assets/ThridParty/Keijiro/DeviceSettings.cs index 42bd903..9349765 100644 --- a/UnityProject/Assets/ThridParty/Keijiro/DeviceSettings.cs +++ b/UnityProject/Assets/ThridParty/Keijiro/DeviceSettings.cs @@ -1,7 +1,9 @@ using UnityEngine; +using Microsoft.Azure.Kinect.Sensor; namespace Akvfx { + public sealed class DeviceSettings : ScriptableObject { #region Editable fields @@ -22,6 +24,7 @@ namespace Akvfx [SerializeField] bool _powerIs60Hz = true; [SerializeField, Range(0, 6.6f)] float _maxDepth = 1; + [SerializeField] DepthMode _depthMode = DepthMode.NFOV_Unbinned; #endregion @@ -87,6 +90,11 @@ namespace Akvfx set { _maxDepth = value; } } + public DepthMode depthMode{ + get { return _depthMode; } + set { _depthMode = value; } + } + #endregion #region Internal properties diff --git a/UnityProject/Assets/ThridParty/Keijiro/Editor/DeviceSettingsEditor.cs b/UnityProject/Assets/ThridParty/Keijiro/Editor/DeviceSettingsEditor.cs index 06bc0f2..8d9cac4 100644 --- a/UnityProject/Assets/ThridParty/Keijiro/Editor/DeviceSettingsEditor.cs +++ b/UnityProject/Assets/ThridParty/Keijiro/Editor/DeviceSettingsEditor.cs @@ -23,6 +23,7 @@ namespace Akvfx SerializedProperty _powerIs60Hz; SerializedProperty _maxDepth; + SerializedProperty _depthMode; static readonly ( GUIContent enableBlc, @@ -50,6 +51,7 @@ namespace Akvfx _powerIs60Hz = serializedObject.FindProperty("_powerIs60Hz"); _maxDepth = serializedObject.FindProperty("_maxDepth"); + _depthMode = serializedObject.FindProperty("_depthMode"); } public override void OnInspectorGUI() @@ -84,16 +86,17 @@ namespace Akvfx EditorGUILayout.PropertyField(_powerIs60Hz, _labels.powerIs60Hz); EditorGUILayout.PropertyField(_maxDepth); + EditorGUILayout.PropertyField(_depthMode); serializedObject.ApplyModifiedProperties(); } - [MenuItem("Assets/Create/Akvfx/Device Settings")] + [MenuItem("Assets/Create/SoundVision/Device Settings")] public static void CreateDeviceSettings() { var asset = ScriptableObject.CreateInstance(); - AssetDatabase.CreateAsset(asset, "Assets/Akvfx Settings.asset"); + AssetDatabase.CreateAsset(asset, "Assets/AzureSettings.asset"); AssetDatabase.SaveAssets(); EditorUtility.FocusProjectWindow(); diff --git a/UnityProject/Assets/ThridParty/Keijiro/Internal/DeviceSettingController.cs b/UnityProject/Assets/ThridParty/Keijiro/Internal/DeviceSettingController.cs index 68d2ba7..979f8fa 100644 --- a/UnityProject/Assets/ThridParty/Keijiro/Internal/DeviceSettingController.cs +++ b/UnityProject/Assets/ThridParty/Keijiro/Internal/DeviceSettingController.cs @@ -103,6 +103,7 @@ namespace Akvfx device, ColorControlCommand.PowerlineFrequency, settings.PowerFreqDeviceValue, _powerFreq, forceApply ); + } #endregion diff --git a/UnityProject/Assets/ThridParty/Keijiro/Internal/ThreadedDriver.cs b/UnityProject/Assets/ThridParty/Keijiro/Internal/ThreadedDriver.cs index 2538f7c..3f9e9d6 100644 --- a/UnityProject/Assets/ThridParty/Keijiro/Internal/ThreadedDriver.cs +++ b/UnityProject/Assets/ThridParty/Keijiro/Internal/ThreadedDriver.cs @@ -101,12 +101,14 @@ namespace Akvfx // Open the default device. var device = Device.Open(); + // Depth Mode + // Start capturing with custom settings. device.StartCameras( new DeviceConfiguration { ColorFormat = ImageFormat.ColorBGRA32, ColorResolution = ColorResolution.R1536p, // 2048 x 1536 (4:3) - DepthMode = DepthMode.NFOV_Unbinned, // 640x576 + DepthMode = _settings.depthMode, // defautlt NFOV unbinned 640x576 SynchronizedImagesOnly = true } );