Skip to content

Commit

Permalink
Add the option to open a camera by its serial number
Browse files Browse the repository at this point in the history
  • Loading branch information
Bvallon-sl committed Sep 15, 2022
1 parent 4df448b commit 662ed3e
Show file tree
Hide file tree
Showing 17 changed files with 160 additions and 215 deletions.
6 changes: 6 additions & 0 deletions ZEDCamera/Assets/ZED/Editor/Scripts/ZEDCameraEditor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ public class ZEDCameraEditor : Editor
private SerializedProperty depthModeProperty;
private SerializedProperty usbResolutionProperty;
private SerializedProperty usbFPSProperty;
private SerializedProperty usbSNProperty;
private SerializedProperty svoFileNameProperty;
private SerializedProperty svoLoopProperty;
private SerializedProperty svoRealTimeModeProperty;
Expand Down Expand Up @@ -218,6 +219,7 @@ private void OnEnable()
inputTypeProperty = serializedObject.FindProperty("inputType");
usbResolutionProperty = serializedObject.FindProperty("resolution");
usbFPSProperty = serializedObject.FindProperty("FPS");
usbSNProperty = serializedObject.FindProperty("serialNumber");
svoFileNameProperty = serializedObject.FindProperty("svoInputFileName");
svoLoopProperty = serializedObject.FindProperty("svoLoopBack");
svoRealTimeModeProperty = serializedObject.FindProperty("svoRealTimeMode");
Expand Down Expand Up @@ -377,6 +379,10 @@ public override void OnInspectorGUI()
"- HD2k: 15FPS\r\n\n- HD1080: 30FPS\r\n\n- HD720p: 60FPS\r\n\n- VGA: 100FPS");
GUI.enabled = !Application.isPlaying;
usbFPSProperty.intValue = EditorGUILayout.IntField(cameraFPSLabel, usbFPSProperty.intValue);

GUIContent cameraSerialNumberLabel = new GUIContent("Serial Number", "Serial number of the camera to open. Set the SN to 0 to open the camera by ID.");
GUI.enabled = !Application.isPlaying;
usbSNProperty.intValue = EditorGUILayout.IntField(cameraSerialNumberLabel, usbSNProperty.intValue);
GUI.enabled = true;
serializedObject.ApplyModifiedProperties();

