From 6da9a4c3b95dec6cb6dfecdf11f46cc8b705eb6a Mon Sep 17 00:00:00 2001 From: Thomas Ingram Date: Sat, 28 Apr 2018 12:02:53 +1000 Subject: [PATCH 1/5] Create LICENSE --- LICENSE | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 LICENSE diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..e8be5f6 --- /dev/null +++ b/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2018 Thomas Ingram + +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. From d3b8b1831609ad29a56e115d45808c3323a76408 Mon Sep 17 00:00:00 2001 From: Thomas Ingram Date: Sun, 7 Apr 2019 09:54:03 +1000 Subject: [PATCH 2/5] Update README.md Updated gifs (I had deleted my wordpress database) --- README.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 86bf4ba..d1daf1f 100644 --- a/README.md +++ b/README.md @@ -11,9 +11,9 @@ Enhanced Texture Previewer for Unity - Matching Filter Mode (default preview is always Point-filtered) - Normal Map Diffuse Preview (Right-Mouse, Right-Mouse+Scroll) -![gif](http://vertx.xyz/wp-content/uploads/2018/04/2dTexturePreview.gif) +![gif](http://vertx.xyz/Images/NTexturePreview/2dTexturePreview2.gif) -![gif](http://vertx.xyz/wp-content/uploads/2018/04/NormalMapPreview2.gif) +![gif](http://vertx.xyz/Images/NTexturePreview/NormalMapPreview2.gif) ### 3D Materials @@ -21,11 +21,11 @@ Enhanced Texture Previewer for Unity - Cube preview (default was sphere) - XYZ Axis Preview Sliders -![gif](http://vertx.xyz/wp-content/uploads/2018/04/3dTexturePreview4.gif) +![gif](http://vertx.xyz/Images/NTexturePreview/3dTexturePreview4.gif) #### Overrides You can override the Material used for the 3D Texture Preview. This is done by inheriting from N3DTexturePreview.I3DMaterialOverride. An example is provided at NTexturePreview/Examples/Custom 3D/Editor/N3DTexturePreviewExample.cs. The file specifically operates on Texture3D assets named "3DTexturePreviewExample", but a method of your own might perform any logic to provide a custom preview material. -![gif](http://vertx.xyz/wp-content/uploads/2018/04/3dTexturePreview2.gif) +![gif](http://vertx.xyz/Images/NTexturePreview/3dTexturePreview2.gif) From 7c7e80da075be5f82747b79de79e90fae4918752 Mon Sep 17 00:00:00 2001 From: Thomas Ingram Date: Sun, 25 Aug 2019 21:52:56 +1000 Subject: [PATCH 3/5] Update README.md --- README.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/README.md b/README.md index b446b37..844cf33 100644 --- a/README.md +++ b/README.md @@ -28,7 +28,7 @@ You can override the Material used for the 3D Texture Preview. This is done by i An example is provided at NTexturePreview/Examples/Custom 3D/Editor/N3DTexturePreviewExample.cs. The file specifically operates on Texture3D assets named "3DTexturePreviewExample", but a method of your own might perform any logic to provide a custom preview material. -![gif](http://vertx.xyz/wp-content/uploads/2018/04/3dTexturePreview2.gif) +![gif](http://vertx.xyz/Images/NTexturePreview/3dTexturePreview2.gif) ## Installation @@ -37,4 +37,3 @@ Ensure your project is on .NET 4.x by navigating to Edit>Project Settings>Player Pull the project locally and use the Package Manager (Window>Package Manager), adding the package.json file present in the root of the folder with the `+` button. Or edit your Package.json file to contain `"com.vertx.ntexturepreview": "https://github.com/vertxxyz/NTexturePreview.git",` -Or edit your Package.json file to contain `"com.vertx.ntexturepreview": "https://github.com/vertxxyz/NTexturePreview.git",` From 2e6fe316919ef92d82f774f8dec0995fb77b733b Mon Sep 17 00:00:00 2001 From: Thomas Ingram Date: Sun, 25 Aug 2019 22:00:19 +1000 Subject: [PATCH 4/5] Fixed project-view previews. --- Editor/N3DTexturePreview.cs | 3 +++ Editor/NTexturePreview.cs | 3 +++ LICENSE.meta | 7 +++++++ 3 files changed, 13 insertions(+) create mode 100644 LICENSE.meta diff --git a/Editor/N3DTexturePreview.cs b/Editor/N3DTexturePreview.cs index 9c5426f..8274562 100644 --- a/Editor/N3DTexturePreview.cs +++ b/Editor/N3DTexturePreview.cs @@ -3,6 +3,7 @@ using System.Reflection; using UnityEditor; using UnityEngine; +using Object = UnityEngine.Object; #if !UNITY_2018_1_OR_NEWER using System.Linq; @@ -89,6 +90,8 @@ protected override void OnDisable() public override void OnInspectorGUI() => defaultEditor.OnInspectorGUI(); + public override Texture2D RenderStaticPreview(string assetPath, Object[] subAssets, int width, int height) => defaultEditor.RenderStaticPreview(assetPath, subAssets, width, height); + private float zoom = 3f; protected float x = 1, y = 1, z = 1; diff --git a/Editor/NTexturePreview.cs b/Editor/NTexturePreview.cs index b035a65..6a0eb7b 100644 --- a/Editor/NTexturePreview.cs +++ b/Editor/NTexturePreview.cs @@ -4,6 +4,7 @@ using UnityEditor.AnimatedValues; using UnityEngine; using UnityEngine.Rendering; +using Object = UnityEngine.Object; namespace Vertx { @@ -103,6 +104,8 @@ protected override void OnDisable() public override void OnInspectorGUI() => defaultEditor.OnInspectorGUI(); + public override Texture2D RenderStaticPreview(string assetPath, Object[] subAssets, int width, int height) => defaultEditor.RenderStaticPreview(assetPath, subAssets, width, height); + public override bool HasPreviewGUI() => target != null; private float zoomLevel; diff --git a/LICENSE.meta b/LICENSE.meta new file mode 100644 index 0000000..3789944 --- /dev/null +++ b/LICENSE.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 2cad18527f2f3224d8d57b915ce0e42b +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: From c14a306144cfbe9de4497353739816b7804e3970 Mon Sep 17 00:00:00 2001 From: Thomas Ingram Date: Mon, 26 Aug 2019 11:09:19 +1000 Subject: [PATCH 5/5] Added missing rendertexture static preview fallback --- Editor/NRenderTexturePreview.cs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Editor/NRenderTexturePreview.cs b/Editor/NRenderTexturePreview.cs index 50a4e03..b40fe46 100644 --- a/Editor/NRenderTexturePreview.cs +++ b/Editor/NRenderTexturePreview.cs @@ -2,6 +2,7 @@ using System.Reflection; using UnityEditor; using UnityEngine; +using Object = UnityEngine.Object; namespace Vertx { @@ -27,5 +28,7 @@ protected override void OnDisable() } public override void OnInspectorGUI() => defaultEditor.OnInspectorGUI(); + + public override Texture2D RenderStaticPreview(string assetPath, Object[] subAssets, int width, int height) => defaultEditor.RenderStaticPreview(assetPath, subAssets, width, height); } } \ No newline at end of file