From 1ec7add9efabab3f9a1bd959a77cc1dd14ae6e17 Mon Sep 17 00:00:00 2001 From: Romain Failliot Date: Tue, 4 Sep 2018 15:50:51 -0400 Subject: [PATCH 01/34] Fix compil error with Unity 2018.1 or less --- Editor/PlayableNodes/PlayableOutputNode.cs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Editor/PlayableNodes/PlayableOutputNode.cs b/Editor/PlayableNodes/PlayableOutputNode.cs index b8f6abb..ca19112 100644 --- a/Editor/PlayableNodes/PlayableOutputNode.cs +++ b/Editor/PlayableNodes/PlayableOutputNode.cs @@ -45,7 +45,11 @@ public override string ToString() { sb.AppendLine(InfoString("IsValid", po.IsOutputValid())); sb.AppendLine(InfoString("Weight", po.GetWeight())); +#if UNITY_2018_2_OR_NEWER sb.AppendLine(InfoString("SourceOutputPort", po.GetSourceOutputPort())); +#else + sb.AppendLine(InfoString("SourceInputPort", po.GetSourceInputPort())); +#endif } return sb.ToString(); From d0711d156c45f2deec819245b6adaa25de5850d4 Mon Sep 17 00:00:00 2001 From: Romain Failliot Date: Tue, 9 Oct 2018 21:41:28 +0100 Subject: [PATCH 02/34] Add the name of the playable output in the inspector --- Editor/PlayableNodes/PlayableOutputNode.cs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Editor/PlayableNodes/PlayableOutputNode.cs b/Editor/PlayableNodes/PlayableOutputNode.cs index ca19112..a7524b2 100644 --- a/Editor/PlayableNodes/PlayableOutputNode.cs +++ b/Editor/PlayableNodes/PlayableOutputNode.cs @@ -43,6 +43,9 @@ public override string ToString() var po = (PlayableOutput) content; if (po.IsOutputValid()) { +#if UNITY_2019_1_OR_NEWER + sb.AppendLine(InfoString("Name", po.GetEditorName())); +#endif sb.AppendLine(InfoString("IsValid", po.IsOutputValid())); sb.AppendLine(InfoString("Weight", po.GetWeight())); #if UNITY_2018_2_OR_NEWER @@ -55,4 +58,4 @@ public override string ToString() return sb.ToString(); } } -} \ No newline at end of file +} From 56e446105eb2765bf3bfb42cea8bb7467fd5231b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcin=20S=C4=99kalski?= Date: Mon, 26 Nov 2018 14:05:08 +0000 Subject: [PATCH 03/34] Just a simple typo fix --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 6468428..1ac5df8 100644 --- a/README.md +++ b/README.md @@ -14,7 +14,7 @@ There are two ways to install the PlayableGraph Visualizer: 1. Standalone: - Download the release compatibles with your Unity version; - - Uncompress the downloaded file in your `Assets` direcroty. + - Uncompress the downloaded file in your `Assets` directory. 2. Git (command line): - Change directory to your project's `Assets` directory. From a3f07b54b8e1376e07020385968acd2f3094b6e6 Mon Sep 17 00:00:00 2001 From: Romain Failliot Date: Thu, 20 Dec 2018 18:16:01 -0500 Subject: [PATCH 04/34] [compilfix] Add UnityEditor.Playables namespace --- Editor/PlayableNodes/PlayableOutputNode.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/Editor/PlayableNodes/PlayableOutputNode.cs b/Editor/PlayableNodes/PlayableOutputNode.cs index a7524b2..3d6eac3 100644 --- a/Editor/PlayableNodes/PlayableOutputNode.cs +++ b/Editor/PlayableNodes/PlayableOutputNode.cs @@ -1,6 +1,7 @@ using System; using System.Text; using UnityEngine.Playables; +using UnityEditor.Playables; namespace GraphVisualizer { From d2a7e02cb6d3a4c1ca7fe2d534574b454f6e1007 Mon Sep 17 00:00:00 2001 From: Romain Failliot Date: Thu, 20 Dec 2018 15:03:38 -0500 Subject: [PATCH 05/34] [package] Add package.json --- package.json | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 package.json diff --git a/package.json b/package.json new file mode 100644 index 0000000..2db81db --- /dev/null +++ b/package.json @@ -0,0 +1,20 @@ +{ + "name": "com.unity.playablegraph-visualizer", + "displayName": "PlayableGraph Visualizer", + "version": "0.1.0-preview", + "unity": "2018.1", + "description": "The PlayableGraph Visualizer is a tool that displays the PlayableGraphs in the scene. It can be used in both Play and Edit mode and will always reflect the current state of the graph. Playable nodes are represented by colored nodes, varying according to their type. Connections color intensity indicates its weight.", + "licence": "MIT", + "author": { + "name": "Unity" + }, + "keywords": [ + "playable", + "graph", + "playablegraph", + "animation", + "timeline" + ], + "dependencies": { + } +} From 37a1312789963c285c940a754148ff98827ed793 Mon Sep 17 00:00:00 2001 From: Romain Failliot Date: Thu, 20 Dec 2018 15:08:41 -0500 Subject: [PATCH 06/34] [package] Add Yamato CI config files --- .npmignore | 19 +++++++++++++++++++ .yamato/build.yml | 28 ++++++++++++++++++++++++++++ 2 files changed, 47 insertions(+) create mode 100644 .npmignore create mode 100644 .yamato/build.yml diff --git a/.npmignore b/.npmignore new file mode 100644 index 0000000..696d110 --- /dev/null +++ b/.npmignore @@ -0,0 +1,19 @@ +artifacts/** +build/** +.build_script/** +node_modules/** +Documentation/ApiDocs/** +Documentation~/ApiDocs/** +.DS_Store +.npmrc +.npmignore +.gitignore +CONTRIBUTING.md +CONTRIBUTING.md.meta +QAReport.md +QAReport.md.meta +.gitlab-ci.yml +build.sh +build.sh.meta +build.bat +build.bat.meta diff --git a/.yamato/build.yml b/.yamato/build.yml new file mode 100644 index 0000000..a836fa8 --- /dev/null +++ b/.yamato/build.yml @@ -0,0 +1,28 @@ +name: Build and Test +agent: + type: Unity::VM + image: sdet/gamecode_win10:v0.2.1-91595 + flavor: m1.large + name: Validate a Package in CI +commands: + - npm install upm-ci-utils -g --registry https://api.bintray.com/npm/unity/unity-npm + # Add your custom build commands here + - upm-ci package pack --package-path . + - upm-ci package test --editor-revision asf234sdf234sadf234 --package-path . +triggers: + branches: + only: + - master + tags: + only: + - /(p|P)ublish/ +artifacts: + Package.zip: + paths: + - "automation/packages/com.unity.packages-starter-kit-1.0.0-preview.tgz" + TestResults.zip: + paths: + - "my-project/automation/test-results/*" + EditorLogs.zip: + paths: + - "my-project/automation/logs/*" From 8e7be118eb00d91737b32824dc9d01901ab69e59 Mon Sep 17 00:00:00 2001 From: Romain Failliot Date: Thu, 20 Dec 2018 15:22:44 -0500 Subject: [PATCH 07/34] [package] Add valid Unity changeset --- .yamato/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.yamato/build.yml b/.yamato/build.yml index a836fa8..10a0920 100644 --- a/.yamato/build.yml +++ b/.yamato/build.yml @@ -8,7 +8,7 @@ commands: - npm install upm-ci-utils -g --registry https://api.bintray.com/npm/unity/unity-npm # Add your custom build commands here - upm-ci package pack --package-path . - - upm-ci package test --editor-revision asf234sdf234sadf234 --package-path . + - upm-ci package test --editor-revision 445af4d85bb46baa615b469ca3cca83ec8892e78 --package-path . triggers: branches: only: From 23ce075639bfa1375d84f0dd3301734e3174f9ee Mon Sep 17 00:00:00 2001 From: Romain Failliot Date: Thu, 20 Dec 2018 15:38:21 -0500 Subject: [PATCH 08/34] [package] Set valid Package.zip property --- .yamato/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.yamato/build.yml b/.yamato/build.yml index 10a0920..44a79e4 100644 --- a/.yamato/build.yml +++ b/.yamato/build.yml @@ -19,7 +19,7 @@ triggers: artifacts: Package.zip: paths: - - "automation/packages/com.unity.packages-starter-kit-1.0.0-preview.tgz" + - "automation/packages/com.unity.playablegraph-visualizer-0.1.0-preview.tgz" TestResults.zip: paths: - "my-project/automation/test-results/*" From 68fd6ad013ea94e75ce702343eebb4fe5f564ac6 Mon Sep 17 00:00:00 2001 From: Romain Failliot Date: Thu, 20 Dec 2018 15:42:41 -0500 Subject: [PATCH 09/34] [package] Add valid agent image --- .yamato/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.yamato/build.yml b/.yamato/build.yml index 44a79e4..6c7fe92 100644 --- a/.yamato/build.yml +++ b/.yamato/build.yml @@ -1,7 +1,7 @@ name: Build and Test agent: type: Unity::VM - image: sdet/gamecode_win10:v0.2.1-91595 + image: sdet/gamecode_win10:v0.1.1-92318 flavor: m1.large name: Validate a Package in CI commands: From 20ff63a9a788b3b7f032898eed42c6e4c9984c19 Mon Sep 17 00:00:00 2001 From: Romain Failliot Date: Thu, 20 Dec 2018 15:57:49 -0500 Subject: [PATCH 10/34] [package] Rename dir Clients to Runtime --- Clients.meta => Runtime.meta | 0 {Clients => Runtime}/GraphVisualizerClient.cs | 0 {Clients => Runtime}/GraphVisualizerClient.cs.meta | 0 3 files changed, 0 insertions(+), 0 deletions(-) rename Clients.meta => Runtime.meta (100%) rename {Clients => Runtime}/GraphVisualizerClient.cs (100%) rename {Clients => Runtime}/GraphVisualizerClient.cs.meta (100%) diff --git a/Clients.meta b/Runtime.meta similarity index 100% rename from Clients.meta rename to Runtime.meta diff --git a/Clients/GraphVisualizerClient.cs b/Runtime/GraphVisualizerClient.cs similarity index 100% rename from Clients/GraphVisualizerClient.cs rename to Runtime/GraphVisualizerClient.cs diff --git a/Clients/GraphVisualizerClient.cs.meta b/Runtime/GraphVisualizerClient.cs.meta similarity index 100% rename from Clients/GraphVisualizerClient.cs.meta rename to Runtime/GraphVisualizerClient.cs.meta From 7f519fba5a974a1e52cef4ee51153cf0574a8e9b Mon Sep 17 00:00:00 2001 From: Romain Failliot Date: Thu, 20 Dec 2018 16:02:29 -0500 Subject: [PATCH 11/34] [package] Add asmdef files --- Editor/Unity.PlayableGraphVisualizer.Editor.asmdef | 10 ++++++++++ Runtime/Unity.PlayableGraphVisualizer.asmdef | 6 ++++++ 2 files changed, 16 insertions(+) create mode 100644 Editor/Unity.PlayableGraphVisualizer.Editor.asmdef create mode 100644 Runtime/Unity.PlayableGraphVisualizer.asmdef diff --git a/Editor/Unity.PlayableGraphVisualizer.Editor.asmdef b/Editor/Unity.PlayableGraphVisualizer.Editor.asmdef new file mode 100644 index 0000000..3e6362f --- /dev/null +++ b/Editor/Unity.PlayableGraphVisualizer.Editor.asmdef @@ -0,0 +1,10 @@ +{ + "name": "Unity.PlayableGraphVisualizer.Editor", + "references": [ + "Unity.PlayableGraphVisualizer" + ], + "includePlatforms": [ + "Editor" + ], + "excludePlatforms": [] +} diff --git a/Runtime/Unity.PlayableGraphVisualizer.asmdef b/Runtime/Unity.PlayableGraphVisualizer.asmdef new file mode 100644 index 0000000..23e9207 --- /dev/null +++ b/Runtime/Unity.PlayableGraphVisualizer.asmdef @@ -0,0 +1,6 @@ +{ + "name": "Unity.PlayableGraphVisualizer", + "references": [], + "includePlatforms": [], + "excludePlatforms": [] +} From bbff5c5116ef9998a080337805aebd12b20dfb7a Mon Sep 17 00:00:00 2001 From: Romain Failliot Date: Thu, 20 Dec 2018 16:11:39 -0500 Subject: [PATCH 12/34] [package] Add CHANGELOG.md --- CHANGELOG.md | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 CHANGELOG.md diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000..57a9f8e --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,13 @@ +# Changelog + +All notable changes to this package will be documented in this file. + +The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) +and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html). + +## [0.1.0] - 2018-12-20 + +### First release of Unity package *PlayableGraph Visualizer*. + +Mirrored the original [graph-visualizer repository](https://github.com/Unity-Technologies/graph-visualizer) +and modified it to fulfill the Unity package requirements. From 28b0e9c1f229f905702cc93f175af2f7b56f9d6f Mon Sep 17 00:00:00 2001 From: Romain Failliot Date: Thu, 20 Dec 2018 16:41:44 -0500 Subject: [PATCH 13/34] [package] Add documentation Remove redundant information in README.md and add a link to the documentation. --- Documentation~/playablegraph-visualizer.md | 38 ++++++++++++++++++++++ README.md | 34 +------------------ 2 files changed, 39 insertions(+), 33 deletions(-) create mode 100644 Documentation~/playablegraph-visualizer.md diff --git a/Documentation~/playablegraph-visualizer.md b/Documentation~/playablegraph-visualizer.md new file mode 100644 index 0000000..da50f0f --- /dev/null +++ b/Documentation~/playablegraph-visualizer.md @@ -0,0 +1,38 @@ +# About PlayableGraph Visualizer + +Use the *PlayableGraph Visualizer* package to have a visual representation of the +Playable graphs instantiated in the scene. + +# Installing PlayableGraph Visualizer + +To install this package, follow the instructions in the +[Package Manager documentation](https://docs.unity3d.com/Packages/com.unity.package-manager-ui@latest/index.html). + +# Using PlayableGraph Visualizer + +- Open the PlayableGraph Visualizer in **Window > PlayableGraph Visualizer** +- Open any scene that contains at least one `PlayableGraph` +- In the top-left list, select the `PlayableGraph` to display in the window +- Click on the nodes to display more information about the associated Playable handle + +_Note:_ +- You can show just your `PlayableGraph` using `GraphVisualizerClient.Show(PlayableGraph)` in the code +- If your `PlayableGraph` is only available in Play mode, you will not be able to see it in Edit mode + +# Technical details + +## Requirements + +This version of *PlayableGraph Visualizer* is compatible with the following versions of the Unity Editor: + +* 2018.1 and later (recommended) + +## Package contents + +The following table indicates the structure of the package: + +|Location|Description| +|---|---| +|`Editor/`|Contains the editor scripts for the new *PlayableGraph Visualizer* window.| +|`Runtime/GraphVisualizerClient.cs`|Contains the class allowing the user to register specific Playable graphs.| + diff --git a/README.md b/README.md index 1ac5df8..74cb928 100644 --- a/README.md +++ b/README.md @@ -1,39 +1,7 @@ # PlayableGraph Visualizer -## Introduction - The PlayableGraph Visualizer is a tool that displays the PlayableGraphs in the scene. It can be used in both Play and Edit mode and will always reflect the current state of the graph. Playable nodes are represented by colored nodes, varying according to their type. Connections color intensity indicates its weight. -## Setup - -🚨 Be careful to use a release that is compatible with your Unity version (see table below). The `master` branch is compatible with 2018.1 and later. - -There are two ways to install the PlayableGraph Visualizer: - -1. Standalone: - - Download the release compatibles with your Unity version; - - Uncompress the downloaded file in your `Assets` directory. - -2. Git (command line): - - Change directory to your project's `Assets` directory. - - Run `git clone https://github.com/Unity-Technologies/graph-visualizer` - -## Usage - -- Open the PlayableGraph Visualizer in **Window > PlayableGraph Visualizer**. -- Open any scene that contains at least one `PlayableGraph`. -- Select the `PlayableGraph` to display in the window's top-left list. -- Click on the nodes to display more information about the associated Playable Handle. - -_Note:_ -- You can show just your `PlayableGraph` using `GraphVisualizerClient.Show(PlayableGraph)` in the code. -- If your `PlayableGraph` is only available in Play mode, you will not be able to see it in Edit mode. - -## Unity compatibility - - Unity version | Release ----------------|-------------- - 2018.1+ | v2.2 (master) - 2017.1+ | v1.1 +See the [Documentation](Documentation~/playablegraph-visualizer.md) for the installation and the usage. From 4b869b1d2c364fbb5493c2d2f78b77e122837afb Mon Sep 17 00:00:00 2001 From: Romain Failliot Date: Thu, 20 Dec 2018 18:23:37 -0500 Subject: [PATCH 14/34] [package] Add meta files --- CHANGELOG.md.meta | 7 +++++++ Editor/Unity.PlayableGraphVisualizer.Editor.asmdef.meta | 7 +++++++ Runtime/Unity.PlayableGraphVisualizer.asmdef.meta | 7 +++++++ package.json.meta | 7 +++++++ 4 files changed, 28 insertions(+) create mode 100644 CHANGELOG.md.meta create mode 100644 Editor/Unity.PlayableGraphVisualizer.Editor.asmdef.meta create mode 100644 Runtime/Unity.PlayableGraphVisualizer.asmdef.meta create mode 100644 package.json.meta diff --git a/CHANGELOG.md.meta b/CHANGELOG.md.meta new file mode 100644 index 0000000..c0f3f3b --- /dev/null +++ b/CHANGELOG.md.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 082393007b3cfe547958d9d6f7abffd2 +TextScriptImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Editor/Unity.PlayableGraphVisualizer.Editor.asmdef.meta b/Editor/Unity.PlayableGraphVisualizer.Editor.asmdef.meta new file mode 100644 index 0000000..f82943b --- /dev/null +++ b/Editor/Unity.PlayableGraphVisualizer.Editor.asmdef.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 2702b94ed25b25fdda2226e5c974e9e8 +AssemblyDefinitionImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Runtime/Unity.PlayableGraphVisualizer.asmdef.meta b/Runtime/Unity.PlayableGraphVisualizer.asmdef.meta new file mode 100644 index 0000000..ac7bff7 --- /dev/null +++ b/Runtime/Unity.PlayableGraphVisualizer.asmdef.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: d8e7b33ba1e4a89fc8a64b6b1e97a6ac +AssemblyDefinitionImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/package.json.meta b/package.json.meta new file mode 100644 index 0000000..fcbae93 --- /dev/null +++ b/package.json.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 739bdc2aae9cc990f962d6c12c1f1558 +PackageManifestImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: From 50c8a39077991fc833f9fa3762f2c33c0a6ef91c Mon Sep 17 00:00:00 2001 From: Romain Failliot Date: Fri, 21 Dec 2018 12:41:36 -0500 Subject: [PATCH 15/34] [package] Add .gitignore file --- .gitignore | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 .gitignore diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..7063fea --- /dev/null +++ b/.gitignore @@ -0,0 +1,11 @@ +artifacts/** +build/** +.build_script/** +node_modules/** +.DS_Store +.npmrc +!Documentation~ +!.Documentation +npm-debug.log +build.sh.meta +build.bat.meta From ba5e8c9c6c1a72a0970fa3650013ade369456dce Mon Sep 17 00:00:00 2001 From: Romain Failliot Date: Fri, 21 Dec 2018 13:33:17 -0500 Subject: [PATCH 16/34] [package] Increase preview version --- .yamato/build.yml | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.yamato/build.yml b/.yamato/build.yml index 6c7fe92..e2d0b0a 100644 --- a/.yamato/build.yml +++ b/.yamato/build.yml @@ -19,7 +19,7 @@ triggers: artifacts: Package.zip: paths: - - "automation/packages/com.unity.playablegraph-visualizer-0.1.0-preview.tgz" + - "automation/packages/com.unity.playablegraph-visualizer-0.1.0-preview.2.tgz" TestResults.zip: paths: - "my-project/automation/test-results/*" diff --git a/package.json b/package.json index 2db81db..8c32d45 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "com.unity.playablegraph-visualizer", "displayName": "PlayableGraph Visualizer", - "version": "0.1.0-preview", + "version": "0.1.0-preview.2", "unity": "2018.1", "description": "The PlayableGraph Visualizer is a tool that displays the PlayableGraphs in the scene. It can be used in both Play and Edit mode and will always reflect the current state of the graph. Playable nodes are represented by colored nodes, varying according to their type. Connections color intensity indicates its weight.", "licence": "MIT", From 8991359914a7cdbd1a11872c40d1e239b1542115 Mon Sep 17 00:00:00 2001 From: Romain Failliot Date: Thu, 10 Jan 2019 15:51:31 -0500 Subject: [PATCH 17/34] [yamato] Change Yamato agent image --- .yamato/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.yamato/build.yml b/.yamato/build.yml index e2d0b0a..da58f55 100644 --- a/.yamato/build.yml +++ b/.yamato/build.yml @@ -1,7 +1,7 @@ name: Build and Test agent: type: Unity::VM - image: sdet/gamecode_win10:v0.1.1-92318 + image: packages/windows:latest flavor: m1.large name: Validate a Package in CI commands: From a6054abfbf0d169424cd0296a0beaf7ebb882494 Mon Sep 17 00:00:00 2001 From: Romain Failliot Date: Thu, 10 Jan 2019 16:35:47 -0500 Subject: [PATCH 18/34] [yamato] Change Yamato artifacts section --- .yamato/build.yml | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/.yamato/build.yml b/.yamato/build.yml index da58f55..cf0c1cf 100644 --- a/.yamato/build.yml +++ b/.yamato/build.yml @@ -19,10 +19,7 @@ triggers: artifacts: Package.zip: paths: - - "automation/packages/com.unity.playablegraph-visualizer-0.1.0-preview.2.tgz" - TestResults.zip: + - "automation/packages/*.tgz" + UTR_Output.zip: paths: - - "my-project/automation/test-results/*" - EditorLogs.zip: - paths: - - "my-project/automation/logs/*" + - "utr_output/**/*" From e06ac4f34dc1fec24d4c225c7f757859a946f6e5 Mon Sep 17 00:00:00 2001 From: Romain Failliot Date: Tue, 22 Jan 2019 19:41:44 -0500 Subject: [PATCH 19/34] [yamato] Update changelog --- CHANGELOG.md | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 57a9f8e..491a1d6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,9 +5,18 @@ All notable changes to this package will be documented in this file. The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html). +## [Unreleased] + +### Changed + +- Updated the Yamato CI configuration + ## [0.1.0] - 2018-12-20 -### First release of Unity package *PlayableGraph Visualizer*. +### Added + +- First release of Unity package *PlayableGraph Visualizer*. +- Mirrored the original [graph-visualizer repository](https://github.com/Unity-Technologies/graph-visualizer) and modified it to fulfill the Unity package requirements. + -Mirrored the original [graph-visualizer repository](https://github.com/Unity-Technologies/graph-visualizer) -and modified it to fulfill the Unity package requirements. +[Unreleased]: https://github.cds.internal.unity3d.com/unity/com.unity.playablegraph-visualizer/compare/v0.1.0...HEAD \ No newline at end of file From 8a0ba034a63b7c07f41617a1e915453fbf5bf61b Mon Sep 17 00:00:00 2001 From: Romain Failliot Date: Tue, 22 Jan 2019 19:58:45 -0500 Subject: [PATCH 20/34] [license] Change license from MIT to UCL For legal reasons, official Unity packages must be under the UCL license. The only contribution made by someone outside of Unity was for a typo in the documentation. --- CHANGELOG.md | 1 + LICENSE | 21 --------------------- LICENSE.md | 5 +++++ LICENSE.meta => LICENSE.md.meta | 0 4 files changed, 6 insertions(+), 21 deletions(-) delete mode 100644 LICENSE create mode 100644 LICENSE.md rename LICENSE.meta => LICENSE.md.meta (100%) diff --git a/CHANGELOG.md b/CHANGELOG.md index 491a1d6..3678959 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. ### Changed - Updated the Yamato CI configuration +- Moved from MIT to UCL license ## [0.1.0] - 2018-12-20 diff --git a/LICENSE b/LICENSE deleted file mode 100644 index 9de2c6f..0000000 --- a/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2016-2018 Unity Technologies - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/LICENSE.md b/LICENSE.md new file mode 100644 index 0000000..fb1abc8 --- /dev/null +++ b/LICENSE.md @@ -0,0 +1,5 @@ +PlayableGraph Visualizer copyright © 2019 Unity Technologies ApS + +Licensed under the Unity Companion License for Unity-dependent projects -- see [Unity Companion License](http://www.unity3d.com/legal/licenses/Unity_Companion_License). + +Unless expressly provided otherwise, the Software under this license is made available strictly on an “AS IS” BASIS WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED. Please review the license for details on these and other terms and conditions. diff --git a/LICENSE.meta b/LICENSE.md.meta similarity index 100% rename from LICENSE.meta rename to LICENSE.md.meta From 8cc5f1a95a6be67e086099c7a67c37a2748f5f70 Mon Sep 17 00:00:00 2001 From: Romain Failliot Date: Tue, 22 Jan 2019 19:47:43 -0500 Subject: [PATCH 21/34] [editor] Move menu entry under Analysis --- Editor/PlayableGraphVisualizerWindow.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Editor/PlayableGraphVisualizerWindow.cs b/Editor/PlayableGraphVisualizerWindow.cs index 3bb9822..a68d693 100644 --- a/Editor/PlayableGraphVisualizerWindow.cs +++ b/Editor/PlayableGraphVisualizerWindow.cs @@ -32,7 +32,7 @@ private PlayableGraphVisualizerWindow() m_GraphSettings.showLegend = true; } - [MenuItem("Window/PlayableGraph Visualizer")] + [MenuItem("Window/Analysis/PlayableGraph Visualizer")] public static void ShowWindow() { GetWindow("PlayableGraph Visualizer"); From fc96a949df3b27e536f34677b695ef04fde57779 Mon Sep 17 00:00:00 2001 From: Romain Failliot Date: Tue, 22 Jan 2019 21:04:57 -0500 Subject: [PATCH 22/34] [doc] Change menu entry in documentation --- Documentation~/playablegraph-visualizer.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Documentation~/playablegraph-visualizer.md b/Documentation~/playablegraph-visualizer.md index da50f0f..1711495 100644 --- a/Documentation~/playablegraph-visualizer.md +++ b/Documentation~/playablegraph-visualizer.md @@ -10,7 +10,7 @@ To install this package, follow the instructions in the # Using PlayableGraph Visualizer -- Open the PlayableGraph Visualizer in **Window > PlayableGraph Visualizer** +- Open the PlayableGraph Visualizer in **Window > Analysis > PlayableGraph Visualizer** - Open any scene that contains at least one `PlayableGraph` - In the top-left list, select the `PlayableGraph` to display in the window - Click on the nodes to display more information about the associated Playable handle From 695bbbda5c6150c776c9f1a18a43989fe15f22e7 Mon Sep 17 00:00:00 2001 From: Romain Failliot Date: Tue, 22 Jan 2019 21:05:24 -0500 Subject: [PATCH 23/34] [changelog] Update changelog --- CHANGELOG.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3678959..a9c4689 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. - Updated the Yamato CI configuration - Moved from MIT to UCL license +- Moved menu entry under Window > Analysis ## [0.1.0] - 2018-12-20 @@ -20,4 +21,4 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. - Mirrored the original [graph-visualizer repository](https://github.com/Unity-Technologies/graph-visualizer) and modified it to fulfill the Unity package requirements. -[Unreleased]: https://github.cds.internal.unity3d.com/unity/com.unity.playablegraph-visualizer/compare/v0.1.0...HEAD \ No newline at end of file +[Unreleased]: https://github.cds.internal.unity3d.com/unity/com.unity.playablegraph-visualizer/compare/v0.1.0...HEAD From e808dcb0abdb27e29a9a1c78747416a732ccfc35 Mon Sep 17 00:00:00 2001 From: Romain Failliot Date: Thu, 24 Jan 2019 10:16:57 -0500 Subject: [PATCH 24/34] [yamato] New templated config --- .yamato/build.yml | 85 +++++++++++++++++++++++++++++++++-------------- 1 file changed, 60 insertions(+), 25 deletions(-) diff --git a/.yamato/build.yml b/.yamato/build.yml index cf0c1cf..c80ef5b 100644 --- a/.yamato/build.yml +++ b/.yamato/build.yml @@ -1,25 +1,60 @@ -name: Build and Test -agent: - type: Unity::VM - image: packages/windows:latest - flavor: m1.large - name: Validate a Package in CI -commands: - - npm install upm-ci-utils -g --registry https://api.bintray.com/npm/unity/unity-npm - # Add your custom build commands here - - upm-ci package pack --package-path . - - upm-ci package test --editor-revision 445af4d85bb46baa615b469ca3cca83ec8892e78 --package-path . -triggers: - branches: - only: - - master - tags: - only: - - /(p|P)ublish/ -artifacts: - Package.zip: - paths: - - "automation/packages/*.tgz" - UTR_Output.zip: - paths: - - "utr_output/**/*" +editors: + - version: 2019.1 +platforms: + - name: win + type: Unity::VM + image: package-ci/win10:latest + flavor: m1.large + - name: mac + type: Unity::VM::osx + image: buildfarm/mac:stable + flavor: m1.mac +--- +{% for editor in editors %} +{% for platform in platforms %} +{{ platform.name }}_{{ editor.version }}: + name : Build and Test version {{ editor.version }} on {{ platform.name }} + agent: + type: {{ platform.type }} + image: {{ platform.image }} + flavor: {{ platform.flavor}} + commands: + - npm install upm-ci-utils -g --registry https://api.bintray.com/npm/unity/unity-npm + - upm-ci package pack + - upm-ci package test --unity-version {{ editor.version }} + triggers: + branches: + only: + - master + artifacts: + UTR_Output.zip: + paths: + - "utr_output/**/*" +{% endfor %} +{% endfor %} + +run_preview_verified_staging: + name: Preview and Verified Packages to Staging + agent: + type: Unity::VM + image: package-ci/win10:latest + flavor: m1.large + name: Runner + commands: + - npm install upm-ci-utils -g --registry https://api.bintray.com/npm/unity/unity-npm + - upm-ci package pack + - upm-ci package publish --registry staging + triggers: + tags: + only: + - /^(v|V)[0-9].[0-9].[0-9]/ + artifacts: + Package.zip: + paths: + - "automation/package/*.tgz" + dependencies: + {% for editor in editors %} + {% for platform in platforms %} + - .yamato/build.yml#{{ platform.name }}_{{ editor.version }} + {% endfor %} + {% endfor %} From eab44c5026e46e98a680666629ac1904fd4a587c Mon Sep 17 00:00:00 2001 From: Romain Failliot Date: Fri, 25 Jan 2019 14:37:10 -0500 Subject: [PATCH 25/34] [release] Bump version to v0.2.0 --- CHANGELOG.md | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a9c4689..d217d94 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,7 +5,7 @@ All notable changes to this package will be documented in this file. The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html). -## [Unreleased] +## [0.2.0] - 2019-01-25 ### Changed diff --git a/package.json b/package.json index 8c32d45..414098e 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "com.unity.playablegraph-visualizer", "displayName": "PlayableGraph Visualizer", - "version": "0.1.0-preview.2", + "version": "0.2.0-preview", "unity": "2018.1", "description": "The PlayableGraph Visualizer is a tool that displays the PlayableGraphs in the scene. It can be used in both Play and Edit mode and will always reflect the current state of the graph. Playable nodes are represented by colored nodes, varying according to their type. Connections color intensity indicates its weight.", "licence": "MIT", From a4c6d94cf8804e36bd90c27deeaea640d7d09794 Mon Sep 17 00:00:00 2001 From: Romain Failliot Date: Wed, 30 Jan 2019 09:14:26 -0500 Subject: [PATCH 26/34] [release] Bump version to v0.2.0-preview.2 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 414098e..8f82e87 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "com.unity.playablegraph-visualizer", "displayName": "PlayableGraph Visualizer", - "version": "0.2.0-preview", + "version": "0.2.0-preview.2", "unity": "2018.1", "description": "The PlayableGraph Visualizer is a tool that displays the PlayableGraphs in the scene. It can be used in both Play and Edit mode and will always reflect the current state of the graph. Playable nodes are represented by colored nodes, varying according to their type. Connections color intensity indicates its weight.", "licence": "MIT", From 59bf8eec0793903ef6b5126242d49225914c53b6 Mon Sep 17 00:00:00 2001 From: Amir Ebrahimi Date: Mon, 11 Feb 2019 12:09:45 -0800 Subject: [PATCH 27/34] Allow showing of the inspector and legend separately; Add a nodeClicked event --- Editor/Graph/Renderer/DefaultGraphRenderer.cs | 152 +++++++++++------- Editor/Graph/Renderer/IGraphRenderer.cs | 5 +- 2 files changed, 94 insertions(+), 63 deletions(-) diff --git a/Editor/Graph/Renderer/DefaultGraphRenderer.cs b/Editor/Graph/Renderer/DefaultGraphRenderer.cs index e8f808f..d2aac38 100644 --- a/Editor/Graph/Renderer/DefaultGraphRenderer.cs +++ b/Editor/Graph/Renderer/DefaultGraphRenderer.cs @@ -2,13 +2,14 @@ using System.Collections.Generic; using System.Linq; using System.Text.RegularExpressions; -using UnityEngine; using UnityEditor; +using UnityEngine; namespace GraphVisualizer { public class DefaultGraphRenderer : IGraphRenderer { + public event Action nodeClicked; private static readonly Color s_EdgeColorMin = new Color(1.0f, 1.0f, 1.0f, 0.1f); private static readonly Color s_EdgeColorMax = Color.white; private static readonly Color s_LegendBackground = new Color(0, 0, 0, 0.1f); @@ -36,6 +37,7 @@ public class DefaultGraphRenderer : IGraphRenderer private Node m_SelectedNode; private Texture2D m_ColorBar; + Vector2 m_ScrollPos; private struct NodeTypeLegend { @@ -48,12 +50,18 @@ public DefaultGraphRenderer() InitializeStyles(); } + public void Reset() + { + m_SelectedNode = null; + } + public void Draw(IGraphLayout graphLayout, Rect drawingArea) { GraphSettings defaults; defaults.maximumNormalizedNodeSize = s_DefaultMaximumNormalizedNodeSize; defaults.maximumNodeSizeInPixels = s_DefaultMaximumNodeSizeInPixels; defaults.aspectRatio = s_DefaultAspectRatio; + defaults.showInspector = true; defaults.showLegend = true; Draw(graphLayout, drawingArea, defaults); } @@ -63,19 +71,19 @@ public void Draw(IGraphLayout graphLayout, Rect totalDrawingArea, GraphSettings var legendArea = new Rect(); var drawingArea = new Rect(totalDrawingArea); - if (graphSettings.showLegend) - { - PrepareLegend(graphLayout.vertices); + PrepareLegend(graphLayout.vertices); + if (graphSettings.showLegend || graphSettings.showInspector || m_SelectedNode != null) + { legendArea = new Rect(totalDrawingArea) { - width = EstimateLegendWidth() + s_BorderSize * 2 + width = Mathf.Max(EstimateLegendWidth(), drawingArea.width * 0.25f) + s_BorderSize * 2 }; legendArea.x = drawingArea.xMax - legendArea.width; - drawingArea.width -= legendArea.width;// + s_BorderSize; + drawingArea.width -= legendArea.width; // + s_BorderSize; - DrawLegend(legendArea); + DrawLegend(graphSettings, legendArea); } if (m_SelectedNode != null) @@ -87,6 +95,9 @@ public void Draw(IGraphLayout graphLayout, Rect totalDrawingArea, GraphSettings if (drawingArea.Contains(mousePos)) { m_SelectedNode = null; + + if (nodeClicked != null) + nodeClicked(m_SelectedNode); } } } @@ -98,22 +109,21 @@ private void InitializeStyles() { m_LegendLabelStyle = new GUIStyle(GUI.skin.label) { - margin = {top = 0}, - alignment = TextAnchor.UpperLeft + margin = { top = 0 }, + alignment = TextAnchor.UpperLeft }; m_NodeRectStyle = new GUIStyle { normal = { - background = (Texture2D) Resources.Load("Node"), + background = (Texture2D)Resources.Load("Node"), textColor = Color.black, }, - border = new RectOffset(10, 10, 10, 10), - alignment = TextAnchor.MiddleCenter, - wordWrap = true, - clipping = TextClipping.Clip - + border = new RectOffset(10, 10, 10, 10), + alignment = TextAnchor.MiddleCenter, + wordWrap = true, + clipping = TextClipping.Clip }; m_SubTitleStyle = EditorStyles.boldLabel; @@ -124,11 +134,10 @@ private void InitializeStyles() { textColor = Color.white, }, - richText = true, - alignment = TextAnchor.MiddleLeft, - wordWrap = true, - clipping = TextClipping.Clip - + richText = true, + alignment = TextAnchor.MiddleLeft, + wordWrap = true, + clipping = TextClipping.Clip }; } @@ -148,7 +157,7 @@ private void PrepareLegend(IEnumerable vertices) m_LegendForType[nodeType] = new NodeTypeLegend { label = v.node.GetContentTypeShortName(), - color = v.node.GetColor() + color = v.node.GetColor() }; } } @@ -160,6 +169,7 @@ private float EstimateLegendWidth() { legendWidth = Mathf.Max(legendWidth, GUI.skin.label.CalcSize(new GUIContent(legend.label)).x); } + legendWidth += s_LegendFixedOverheadWidth; return legendWidth; } @@ -172,17 +182,16 @@ public void DrawRect(Rect rect, Color color, string text, bool active, bool sele { GUI.color = s_SelectedNodeColor; float t = s_SelectedNodeThickness + (active ? s_ActiveNodeThickness : 0.0f); - GUI.Box(new Rect(rect.x - t, rect.y - t, - rect.width + 2 * t, rect.height + 2 * t), - string.Empty, m_NodeRectStyle); + GUI.Box(new Rect(rect.x - t, rect.y - t, rect.width + 2 * t, rect.height + 2 * t), + string.Empty, m_NodeRectStyle); } if (active) { GUI.color = s_ActiveNodeColor; GUI.Box(new Rect(rect.x - s_ActiveNodeThickness, rect.y - s_ActiveNodeThickness, - rect.width + 2 * s_ActiveNodeThickness, rect.height + 2 * s_ActiveNodeThickness), - string.Empty, m_NodeRectStyle); + rect.width + 2 * s_ActiveNodeThickness, rect.height + 2 * s_ActiveNodeThickness), + string.Empty, m_NodeRectStyle); } // Body + Text @@ -193,7 +202,7 @@ public void DrawRect(Rect rect, Color color, string text, bool active, bool sele GUI.color = originalColor; } - private void DrawLegend(Rect legendArea) + private void DrawLegend(GraphSettings graphSettings, Rect legendArea) { EditorGUI.DrawRect(legendArea, s_LegendBackground); @@ -206,40 +215,50 @@ private void DrawLegend(Rect legendArea) GUILayout.BeginArea(legendArea); GUILayout.BeginVertical(); - GUILayout.Label("Inspector", m_SubTitleStyle); - - if (m_SelectedNode != null) + if (graphSettings.showInspector || m_SelectedNode != null) { - GUILayout.Label(m_SelectedNode.ToString(), m_InspectorStyle); - } - else - { - GUILayout.Label("Click on a node\nto display its details."); + GUILayout.Label("Inspector", m_SubTitleStyle); + + if (m_SelectedNode != null) + { + using (var scrollView = new EditorGUILayout.ScrollViewScope(m_ScrollPos)) + { + m_ScrollPos = scrollView.scrollPosition; + GUILayout.Label(m_SelectedNode.ToString(), m_InspectorStyle); + } + } + else + { + GUILayout.Label("Click on a node\nto display its details."); + } } GUILayout.FlexibleSpace(); - GUILayout.Label("Legend", m_SubTitleStyle); - - foreach (var pair in m_LegendForType) + if (graphSettings.showLegend) { - DrawLegendEntry(pair.Value.color, pair.Value.label, false); - } + GUILayout.Label("Legend", m_SubTitleStyle); - DrawLegendEntry(Color.gray, "Playing", true); + foreach (var pair in m_LegendForType) + { + DrawLegendEntry(pair.Value.color, pair.Value.label, false); + } - GUILayout.Space(20); + DrawLegendEntry(Color.gray, "Playing", true); - GUILayout.Label("Edge weight", m_SubTitleStyle); - GUILayout.BeginHorizontal(); - GUILayout.Label("0"); - GUILayout.FlexibleSpace(); - GUILayout.Label("1"); - GUILayout.EndHorizontal(); + GUILayout.Space(20); - DrawEdgeWeightColorBar(legendArea.width); + GUILayout.Label("Edge weight", m_SubTitleStyle); + GUILayout.BeginHorizontal(); + GUILayout.Label("0"); + GUILayout.FlexibleSpace(); + GUILayout.Label("1"); + GUILayout.EndHorizontal(); - GUILayout.Space(20); + DrawEdgeWeightColorBar(legendArea.width); + + GUILayout.Space(20); + } GUILayout.EndVertical(); GUILayout.EndArea(); @@ -272,7 +291,7 @@ private void DrawEdgeWeightColorBar(float width) var cols = m_ColorBar.GetPixels(); for (int x = 0; x < nbLevels; x++) { - Color c = Color.Lerp(s_EdgeColorMin, s_EdgeColorMax, (float) x / nbLevels); + Color c = Color.Lerp(s_EdgeColorMin, s_EdgeColorMax, (float)x / nbLevels); cols[x] = c; } @@ -289,9 +308,9 @@ private void DrawGraph(IGraphLayout graphLayout, Rect drawingArea, GraphSettings { // add border, except on right-hand side where the legend will provide necessary padding drawingArea = new Rect(drawingArea.x + s_BorderSize, - drawingArea.y + s_BorderSize, - drawingArea.width - s_BorderSize * 2, - drawingArea.height - s_BorderSize * 2); + drawingArea.y + s_BorderSize, + drawingArea.width - s_BorderSize * 2, + drawingArea.height - s_BorderSize * 2); var b = new Bounds(Vector3.zero, Vector3.zero); foreach (Vertex v in graphLayout.vertices) @@ -362,6 +381,9 @@ private void DrawGraph(IGraphLayout graphLayout, Rect drawingArea, GraphSettings if (newSelectedNode != null) { m_SelectedNode = newSelectedNode; + + if (nodeClicked != null) + nodeClicked(m_SelectedNode); } else if (!oldSelectionFound) { @@ -376,7 +398,7 @@ private static Vector2 ComputeNodeSize(Vector2 scale, GraphSettings graphSetting { var extraTickness = (s_SelectedNodeThickness + s_ActiveNodeThickness) * 2.0f; var nodeSize = new Vector2(graphSettings.maximumNormalizedNodeSize * scale.x - extraTickness, - graphSettings.maximumNormalizedNodeSize * scale.y - extraTickness); + graphSettings.maximumNormalizedNodeSize * scale.y - extraTickness); // Adjust aspect ratio after scaling float currentAspectRatio = nodeSize.x / nodeSize.y; @@ -402,6 +424,7 @@ private static Vector2 ComputeNodeSize(Vector2 scale, GraphSettings graphSetting { nodeSize *= graphSettings.maximumNodeSizeInPixels / nodeSize.y; } + return nodeSize; } @@ -415,8 +438,8 @@ private static int ComputeFontSize(Vector2 nodeSize, string text) int longuestWord = words.Max(s => s.Length); // Approximate the text rectangle size using magic values. - int width = longuestWord * (int) (0.8f * s_NodeMaxFontSize); - int height = nbLignes * (int) (1.5f * s_NodeMaxFontSize); + int width = longuestWord * (int)(0.8f * s_NodeMaxFontSize); + int height = nbLignes * (int)(1.5f * s_NodeMaxFontSize); float factor = Math.Min(nodeSize.x / width, nodeSize.y / height); @@ -436,15 +459,15 @@ private void DrawNode(Rect nodeRect, Node node, bool selected) { string nodeType = node.GetContentTypeName(); NodeTypeLegend nodeTypeLegend = m_LegendForType[nodeType]; - string formatedLabel = Regex.Replace(nodeTypeLegend.label, "(\\B[A-Z])", "\n$1"); // Split into multi-lines + string formattedLabel = Regex.Replace(nodeTypeLegend.label, "((? Date: Tue, 5 Mar 2019 15:34:51 -0800 Subject: [PATCH 28/34] Remove auto-toggle --- Editor/Graph/Renderer/DefaultGraphRenderer.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Editor/Graph/Renderer/DefaultGraphRenderer.cs b/Editor/Graph/Renderer/DefaultGraphRenderer.cs index d2aac38..9cba59b 100644 --- a/Editor/Graph/Renderer/DefaultGraphRenderer.cs +++ b/Editor/Graph/Renderer/DefaultGraphRenderer.cs @@ -73,7 +73,7 @@ public void Draw(IGraphLayout graphLayout, Rect totalDrawingArea, GraphSettings PrepareLegend(graphLayout.vertices); - if (graphSettings.showLegend || graphSettings.showInspector || m_SelectedNode != null) + if (graphSettings.showLegend || graphSettings.showInspector) { legendArea = new Rect(totalDrawingArea) { From b8c14ac9201361b1d75bd06fc3a10b5b9c10b21f Mon Sep 17 00:00:00 2001 From: Amir Ebrahimi Date: Tue, 5 Mar 2019 15:48:38 -0800 Subject: [PATCH 29/34] Mark nodeClicked event as protected (requires creating a derived class) --- Editor/Graph/Renderer/DefaultGraphRenderer.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Editor/Graph/Renderer/DefaultGraphRenderer.cs b/Editor/Graph/Renderer/DefaultGraphRenderer.cs index 9cba59b..3b9e422 100644 --- a/Editor/Graph/Renderer/DefaultGraphRenderer.cs +++ b/Editor/Graph/Renderer/DefaultGraphRenderer.cs @@ -9,7 +9,7 @@ namespace GraphVisualizer { public class DefaultGraphRenderer : IGraphRenderer { - public event Action nodeClicked; + protected event Action nodeClicked; private static readonly Color s_EdgeColorMin = new Color(1.0f, 1.0f, 1.0f, 0.1f); private static readonly Color s_EdgeColorMax = Color.white; private static readonly Color s_LegendBackground = new Color(0, 0, 0, 0.1f); From 1cf12cc88b4eee6a902ba813449f6b458791ef77 Mon Sep 17 00:00:00 2001 From: Romain Failliot Date: Tue, 5 Mar 2019 20:38:17 -0500 Subject: [PATCH 30/34] [inspector] Only toggle inspector when inspector is changed in the menu The legend menu item only shows/hides the legend in the inspector. --- Editor/Graph/Renderer/DefaultGraphRenderer.cs | 4 ++-- Editor/PlayableGraphVisualizerWindow.cs | 7 +++++++ 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/Editor/Graph/Renderer/DefaultGraphRenderer.cs b/Editor/Graph/Renderer/DefaultGraphRenderer.cs index 3b9e422..4951f2b 100644 --- a/Editor/Graph/Renderer/DefaultGraphRenderer.cs +++ b/Editor/Graph/Renderer/DefaultGraphRenderer.cs @@ -73,7 +73,7 @@ public void Draw(IGraphLayout graphLayout, Rect totalDrawingArea, GraphSettings PrepareLegend(graphLayout.vertices); - if (graphSettings.showLegend || graphSettings.showInspector) + if (graphSettings.showInspector) { legendArea = new Rect(totalDrawingArea) { @@ -215,7 +215,7 @@ private void DrawLegend(GraphSettings graphSettings, Rect legendArea) GUILayout.BeginArea(legendArea); GUILayout.BeginVertical(); - if (graphSettings.showInspector || m_SelectedNode != null) + if (graphSettings.showInspector) { GUILayout.Label("Inspector", m_SubTitleStyle); diff --git a/Editor/PlayableGraphVisualizerWindow.cs b/Editor/PlayableGraphVisualizerWindow.cs index a68d693..c9c3560 100644 --- a/Editor/PlayableGraphVisualizerWindow.cs +++ b/Editor/PlayableGraphVisualizerWindow.cs @@ -29,6 +29,7 @@ private PlayableGraphVisualizerWindow() m_GraphSettings.maximumNormalizedNodeSize = s_DefaultMaximumNormalizedNodeSize; m_GraphSettings.maximumNodeSizeInPixels = s_DefaultMaximumNodeSizeInPixels; m_GraphSettings.aspectRatio = s_DefaultAspectRatio; + m_GraphSettings.showInspector = true; m_GraphSettings.showLegend = true; } @@ -179,9 +180,15 @@ private List GetGraphList() public virtual void AddItemsToMenu(GenericMenu menu) { + menu.AddItem(new GUIContent("Inspector"), m_GraphSettings.showInspector, ToggleInspector); menu.AddItem(new GUIContent("Legend"), m_GraphSettings.showLegend, ToggleLegend); } + void ToggleInspector() + { + m_GraphSettings.showInspector = !m_GraphSettings.showInspector; + } + void ToggleLegend() { m_GraphSettings.showLegend = !m_GraphSettings.showLegend; From 542f3507b86dd119080b3e184ed88576d5fd39db Mon Sep 17 00:00:00 2001 From: Romain Failliot Date: Wed, 6 Mar 2019 20:22:15 -0500 Subject: [PATCH 31/34] [package] Bump version, update changelog and yamato config --- .yamato/build.yml | 12 ++++++------ CHANGELOG.md | 10 ++++++++++ package.json | 2 +- 3 files changed, 17 insertions(+), 7 deletions(-) diff --git a/.yamato/build.yml b/.yamato/build.yml index c80ef5b..a0704f7 100644 --- a/.yamato/build.yml +++ b/.yamato/build.yml @@ -27,9 +27,9 @@ platforms: only: - master artifacts: - UTR_Output.zip: + logs.zip: paths: - - "utr_output/**/*" + - "upm-ci~/test-results/**/*" {% endfor %} {% endfor %} @@ -43,15 +43,15 @@ run_preview_verified_staging: commands: - npm install upm-ci-utils -g --registry https://api.bintray.com/npm/unity/unity-npm - upm-ci package pack - - upm-ci package publish --registry staging + - upm-ci package publish triggers: tags: only: - - /^(v|V)[0-9].[0-9].[0-9]/ + - /^[vV][0-9]+.[0-9]+.[0-9]+/ artifacts: - Package.zip: + artifacts.zip: paths: - - "automation/package/*.tgz" + - "upm-ci~/packages/*.tgz" dependencies: {% for editor in editors %} {% for platform in platforms %} diff --git a/CHANGELOG.md b/CHANGELOG.md index d217d94..1abe47d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,16 @@ All notable changes to this package will be documented in this file. The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html). +## [0.2.1] - 2019-02-06 + +### Added + +- It is possible to hide the legend within the inspector through the window menu + +### Changed + +- Update Yamato config file + ## [0.2.0] - 2019-01-25 ### Changed diff --git a/package.json b/package.json index 8f82e87..a115cef 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "com.unity.playablegraph-visualizer", "displayName": "PlayableGraph Visualizer", - "version": "0.2.0-preview.2", + "version": "0.2.1-preview", "unity": "2018.1", "description": "The PlayableGraph Visualizer is a tool that displays the PlayableGraphs in the scene. It can be used in both Play and Edit mode and will always reflect the current state of the graph. Playable nodes are represented by colored nodes, varying according to their type. Connections color intensity indicates its weight.", "licence": "MIT", From 3d748f156aea7551ffa079bdac51ed6d57243c90 Mon Sep 17 00:00:00 2001 From: Romain Failliot Date: Thu, 7 Mar 2019 07:58:41 -0500 Subject: [PATCH 32/34] [client] Add ClearGraphs API --- Runtime/GraphVisualizerClient.cs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Runtime/GraphVisualizerClient.cs b/Runtime/GraphVisualizerClient.cs index ea376ff..728f26e 100644 --- a/Runtime/GraphVisualizerClient.cs +++ b/Runtime/GraphVisualizerClient.cs @@ -39,6 +39,11 @@ public static void Hide(PlayableGraph graph) } } + public static void ClearGraphs() + { + instance.m_Graphs.Clear(); + } + public static IEnumerable GetGraphs() { return instance.m_Graphs; From 212e141edb3b2db4afdfd6e9228b37b0e5784501 Mon Sep 17 00:00:00 2001 From: Romain Failliot Date: Thu, 7 Mar 2019 06:48:45 -0500 Subject: [PATCH 33/34] [tests] Add editor test with example tests for now --- Tests.meta | 8 ++ Tests/Runtime.meta | 8 ++ Tests/Runtime/GraphVisualizerClientTests.cs | 101 ++++++++++++++++++ .../GraphVisualizerClientTests.cs.meta | 11 ++ ...Unity.PlayableGraphVisualizer.Tests.asmdef | 11 ++ ....PlayableGraphVisualizer.Tests.asmdef.meta | 7 ++ 6 files changed, 146 insertions(+) create mode 100644 Tests.meta create mode 100644 Tests/Runtime.meta create mode 100644 Tests/Runtime/GraphVisualizerClientTests.cs create mode 100644 Tests/Runtime/GraphVisualizerClientTests.cs.meta create mode 100644 Tests/Runtime/Unity.PlayableGraphVisualizer.Tests.asmdef create mode 100644 Tests/Runtime/Unity.PlayableGraphVisualizer.Tests.asmdef.meta diff --git a/Tests.meta b/Tests.meta new file mode 100644 index 0000000..b7a0598 --- /dev/null +++ b/Tests.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: db91a525414eed845a7f8efa1070a218 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Tests/Runtime.meta b/Tests/Runtime.meta new file mode 100644 index 0000000..d4fef93 --- /dev/null +++ b/Tests/Runtime.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: e4c186e2d570110b48de95a1c5fecc03 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Tests/Runtime/GraphVisualizerClientTests.cs b/Tests/Runtime/GraphVisualizerClientTests.cs new file mode 100644 index 0000000..bd169af --- /dev/null +++ b/Tests/Runtime/GraphVisualizerClientTests.cs @@ -0,0 +1,101 @@ +using NUnit.Framework; +using System.Linq; +using UnityEngine.Playables; + +class GraphVisualizerClientTest +{ + [TearDown] + public void TearDown() + { + // Clear graphs between tests, otherwise graphs are still referenced across tests. + GraphVisualizerClient.ClearGraphs(); + } + + private static PlayableGraph CreatePlayableGraph(string name) + { + var graph = PlayableGraph.Create(name); + ScriptPlayableOutput.Create(graph, "output"); + return graph; + } + + [Test] + public void CanShowGraph() + { + var graph1 = CreatePlayableGraph("test1"); + var graph2 = CreatePlayableGraph("test2"); + + GraphVisualizerClient.Show(graph1); + var graphs = GraphVisualizerClient.GetGraphs().ToArray(); + + Assert.That(graphs.Length, Is.EqualTo(1)); + Assert.That(graphs[0].GetEditorName(), Is.EqualTo(graph1.GetEditorName())); + + GraphVisualizerClient.Show(graph2); + graphs = GraphVisualizerClient.GetGraphs().ToArray(); + + Assert.That(graphs.Length, Is.EqualTo(2)); + Assert.That(graphs[0].GetEditorName(), Is.EqualTo(graph1.GetEditorName())); + Assert.That(graphs[1].GetEditorName(), Is.EqualTo(graph2.GetEditorName())); + + graph1.Destroy(); + graph2.Destroy(); + } + + [Test] + public void CannotShowSameGraphTwice() + { + var graph1 = CreatePlayableGraph("test1"); + + GraphVisualizerClient.Show(graph1); + var graphs = GraphVisualizerClient.GetGraphs().ToArray(); + + Assert.That(graphs.Length, Is.EqualTo(1)); + + graph1.Destroy(); + } + + [Test] + public void CanHideGraph() + { + var graph1 = CreatePlayableGraph("test1"); + var graph2 = CreatePlayableGraph("test2"); + + GraphVisualizerClient.Show(graph1); + GraphVisualizerClient.Show(graph2); + var graphs = GraphVisualizerClient.GetGraphs().ToArray(); + + Assert.That(graphs.Length, Is.EqualTo(2)); + Assert.That(graphs[0].GetEditorName(), Is.EqualTo(graph1.GetEditorName())); + Assert.That(graphs[1].GetEditorName(), Is.EqualTo(graph2.GetEditorName())); + + GraphVisualizerClient.Hide(graph1); + graphs = GraphVisualizerClient.GetGraphs().ToArray(); + + Assert.That(graphs.Length, Is.EqualTo(1)); + Assert.That(graphs[0].GetEditorName(), Is.EqualTo(graph2.GetEditorName())); + + graph1.Destroy(); + graph2.Destroy(); + } + + [Test] + public void CanClearGraphs() + { + var graph1 = CreatePlayableGraph("test1"); + var graph2 = CreatePlayableGraph("test2"); + + GraphVisualizerClient.Show(graph1); + GraphVisualizerClient.Show(graph2); + var graphs = GraphVisualizerClient.GetGraphs().ToArray(); + + Assert.That(graphs.Length, Is.EqualTo(2)); + + GraphVisualizerClient.ClearGraphs(); + graphs = GraphVisualizerClient.GetGraphs().ToArray(); + + Assert.That(graphs.Length, Is.EqualTo(0)); + + graph1.Destroy(); + graph2.Destroy(); + } +} diff --git a/Tests/Runtime/GraphVisualizerClientTests.cs.meta b/Tests/Runtime/GraphVisualizerClientTests.cs.meta new file mode 100644 index 0000000..0037b63 --- /dev/null +++ b/Tests/Runtime/GraphVisualizerClientTests.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 76f082e5010cb366e9639d3b6f99834e +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Tests/Runtime/Unity.PlayableGraphVisualizer.Tests.asmdef b/Tests/Runtime/Unity.PlayableGraphVisualizer.Tests.asmdef new file mode 100644 index 0000000..d4d0460 --- /dev/null +++ b/Tests/Runtime/Unity.PlayableGraphVisualizer.Tests.asmdef @@ -0,0 +1,11 @@ +{ + "name": "Unity.PlayableGraphVisualizer.Tests", + "references": [ + "Unity.PlayableGraphVisualizer" + ], + "optionalUnityReferences": [ + "TestAssemblies" + ], + "includePlatforms": [], + "excludePlatforms": [] +} diff --git a/Tests/Runtime/Unity.PlayableGraphVisualizer.Tests.asmdef.meta b/Tests/Runtime/Unity.PlayableGraphVisualizer.Tests.asmdef.meta new file mode 100644 index 0000000..66eb6c1 --- /dev/null +++ b/Tests/Runtime/Unity.PlayableGraphVisualizer.Tests.asmdef.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 24b367a1e8631110f924a62b35bba83d +AssemblyDefinitionImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: From 246749a4ec9091370cc3a2f797f6dac073bcf174 Mon Sep 17 00:00:00 2001 From: Romain Failliot Date: Thu, 7 Mar 2019 08:01:46 -0500 Subject: [PATCH 34/34] [package] Bump to 0.2.1-preview.3 and update changelog --- CHANGELOG.md | 3 ++- package.json | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1abe47d..7de491c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,11 +5,12 @@ All notable changes to this package will be documented in this file. The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html). -## [0.2.1] - 2019-02-06 +## [0.2.1] - 2019-02-07 ### Added - It is possible to hide the legend within the inspector through the window menu +- Runtime tests ### Changed diff --git a/package.json b/package.json index a115cef..5d1095f 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "com.unity.playablegraph-visualizer", "displayName": "PlayableGraph Visualizer", - "version": "0.2.1-preview", + "version": "0.2.1-preview.3", "unity": "2018.1", "description": "The PlayableGraph Visualizer is a tool that displays the PlayableGraphs in the scene. It can be used in both Play and Edit mode and will always reflect the current state of the graph. Playable nodes are represented by colored nodes, varying according to their type. Connections color intensity indicates its weight.", "licence": "MIT",