Expand Down
11 changes: 11 additions & 0 deletions ZEDCamera/Assets/ZED/Editor/Scripts/ZEDCameraEditor.cs.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -152,8 +152,8 @@ MonoBehaviour:
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: dc42784cf147c0c48a680349fa168899, type: 3}
m_Name:
m_EditorClassIdentifier:
m_Name:
m_EditorClassIdentifier:
m_IgnoreReversedGraphics: 1
m_BlockingObjects: 0
m_BlockingMask:
Expand All @@ -169,8 +169,8 @@ MonoBehaviour:
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 0cd44c1031e13a943bb63640046fad76, type: 3}
m_Name:
m_EditorClassIdentifier:
m_Name:
m_EditorClassIdentifier:
m_UiScaleMode: 1
m_ReferencePixelsPerUnit: 100
m_ScaleFactor: 1
Expand Down Expand Up @@ -357,8 +357,8 @@ MonoBehaviour:
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 6797e7683a7af834484d666ec79e9909, type: 3}
m_Name:
m_EditorClassIdentifier:
m_Name:
m_EditorClassIdentifier:
zedManager: {fileID: 1078485266}
canvas: {fileID: 65360501}
startObjectDetectionAutomatically: 1
Expand Down Expand Up @@ -589,7 +589,7 @@ PrefabInstance:
- target: {fileID: 114491592745282986, guid: 76db3eb81fd21ae45bab5204e324ae42,
type: 3}
propertyPath: svoInputFileName
value:
value:
objectReference: {fileID: 0}
- target: {fileID: 114491592745282986, guid: 76db3eb81fd21ae45bab5204e324ae42,
type: 3}
Expand Down Expand Up @@ -760,8 +760,8 @@ MonoBehaviour:
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 75b2a3ff7b847ca4490808f4c0432cd4, type: 3}
m_Name:
m_EditorClassIdentifier:
m_Name:
m_EditorClassIdentifier:
--- !u!224 &1123750126 stripped
RectTransform:
m_CorrespondingSourceObject: {fileID: 224477321843734534, guid: a71fe20b5d673e34fb3fef09b4bb6ee3,
Expand Down Expand Up @@ -796,8 +796,8 @@ MonoBehaviour:
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 4f231c4fb786f3946a6b90b886c48677, type: 3}
m_Name:
m_EditorClassIdentifier:
m_Name:
m_EditorClassIdentifier:
m_HorizontalAxis: Horizontal
m_VerticalAxis: Vertical
m_SubmitButton: Submit
Expand All @@ -815,8 +815,8 @@ MonoBehaviour:
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 76c392e42b5098c458856cdf6ecaaaa1, type: 3}
m_Name:
m_EditorClassIdentifier:
m_Name:
m_EditorClassIdentifier:
m_FirstSelected: {fileID: 0}
m_sendNavigationEvents: 1
m_DragThreshold: 10
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ PrefabInstance:
- target: {fileID: 114491592745282986, guid: 76db3eb81fd21ae45bab5204e324ae42,
type: 3}
propertyPath: svoInputFileName
value: D:/SVO/MultiPeople.svo
value:
objectReference: {fileID: 0}
- target: {fileID: 114491592745282986, guid: 76db3eb81fd21ae45bab5204e324ae42,
type: 3}
Expand Down Expand Up @@ -348,8 +348,8 @@ MonoBehaviour:
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 75b2a3ff7b847ca4490808f4c0432cd4, type: 3}
m_Name:
m_EditorClassIdentifier:
m_Name:
m_EditorClassIdentifier:
--- !u!1 &1103816800
GameObject:
m_ObjectHideFlags: 0
Expand Down Expand Up @@ -484,8 +484,8 @@ MonoBehaviour:
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 050df1fa7a5de6f40a3677d766ed3063, type: 3}
m_Name:
m_EditorClassIdentifier:
m_Name:
m_EditorClassIdentifier:
zedManager: {fileID: 56380649}
startObjectDetectionAutomatically: 1
boundingBoxPrefab: {fileID: 1438017172825460, guid: 2d803190bc4738d4daf5932468a5495e,
Expand Down
21 changes: 18 additions & 3 deletions ZEDCamera/Assets/ZED/Examples/SimpleMR/Scenes/SimpleMR.unity
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,7 @@ Transform:
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 261599528}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalPosition: {x: 0, y: 0, z: 1}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children:
- {fileID: 1919687801}
Expand Down Expand Up @@ -1101,7 +1101,7 @@ Light:
m_InnerSpotAngle: 52.492146
m_CookieSize: 10
m_Shadows:
m_Type: 0
m_Type: 2
m_Resolution: 2
m_CustomResolution: -1
m_Strength: 0.887
Expand Down Expand Up @@ -1516,6 +1516,11 @@ PrefabInstance:
propertyPath: arlayer
value: 30
objectReference: {fileID: 0}
- target: {fileID: 114491592745282986, guid: 76db3eb81fd21ae45bab5204e324ae42,
type: 3}
propertyPath: depthMode
value: 3
objectReference: {fileID: 0}
- target: {fileID: 114491592745282986, guid: 76db3eb81fd21ae45bab5204e324ae42,
type: 3}
propertyPath: inputType
Expand All @@ -1531,6 +1536,16 @@ PrefabInstance:
propertyPath: sensingMode
value: 1
objectReference: {fileID: 0}
- target: {fileID: 114491592745282986, guid: 76db3eb81fd21ae45bab5204e324ae42,
type: 3}
propertyPath: serialNumber
value: 0
objectReference: {fileID: 0}
- target: {fileID: 114491592745282986, guid: 76db3eb81fd21ae45bab5204e324ae42,
type: 3}
propertyPath: svoInputFileName
value:
objectReference: {fileID: 0}
- target: {fileID: 114491592745282986, guid: 76db3eb81fd21ae45bab5204e324ae42,
type: 3}
propertyPath: advancedPanelOpen
Expand Down Expand Up @@ -1824,7 +1839,7 @@ Light:
m_Type: 2
m_Resolution: 1
m_CustomResolution: -1
m_Strength: 0.3
m_Strength: 1
m_Bias: 0.05
m_NormalBias: 0.4
m_NearPlane: 0.2
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -326,7 +326,7 @@ PrefabInstance:
- target: {fileID: 20287226139793380, guid: 76db3eb81fd21ae45bab5204e324ae42,
type: 3}
propertyPath: m_TargetTexture
value:
value:
objectReference: {fileID: 8400000, guid: e0e43b005e1a1f347b4924d258914f0b, type: 2}
- target: {fileID: 20287226139793380, guid: 76db3eb81fd21ae45bab5204e324ae42,
type: 3}
Expand Down Expand Up @@ -416,7 +416,7 @@ PrefabInstance:
- target: {fileID: 114491592745282986, guid: 76db3eb81fd21ae45bab5204e324ae42,
type: 3}
propertyPath: svoInputFileName
value:
value:
objectReference: {fileID: 0}
- target: {fileID: 114491592745282986, guid: 76db3eb81fd21ae45bab5204e324ae42,
type: 3}
Expand Down Expand Up @@ -640,7 +640,7 @@ PrefabInstance:
- target: {fileID: 6327103935139800441, guid: ca18a88838151284380d84fc86d327e5,
type: 3}
propertyPath: Avatar
value:
value:
objectReference: {fileID: 1577629577426895579, guid: b2033efe657eddf4bbe61be41cc051bd,
type: 3}
- target: {fileID: 6327103935139800441, guid: ca18a88838151284380d84fc86d327e5,
Expand All @@ -656,12 +656,12 @@ PrefabInstance:
- target: {fileID: 6327103935139800441, guid: ca18a88838151284380d84fc86d327e5,
type: 3}
propertyPath: viewCamera
value:
value:
objectReference: {fileID: 1394870590}
- target: {fileID: 6327103935139800441, guid: ca18a88838151284380d84fc86d327e5,
type: 3}
propertyPath: zedManager
value:
value:
objectReference: {fileID: 1786428179}
- target: {fileID: 6327103935139800441, guid: ca18a88838151284380d84fc86d327e5,
type: 3}
Expand Down Expand Up @@ -858,8 +858,8 @@ MonoBehaviour:
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 75b2a3ff7b847ca4490808f4c0432cd4, type: 3}
m_Name:
m_EditorClassIdentifier:
m_Name:
m_EditorClassIdentifier:
--- !u!1001 &6360354422455212558
PrefabInstance:
m_ObjectHideFlags: 0
Expand Down
47 changes: 25 additions & 22 deletions ZEDCamera/Assets/ZED/HDRP_Assets/HDRenderPipelineAsset.asset
Original file line number Diff line number Diff line change
Expand Up @@ -148,16 +148,19 @@ MonoBehaviour:
enableFptlForForwardOpaque: 0
enableBigTilePrepass: 0
isFptlEnabled: 0
m_RenderPipelineResources: {fileID: 11400000, guid: 3ce144cff5783da45aa5d4fdc2da14b7, type: 2}
m_RenderPipelineResources: {fileID: 11400000, guid: 3ce144cff5783da45aa5d4fdc2da14b7,
type: 2}
m_RenderPipelineRayTracingResources: {fileID: 0}
m_DefaultVolumeProfile: {fileID: 11400000, guid: 7637fdba9232786489a40fbcbaf21daf, type: 2}
m_DefaultVolumeProfile: {fileID: 11400000, guid: 7637fdba9232786489a40fbcbaf21daf,
type: 2}
m_LensAttenuation: 0
m_UseRenderGraph: 1
m_DefaultLookDevProfile: {fileID: 11400000, guid: 7637fdba9232786489a40fbcbaf21daf, type: 2}
m_DefaultLookDevProfile: {fileID: 11400000, guid: 4dc3f0f4d35a148409c5e3a4d1270541,
type: 2}
m_RenderingPathDefaultCameraFrameSettings:
bitDatas:
data1: 69838057344013
data2: 4539628425463136280
data1: 70284954143757
data2: 4539628425461039128
lodBias: 1
lodBiasMode: 0
lodBiasQualityLevel: 0
Expand Down Expand Up @@ -197,10 +200,10 @@ MonoBehaviour:
sssCustomSampleBudget: 20
materialQuality: 0
m_RenderPipelineSettings:
supportShadowMask: 1
supportShadowMask: 0
supportSSR: 0
supportSSRTransparent: 0
supportSSAO: 0
supportSSAO: 1
supportSSGI: 0
supportSubsurfaceScattering: 0
sssSampleBudget:
Expand All @@ -218,11 +221,11 @@ MonoBehaviour:
lightLayerName6: Light Layer 6
lightLayerName7: Light Layer 7
supportDistortion: 0
supportTransparentBackface: 0
supportTransparentDepthPrepass: 0
supportTransparentDepthPostpass: 0
supportTransparentBackface: 1
supportTransparentDepthPrepass: 1
supportTransparentDepthPostpass: 1
colorBufferFormat: 74
supportCustomPass: 0
supportCustomPass: 1
customBufferFormat: 12
supportedLitShaderMode: 1
planarReflectionResolution:
Expand All @@ -241,9 +244,9 @@ MonoBehaviour:
decalLayerName7: Decal Layer 7
msaaSampleCount: 4
supportMotionVectors: 1
supportRuntimeDebugDisplay: 1
supportRuntimeDebugDisplay: 0
supportRuntimeAOVAPI: 0
supportDitheringCrossFade: 0
supportDitheringCrossFade: 1
supportTerrainHole: 0
supportProbeVolume: 0
supportRayTracing: 0
Expand All @@ -261,7 +264,7 @@ MonoBehaviour:
reflectionCubemapSize: 256
reflectionCacheCompressed: 0
reflectionProbeFormat: 74
skyReflectionSize: 256
skyReflectionSize: 512
skyLightingOverrideLayerMask:
serializedVersion: 2
m_Bits: 0
Expand All @@ -275,18 +278,18 @@ MonoBehaviour:
maxLightsPerClusterCell: 8
hdShadowInitParams:
maxShadowRequests: 128
directionalShadowsDepthBits: 32
directionalShadowsDepthBits: 16
shadowFilteringQuality: 1
punctualLightShadowAtlas:
shadowAtlasResolution: 4096
shadowAtlasDepthBits: 32
useDynamicViewportRescale: 1
areaLightShadowAtlas:
shadowAtlasResolution: 4096
shadowAtlasDepthBits: 32
useDynamicViewportRescale: 1
shadowAtlasResolution: 2048
shadowAtlasDepthBits: 16
useDynamicViewportRescale: 0
cachedPunctualLightShadowAtlas: 2048
cachedAreaLightShadowAtlas: 1024
cachedAreaLightShadowAtlas: 2048
shadowResolutionDirectional:
m_Values: 00010000000200000004000000080000
m_SchemaId:
Expand Down Expand Up @@ -351,7 +354,7 @@ MonoBehaviour:
ChromaticAberrationMaxSamples: 03000000060000000c000000
lightSettings:
useContactShadow:
m_Values: 000000
m_Values: 000101
m_SchemaId:
m_Id:
maximumLODLevel:
Expand Down Expand Up @@ -440,8 +443,8 @@ MonoBehaviour:
m_DefaultMaterialQualityLevel: 4
diffusionProfileSettings: {fileID: 0}
diffusionProfileSettingsList:
- {fileID: 11400000, guid: 06480f7f9faa1a34aa7de0fbed8c1c7b, type: 2}
- {fileID: 11400000, guid: 959748e3f61f6c3478b2a239a1eccb6a, type: 2}
- {fileID: 11400000, guid: 4e24b63c2d1821042aa23b182a67d8a9, type: 2}
- {fileID: 11400000, guid: ce7ab8c994cb43a4caa2d122cd328d78, type: 2}
beforeTransparentCustomPostProcesses: []
beforeTAACustomPostProcesses: []
beforePostProcessCustomPostProcesses: []
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 662ed3e

Please sign in to comment.