From 8d0a94161185e58f95da0bb7d1327f881ecf4472 Mon Sep 17 00:00:00 2001 From: Vova Vernygora Date: Thu, 28 Apr 2022 15:28:38 -0400 Subject: [PATCH] release 0.11.2-preview.2 --- .yamato/upm-ci-testprojects.yml | 2 +- README.md | 2 -- .../Editor/PerceptionCameraEditorUrpTests.cs | 8 +---- com.unity.perception/CHANGELOG.md | 8 +++++ .../Editor/Visualizer/VisualizerInstaller.cs | 33 +++++++++++-------- .../Editor/PerceptionCameraEditorTests.cs | 19 +++++++---- com.unity.perception/package.json | 2 +- 7 files changed, 44 insertions(+), 30 deletions(-) diff --git a/.yamato/upm-ci-testprojects.yml b/.yamato/upm-ci-testprojects.yml index 8f261cef5..000322e50 100644 --- a/.yamato/upm-ci-testprojects.yml +++ b/.yamato/upm-ci-testprojects.yml @@ -17,7 +17,7 @@ - pip install unity-downloader-cli --index-url https://artifactory.prd.it.unity3d.com/artifactory/api/pypi/pypi/simple --upgrade - unity-downloader-cli -u {{ editor.version }} -c editor -c StandaloneSupport-IL2CPP -c Linux --wait --published {% if suite.name == "standalone" %} - - utr/utr --testproject=./TestProjects/{{project.name}} --editor-location=./.Editor --reruncount=2 --artifacts_path=test-results --category=!Performance --stdout-filter=minimal --extra-editor-arg="--force-d3d11" {{suite.args}}StandaloneWindows64 + - utr/utr --testproject=./TestProjects/{{project.name}} --editor-location=./.Editor --reruncount=2 --artifacts_path=test-results --category=!Performance;!Python --stdout-filter=minimal --extra-editor-arg="--force-d3d11" {{suite.args}}StandaloneWindows64 {% else %} - utr/utr --testproject=./TestProjects/{{project.name}} --editor-location=./.Editor --reruncount=2 --artifacts_path=test-results --category=!Performance --stdout-filter=minimal --extra-editor-arg="--force-d3d11" {{suite.args}} {% endif %} diff --git a/README.md b/README.md index 8d198f291..d75f9054f 100644 --- a/README.md +++ b/README.md @@ -19,8 +19,6 @@ The Perception package provides a toolkit for generating large-scale datasets fo Visit the [Unity Computer Vision](https://unity.com/computer-vision) page for more information on our tools and offerings! -[Join our mailing list](https://create.unity.com/computer-vision-newsletter-sign-up?_gl=1*m30uzd*_gcl_aw*R0NMLjE2NDE4MzcyMjAuQ2p3S0NBaUF6LS1PQmhCSUVpd0FHMXJJT2tyQnYwaFFpQUtBQ1pwdXlzeklPbkdtRHp4dnVVOXNSem1EY0dwaTdLOFRra3FQc2gwLTFSb0NHQlFRQXZEX0J3RQ..*_gcl_dc*R0NMLjE2NDE4MzcyMjAuQ2p3S0NBaUF6LS1PQmhCSUVpd0FHMXJJT2tyQnYwaFFpQUtBQ1pwdXlzeklPbkdtRHp4dnVVOXNSem1EY0dwaTdLOFRra3FQc2gwLTFSb0NHQlFRQXZEX0J3RQ). Sign up now to stay up to date on our latest product feature release, upcoming community events, though-leadership blog posts, and more! - ## Getting Started **[Quick Installation Instructions](com.unity.perception/Documentation~/SetupSteps.md)** diff --git a/TestProjects/PerceptionURP/Assets/Tests/Editor/PerceptionCameraEditorUrpTests.cs b/TestProjects/PerceptionURP/Assets/Tests/Editor/PerceptionCameraEditorUrpTests.cs index 5d90354ba..7e5b8b4b4 100644 --- a/TestProjects/PerceptionURP/Assets/Tests/Editor/PerceptionCameraEditorUrpTests.cs +++ b/TestProjects/PerceptionURP/Assets/Tests/Editor/PerceptionCameraEditorUrpTests.cs @@ -25,13 +25,7 @@ public void TearDown() [UnityTest] public IEnumerator MissingRendererFeature_ProducesLogError() { - int sceneCount = SceneManager.sceneCount; - for (int i = sceneCount - 1; i >= 0; i--) - { - EditorSceneManager.CloseScene(SceneManager.GetSceneAt(i), true); - } - - EditorSceneManager.NewScene(NewSceneSetup.EmptyScene); + EditorSceneManager.NewScene(NewSceneSetup.EmptyScene, NewSceneMode.Single); var urpAsset = AssetDatabase.LoadAssetAtPath("Assets/Settings/NoGroundTruthURPAsset.asset"); GraphicsSettings.renderPipelineAsset = urpAsset; diff --git a/com.unity.perception/CHANGELOG.md b/com.unity.perception/CHANGELOG.md index 4892bc0e8..0ec0de472 100644 --- a/com.unity.perception/CHANGELOG.md +++ b/com.unity.perception/CHANGELOG.md @@ -21,6 +21,14 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. ### Fixed +## [0.11.2-preview.2] - 2022-04-28 + +### Fixed + +Install and Open Data Visualizer on Mac + +Documentation + ## [0.11.1-preview.1] - 2022-04-13 ### Added diff --git a/com.unity.perception/Editor/Visualizer/VisualizerInstaller.cs b/com.unity.perception/Editor/Visualizer/VisualizerInstaller.cs index 30f93055f..bccbecc71 100644 --- a/com.unity.perception/Editor/Visualizer/VisualizerInstaller.cs +++ b/com.unity.perception/Editor/Visualizer/VisualizerInstaller.cs @@ -18,7 +18,7 @@ public class VisualizerInstaller : EditorWindow //This files stores entries as ProjectDataPath,PythonPID,Port,VisualizerPID //It keeps a record of the instances of visualizer opened so that we don't open a new one everytime const string k_FilenameStreamlitInstances = "Unity/streamlit_instances.csv"; - + static bool hasPerceptionInternal; static string PathToStreamlitInstances { get @@ -42,17 +42,19 @@ const string k_NameOfVisualizerProcess = "datasetvisualizer"; #endif - internal static Task InstallationCommand(ref int exitCode, string packagesPath, bool forcePublic) + internal static Task InstallationCommand(ref int exitCode, string packagesPath) { var exitCodeCopy = exitCode; var pythonPath = Path.Combine(Directory.GetParent(packagesPath)?.ToString() ?? string.Empty, "python.exe"); - var indexURL = forcePublic ? string.Empty : GetIndexURL(); + var indexURL = GetIndexURL(); #if UNITY_EDITOR_WIN - var task = Task.Run(() => ExecuteCmd($"{pythonPath} -m pip install --upgrade --no-warn-script-location unity-cv-datasetvisualizer {indexURL}", ref exitCodeCopy)); + var task = Task.Run(() => ExecuteCmd($"\"{pythonPath}\" -m pip install --upgrade --no-warn-script-location unity-cv-datasetvisualizer {indexURL}", ref exitCodeCopy)); + task.Wait(); #elif UNITY_EDITOR_OSX - var task = Task.Run(() => ExecuteCmd($"cd {packagesPath}; ./python3.7 -m pip install --upgrade unity-cv-datasetvisualizer {indexURL}", ref exitCodeCopy)); + var task = Task.Run(() => ExecuteCmd($"cd \'{packagesPath}\'; ./python3.7 -m pip install --upgrade unity-cv-datasetvisualizer {indexURL}", ref exitCodeCopy)); + task.Wait(); #endif exitCode = exitCodeCopy; return task; @@ -63,9 +65,11 @@ internal static Task UninstallCommand(ref int exitCode, string packagesPath) var exitCodeCopy = exitCode; var pythonPath = Path.Combine(Directory.GetParent(packagesPath)?.ToString() ?? string.Empty, "Scripts"); #if UNITY_EDITOR_WIN - var task = Task.Run(() => ExecuteCmd($"cd {pythonPath} && pip uninstall -y unity-cv-datasetvisualizer", ref exitCodeCopy)); + var task = Task.Run(() => ExecuteCmd($"cd \"{pythonPath}\" && pip uninstall -y unity-cv-datasetvisualizer", ref exitCodeCopy)); + task.Wait(); #elif UNITY_EDITOR_OSX - var task = Task.Run(() => ExecuteCmd($"cd {packagesPath}; ./python3.7 pip uninstall unity-cv-datasetvisualizer", ref exitCodeCopy)); + var task = Task.Run(() => ExecuteCmd($"cd \'{packagesPath}\'; ./python3.7 -m pip uninstall -y unity-cv-datasetvisualizer", ref exitCodeCopy)); + task.Wait(); #endif exitCode = exitCodeCopy; return task; @@ -77,12 +81,13 @@ static string GetIndexURL() const string pckName = "com.unity.perception.internal"; if (!File.Exists("Packages/manifest.json")) { + hasPerceptionInternal = false; return string.Empty; } var jsonText = File.ReadAllText("Packages/manifest.json"); - var hasPerceptionInternal = jsonText.Contains( pckName ); - return hasPerceptionInternal ? "--index-url=https://artifactory.prd.it.unity3d.com/artifactory/api/pypi/unity-pypi-local/simple/" : string.Empty; + hasPerceptionInternal = jsonText.Contains( pckName ); + return hasPerceptionInternal ? "--extra-index-url=https://artifactory.prd.it.unity3d.com/artifactory/api/pypi/unity-pypi-local/simple/" : string.Empty; } // ReSharper disable Unity.PerformanceAnalysis @@ -131,14 +136,16 @@ static async Task SetupVisualizer() EditorUtility.DisplayProgressBar("Setting up the Visualizer", "Installing Visualizer (This may take a few minutes)", 2f / steps); - await InstallationCommand(ref exitCode, packagesPath, false); - if (exitCode != 0) + await InstallationCommand(ref exitCode, packagesPath); + if (exitCode != 0 && hasPerceptionInternal ) { - Debug.LogWarning("Installing Public Visualizer"); - await InstallationCommand(ref exitCode, packagesPath, true); + Debug.LogWarning("Installation of internal visualizer is failed. You are probably not on VPN, turn on the VPN and try again."); + EditorUtility.ClearProgressBar(); + return; } if (exitCode != 0) { + Debug.LogWarning("Failed to install the visualizer."); EditorUtility.ClearProgressBar(); return; } diff --git a/com.unity.perception/Tests/Editor/PerceptionCameraEditorTests.cs b/com.unity.perception/Tests/Editor/PerceptionCameraEditorTests.cs index 34b2df69c..0b4ff3b1e 100644 --- a/com.unity.perception/Tests/Editor/PerceptionCameraEditorTests.cs +++ b/com.unity.perception/Tests/Editor/PerceptionCameraEditorTests.cs @@ -103,18 +103,25 @@ static void InstallOrUninstallVisualizerAsync(string packagesPath, bool installF if (installFlag) { EditorUtility.DisplayProgressBar("Setting up the Visualizer", "Installing Visualizer (This may take a few minutes)", 2f / steps); - Task.WaitAll(VisualizerInstaller.InstallationCommand(ref exitCode, packagesPath, true)); + Task.WaitAll(VisualizerInstaller.InstallationCommand(ref exitCode, packagesPath)); + if (exitCode != 0) + { + Debug.LogWarning("Fail to Install the Visualizer"); + EditorUtility.ClearProgressBar(); + return; + } } // if install flag is false, uninstall the visualizer else { EditorUtility.DisplayProgressBar("Uninstall the Visualizer", "Uninstalling Visualizer (This may take a few minutes)", 2f / steps); Task.WaitAll(VisualizerInstaller.UninstallCommand(ref exitCode, packagesPath)); - } - if (exitCode != 0) - { - EditorUtility.ClearProgressBar(); - return; + if (exitCode != 0) + { + Debug.LogWarning("Fail to Uninstall the Visualizer"); + EditorUtility.ClearProgressBar(); + return; + } } EditorUtility.ClearProgressBar(); } diff --git a/com.unity.perception/package.json b/com.unity.perception/package.json index ae342693c..44d95e5b1 100644 --- a/com.unity.perception/package.json +++ b/com.unity.perception/package.json @@ -9,7 +9,7 @@ "displayName": "Perception", "name": "com.unity.perception", "unity": "2020.3", - "version": "0.11.1-preview.1", + "version": "0.11.2-preview.2", "samples": [ { "displayName": "Tutorial Files",