diff --git a/package/CHANGELOG.md b/package/CHANGELOG.md index 6dd9248c2..14a87162c 100755 --- a/package/CHANGELOG.md +++ b/package/CHANGELOG.md @@ -4,50 +4,24 @@ 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). -## [5.8.2-preview] - 2019-03-14 -### Fixed -- Issue that remove the edge when dragging an edge from slot to the same slot. -- Exception when undoing an edge deletion on a dynamic operator. -- Exception regarding undo/redo when dragging a edge linked to a dynamic operator on another slot. -- Missing graph invalidation in VFXGraph.OnEnable, was causing trouble with value invalidation until next recompilation +## [6.5.2-preview] - 2019-03-11 -## [5.8.1-preview] - 2019-03-13 +## [6.5.1-preview] - 2019-03-08 -## [5.8.0-preview] - 2019-03-13 -### Added -- Addressing mode for Sequential blocks -- Invert transform available on GPU -- Add automatic depth buffer reference for main camera (for position and collision blocks) -- Total Time for PreWarm in Visual Effect Asset inspector -- Support for unlit output with LWRP +## [6.5.0-preview] - 2019-03-07 -### Fixed -- Better Handling of Null or Missing Parameter Binders (Editor + Runtime) -- Undo Redo while changing space -- Type declaration was unmodifiable due to exception during space intialization -- Fix unexpected issue when plugging per particle data into hash of per component fixed random -- Missing asset reimport when exception has been thrown during graph compilation -- Fix exception when using a Oriented Box Volume node [Case 1110419](https://issuetracker.unity3d.com/issues/operator-indexoutofrangeexception-when-using-a-volume-oriented-box-node) -- Add missing blend value slot in Inherit Source Attribute blocks [Case 1120568](https://issuetracker.unity3d.com/issues/source-attribute-blend-source-attribute-blocks-are-not-useful-without-the-blend-value) -- Visual Effect Inspector Cosmetic Improvements -- Exception while removing a sub-slot of a dynamic operator +## [6.4.0-preview] - 2019-02-21 -## [5.7.0-preview] - 2019-03-07 +## [6.3.0-preview] - 2019-02-18 -## [5.6.0-preview] - 2019-02-21 +## [6.2.0-preview] - 2019-02-15 -## [5.5.0-preview] - 2019-02-18 ### Changed -- Code refactor: all macros with ARGS have been swapped with macros with PARAM. This is because the ARGS macros were incorrectly named +- Code refactor: all macros with ARGS have been swapped with macros with PARAM. This is because the ARGS macros were incorrectly named. -## [5.4.0-preview] - 2019-02-11 -### Fixed -- Incorrect toggle rectangle in VisualEffect inspector -- Shader compilation with SimpleLit and debug display - -## [5.3.1-preview] - 2019-01-28 +## [6.1.0-preview] - 2019-02-13 -## [5.3.0-preview] - 2019-01-28 +## [6.0.0-preview] - 2019-02-23 ### Added - Add spawnTime & spawnCount operator - Add seed slot to constant random mode of Attribute from curve and map @@ -68,6 +42,8 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. - Fix fog on decals - Saturate alpha component in outputs - Fixed scaleY in ConnectTarget +- Incorrect toggle rectangle in VisualEffect inspector +- Shader compilation with SimpleLit and debug display ## [5.2.0-preview] - 2018-11-27 ### Added diff --git a/package/Documentation~/index.md b/package/Documentation~/index.md index ce57f9966..327f362d5 100755 --- a/package/Documentation~/index.md +++ b/package/Documentation~/index.md @@ -35,7 +35,7 @@ Make sure your project is already configured with HD Render Pipeline before proc ## Getting Started -To get started right away with Visual Effect Graph, you can visit [this page](Visual-Effect-Graph-Getting-Started) that sums up most of the features you need to know about. +To get started right away with Visual Effect Graph, you can visit [this page](Getting-Started) that sums up most of the features you need to know about. ## Documentation diff --git a/package/Editor/Compiler/VFXGraphCompiledData.cs b/package/Editor/Compiler/VFXGraphCompiledData.cs index ec37ae441..dd2e154ab 100755 --- a/package/Editor/Compiler/VFXGraphCompiledData.cs +++ b/package/Editor/Compiler/VFXGraphCompiledData.cs @@ -608,11 +608,11 @@ public void Compile(VFXCompilationMode compilationMode, bool forceShaderValidati } Profiler.BeginSample("VFXEditor.CompileAsset"); - float nbSteps = 12.0f; - string assetPath = AssetDatabase.GetAssetPath(visualEffectResource); - string progressBarTitle = "Compiling " + assetPath; try { + float nbSteps = 12.0f; + string assetPath = AssetDatabase.GetAssetPath(visualEffectResource); + string progressBarTitle = "Compiling " + assetPath; EditorUtility.DisplayProgressBar(progressBarTitle, "Collecting dependencies", 0 / nbSteps); var models = new HashSet(); @@ -737,6 +737,11 @@ public void Compile(VFXCompilationMode compilationMode, bool forceShaderValidati { k_FnVFXResource_SetCompileInitialVariants(m_Graph.visualEffectResource, forceShaderValidation); } + + EditorUtility.DisplayProgressBar(progressBarTitle, "Importing VFX", 11 / nbSteps); + Profiler.BeginSample("VFXEditor.CompileAsset:ImportAsset"); + AssetDatabase.ImportAsset(assetPath, ImportAssetOptions.ForceUpdate); //This should compile the shaders on the C++ size + Profiler.EndSample(); } catch (Exception e) { @@ -751,11 +756,6 @@ public void Compile(VFXCompilationMode compilationMode, bool forceShaderValidati } finally { - EditorUtility.DisplayProgressBar(progressBarTitle, "Importing VFX", 11 / nbSteps); - Profiler.BeginSample("VFXEditor.CompileAsset:ImportAsset"); - AssetDatabase.ImportAsset(assetPath, ImportAssetOptions.ForceUpdate); //This should compile the shaders on the C++ size - Profiler.EndSample(); - Profiler.EndSample(); EditorUtility.ClearProgressBar(); } diff --git a/package/Editor/Core/VFXLibrary.cs b/package/Editor/Core/VFXLibrary.cs index 0cbde53a7..5f4410685 100755 --- a/package/Editor/Core/VFXLibrary.cs +++ b/package/Editor/Core/VFXLibrary.cs @@ -162,8 +162,6 @@ static class VFXLibrary public static IEnumerable> GetOperators() { LoadIfNeeded(); return VFXViewPreference.displayExperimentalOperator ? m_OperatorDescs : m_OperatorDescs.Where(o => !o.info.experimental); } public static IEnumerable> GetSlots() { LoadSlotsIfNeeded(); return m_SlotDescs.Values; } public static IEnumerable GetSlotsType() { LoadSlotsIfNeeded(); return m_SlotDescs.Keys; } - public static bool IsSpaceableSlotType(Type type) { LoadSlotsIfNeeded(); return m_SlotSpaceable.Contains(type); } - public static IEnumerable GetParameters() { LoadIfNeeded(); return m_ParametersDescs; } public static VFXModelDescriptor GetSlot(System.Type type) @@ -237,26 +235,6 @@ public static void Load() } } - private static bool IsSpaceable(Type type) - { - var spaceAttributeOnType = type.GetCustomAttributes(typeof(VFXSpaceAttribute), true).FirstOrDefault(); - if (spaceAttributeOnType != null) - { - return true; - } - - var fields = type.GetFields(System.Reflection.BindingFlags.Public | System.Reflection.BindingFlags.Instance).ToArray(); - foreach (var field in fields) - { - var spaceAttributeOnField = field.GetCustomAttributes(typeof(VFXSpaceAttribute), true).FirstOrDefault(); - if (spaceAttributeOnField != null || IsSpaceable(field.FieldType)) - { - return true; - } - } - return false; - } - private static void LoadSlotsIfNeeded() { if (m_SlotLoaded) @@ -267,14 +245,6 @@ private static void LoadSlotsIfNeeded() if (!m_SlotLoaded) { m_SlotDescs = LoadSlots(); - m_SlotSpaceable = new HashSet(); - foreach (var slotDescType in m_SlotDescs.Keys) - { - if (IsSpaceable(slotDescType)) - { - m_SlotSpaceable.Add(slotDescType); - } - } m_SlotLoaded = true; } } @@ -391,7 +361,6 @@ public static IEnumerable FindConcreteSubclasses(Type objectType = null, T private static volatile List> m_BlockDescs; private static volatile List m_ParametersDescs; private static volatile Dictionary> m_SlotDescs; - private static volatile HashSet m_SlotSpaceable; private static Object m_Lock = new Object(); private static volatile bool m_Loaded = false; diff --git a/package/Editor/Expressions/VFXExpressionCamera.cs b/package/Editor/Expressions/VFXExpressionCamera.cs index 3431e4a0f..9dc2866b8 100755 --- a/package/Editor/Expressions/VFXExpressionCamera.cs +++ b/package/Editor/Expressions/VFXExpressionCamera.cs @@ -143,19 +143,4 @@ sealed protected override VFXExpression Evaluate(VFXExpression[] constParents) return VFXValue.Constant(CameraType.defaultValue.pixelDimensions); } } - - class VFXExpressionGetBufferFromMainCamera : VFXExpression - { - public VFXExpressionGetBufferFromMainCamera(VFXCameraBufferTypes bufferType) : base(VFXExpression.Flags.InvalidOnGPU) - { - m_BufferType = bufferType; - } - - public override VFXExpressionOperation operation { get { return VFXExpressionOperation.GetBufferFromMainCamera; }} - sealed protected override VFXExpression Evaluate(VFXExpression[] constParents) { return VFXValue.Constant(null); } - - protected override int[] additionnalOperands { get { return new int[] { (int)m_BufferType }; } } - private VFXCameraBufferTypes m_BufferType; - } - } diff --git a/package/Editor/Expressions/VFXExpressionMath.cs b/package/Editor/Expressions/VFXExpressionMath.cs index 7c4ebeb2a..17462a9b3 100755 --- a/package/Editor/Expressions/VFXExpressionMath.cs +++ b/package/Editor/Expressions/VFXExpressionMath.cs @@ -215,98 +215,12 @@ protected override bool ProcessUnaryOperation(bool input) } } - class VFXExpressionSaturate : VFXExpressionUnaryFloatOperation - { - public VFXExpressionSaturate() : this(VFXValue.Default) { } - - public VFXExpressionSaturate(VFXExpression parent) : base(parent, VFXExpressionOperation.Saturate) - { - if (!IsFloatValueType(parent.valueType)) - throw new InvalidOperationException("Unexpected VFXExpressionSaturate type with parent " + parent.valueType); - } - - sealed protected override string GetUnaryOperationCode(string x) - { - return string.Format("saturate({0})", x); - } - - sealed protected override float ProcessUnaryOperation(float input) - { - return Mathf.Clamp01(input); - } - } - - class VFXExpressionCeil : VFXExpressionUnaryFloatOperation - { - public VFXExpressionCeil() : this(VFXValue.Default) { } - - public VFXExpressionCeil(VFXExpression parent) : base(parent, VFXExpressionOperation.Ceil) - { - if (!IsFloatValueType(parent.valueType)) - throw new InvalidOperationException("Unexpected VFXExpressionCeil type with parent " + parent.valueType); - } - - sealed protected override string GetUnaryOperationCode(string x) - { - return string.Format("ceil({0})", x); - } - - sealed protected override float ProcessUnaryOperation(float input) - { - return Mathf.Ceil(input); - } - } - - class VFXExpressionRound : VFXExpressionUnaryFloatOperation - { - public VFXExpressionRound() : this(VFXValue.Default) { } - - public VFXExpressionRound(VFXExpression parent) : base(parent, VFXExpressionOperation.Round) - { - if (!IsFloatValueType(parent.valueType)) - throw new InvalidOperationException("Unexpected VFXExpressionRound type with parent " + parent.valueType); - } - - sealed protected override string GetUnaryOperationCode(string x) - { - return string.Format("round({0})", x); - } - - sealed protected override float ProcessUnaryOperation(float input) - { - return Mathf.Round(input); - } - } - - class VFXExpressionFrac : VFXExpressionUnaryFloatOperation - { - public VFXExpressionFrac() : this(VFXValue.Default) { } - - public VFXExpressionFrac(VFXExpression parent) : base(parent, VFXExpressionOperation.Frac) - { - if (!IsFloatValueType(parent.valueType)) - throw new InvalidOperationException("Unexpected VFXExpressionFrac type with parent " + parent.valueType); - } - - sealed protected override string GetUnaryOperationCode(string x) - { - return string.Format("frac({0})", x); - } - - sealed protected override float ProcessUnaryOperation(float input) - { - return Mathf.Repeat(input, 1.0f); - } - } - class VFXExpressionFloor : VFXExpressionUnaryFloatOperation { public VFXExpressionFloor() : this(VFXValue.Default) {} public VFXExpressionFloor(VFXExpression parent) : base(parent, VFXExpressionOperation.Floor) { - if (!IsFloatValueType(parent.valueType)) - throw new InvalidOperationException("Unexpected VFXExpressionFloor type with parent " + parent.valueType); } sealed protected override string GetUnaryOperationCode(string x) @@ -554,16 +468,6 @@ sealed protected override string GetBinaryOperationCode(string left, string righ return string.Format("{0} < {1} ? {0} : {1}", left, right); return string.Format("min({0}, {1})", left, right); } - - protected override VFXExpression Reduce(VFXExpression[] reducedParents) - { - VFXExpression inputSaturateExpression = null; - if (VFXExpressionMax.CanBeReducedToSaturate(this, reducedParents, out inputSaturateExpression)) - { - return new VFXExpressionSaturate(inputSaturateExpression); - } - return base.Reduce(reducedParents); - } } class VFXExpressionMax : VFXExpressionBinaryNumericOperation @@ -602,62 +506,6 @@ protected override string GetBinaryOperationCode(string left, string right, VFXV return string.Format("{0} > {1} ? {0} : {1}", left, right); return string.Format("max({0}, {1})", left, right); } - - static public bool CanBeReducedToSaturate(VFXExpression current, VFXExpression[] reducedParents, out VFXExpression inputValueRef) - { - inputValueRef = null; - var valueType = current.valueType; - if (reducedParents.Length != 2 || !VFXExpression.IsFloatValueType(valueType)) - return false; - - var one = VFXOperatorUtility.OneExpression[valueType]; - var zero = VFXOperatorUtility.ZeroExpression[valueType]; - - Type searchInnerFunctionType = null; - VFXExpression searchInnerValueFirstLevel = null; - VFXExpression searchInnerValueSecondLevel = null; - - if (current is VFXExpressionMax) - { - searchInnerFunctionType = typeof(VFXExpressionMin); - searchInnerValueFirstLevel = zero; - searchInnerValueSecondLevel = one; - } - else if (current is VFXExpressionMin) - { - searchInnerFunctionType = typeof(VFXExpressionMax); - searchInnerValueFirstLevel = one; - searchInnerValueSecondLevel = zero; - } - else - { - return false; - } - - var minReferenceExpected = reducedParents.FirstOrDefault(o => o.GetType() == searchInnerFunctionType); - var firstValueExpected = reducedParents.FirstOrDefault(o => o == searchInnerValueFirstLevel); - if (minReferenceExpected != null && firstValueExpected != null) - { - var indexOf = Array.IndexOf(minReferenceExpected.parents, searchInnerValueSecondLevel); - if (indexOf != -1) - { - var otherIndexOf = (indexOf + 1) % 2; - inputValueRef = minReferenceExpected.parents[otherIndexOf]; - return true; - } - } - return false; - } - - protected override VFXExpression Reduce(VFXExpression[] reducedParents) - { - VFXExpression inputSaturateExpression = null; - if (CanBeReducedToSaturate(this, reducedParents, out inputSaturateExpression)) - { - return new VFXExpressionSaturate(inputSaturateExpression); - } - return base.Reduce(reducedParents); - } } class VFXExpressionPow : VFXExpressionBinaryFloatOperation diff --git a/package/Editor/Expressions/VFXExpressionRandom.cs b/package/Editor/Expressions/VFXExpressionRandom.cs index 5ac9e9a17..128e86d24 100755 --- a/package/Editor/Expressions/VFXExpressionRandom.cs +++ b/package/Editor/Expressions/VFXExpressionRandom.cs @@ -44,7 +44,8 @@ public override IEnumerable GetNeededAttributes() class VFXExpressionFixedRandom : VFXExpression { public VFXExpressionFixedRandom() : this(VFXValue.Default) {} - public VFXExpressionFixedRandom(VFXExpression hash) : base(VFXExpression.Flags.None, hash) {} + public VFXExpressionFixedRandom(VFXExpression hash, bool perElement = false) : base(perElement ? VFXExpression.Flags.PerElement : VFXExpression.Flags.None, hash) + {} public override VFXExpressionOperation operation { get { return VFXExpressionOperation.GenerateFixedRandom; }} @@ -62,7 +63,13 @@ sealed protected override VFXExpression Evaluate(VFXExpression[] constParents) public override string GetCodeString(string[] parents) { - return string.Format("FixedRand({0})", parents[0]); + return string.Format("FixedRand(particleId ^ {0})", parents[0]); + } + + public override IEnumerable GetNeededAttributes() + { + if (Is(Flags.PerElement)) + yield return new VFXAttributeInfo(VFXAttribute.ParticleId, VFXAttributeMode.Read); } } #pragma warning restore 0659 diff --git a/package/Editor/Expressions/VFXExpressionTransform.cs b/package/Editor/Expressions/VFXExpressionTransform.cs index 891100510..533de6f68 100755 --- a/package/Editor/Expressions/VFXExpressionTransform.cs +++ b/package/Editor/Expressions/VFXExpressionTransform.cs @@ -57,7 +57,7 @@ public VFXExpressionInverseMatrix() : this(VFXValue.Default) public VFXExpressionInverseMatrix(VFXExpression parent) : base(VFXExpression.Flags.InvalidOnGPU, parent) {} - sealed public override VFXExpressionOperation operation + public override VFXExpressionOperation operation { get { @@ -72,152 +72,6 @@ sealed protected override VFXExpression Evaluate(VFXExpression[] constParents) } } - class VFXExpressionTransposeMatrix : VFXExpression - { - public VFXExpressionTransposeMatrix() : this(VFXValue.Default) - {} - - public VFXExpressionTransposeMatrix(VFXExpression parent) : base(Flags.None, parent) - {} - - public sealed override VFXExpressionOperation operation - { - get - { - return VFXExpressionOperation.TransposeMatrix; - } - } - - sealed protected override VFXExpression Evaluate(VFXExpression[] constParents) - { - var matrix = constParents[0].Get(); - return VFXValue.Constant(matrix.transpose); - } - - public override string GetCodeString(string[] parents) - { - return string.Format("transpose({0})", parents[0]); - } - } - - class VFXExpressionInverseTRSMatrix : VFXExpression - { - public VFXExpressionInverseTRSMatrix() : this(VFXValue.Default) - {} - - public VFXExpressionInverseTRSMatrix(VFXExpression parent) : base(VFXExpression.Flags.None, parent) - {} - - sealed public override VFXExpressionOperation operation - { - get - { - return VFXExpressionOperation.InverseTRSMatrix; - } - } - - // Invert 3D transformation matrix (not perspective). Adapted from graphics gems 2. - // Inverts upper left by calculating its determinant and multiplying it to the symmetric - // adjust matrix of each element. Finally deals with the translation by transforming the - // original translation using by the calculated inverse. - //https://github.com/erich666/GraphicsGems/blob/master/gemsii/inverse.c - static bool inputvertMatrix4x4_General3D(Matrix4x4 input, ref Matrix4x4 output) //*WIP* This function is not exposed, we will add an helper in Matrix4 bindings - { -#if UNITY_2019_2_OR_NEWER - return Matrix4x4.Inverse3DAffine(input, ref output); -#else - output = Matrix4x4.identity; - - float pos, neg, t; - float det; - - // Calculate the determinant of upper left 3x3 sub-matrix and - // determine if the matrix is singular. - pos = neg = 0.0f; - t = input[0, 0] * input[1, 1] * input[2, 2]; - if (t >= 0.0f) - pos += t; - else - neg += t; - - t = input[1, 0] * input[2, 1] * input[0, 2]; - if (t >= 0.0f) - pos += t; - else - neg += t; - - t = input[2, 0] * input[0, 1] * input[1, 2]; - if (t >= 0.0f) - pos += t; - else - neg += t; - - t = -input[2, 0] * input[1, 1] * input[0, 2]; - if (t >= 0.0f) - pos += t; - else - neg += t; - - t = -input[1, 0] * input[0, 1] * input[2, 2]; - if (t >= 0.0f) - pos += t; - else - neg += t; - - t = -input[0, 0] * input[2, 1] * input[1, 2]; - if (t >= 0.0f) - pos += t; - else - neg += t; - - det = pos + neg; - - if (det * det < 1e-25f) - return false; - - det = 1.0f / det; - output[0, 0] = (input[1, 1] * input[2, 2] - input[2, 1] * input[1, 2]) * det; - output[0, 1] = -(input[0, 1] * input[2, 2] - input[2, 1] * input[0, 2]) * det; - output[0, 2] = (input[0, 1] * input[1, 2] - input[1, 1] * input[0, 2]) * det; - output[1, 0] = -(input[1, 0] * input[2, 2] - input[2, 0] * input[1, 2]) * det; - output[1, 1] = (input[0, 0] * input[2, 2] - input[2, 0] * input[0, 2]) * det; - output[1, 2] = -(input[0, 0] * input[1, 2] - input[1, 0] * input[0, 2]) * det; - output[2, 0] = (input[1, 0] * input[2, 1] - input[2, 0] * input[1, 1]) * det; - output[2, 1] = -(input[0, 0] * input[2, 1] - input[2, 0] * input[0, 1]) * det; - output[2, 2] = (input[0, 0] * input[1, 1] - input[1, 0] * input[0, 1]) * det; - - // Do the translation part - output[0, 3] = -(input[0, 3] * output[0, 0] + input[1, 3] * output[0, 1] + input[2, 3] * output[0, 2]); - output[1, 3] = -(input[0, 3] * output[1, 0] + input[1, 3] * output[1, 1] + input[2, 3] * output[1, 2]); - output[2, 3] = -(input[0, 3] * output[2, 0] + input[1, 3] * output[2, 1] + input[2, 3] * output[2, 2]); - - output[3, 0] = 0.0f; - output[3, 1] = 0.0f; - output[3, 2] = 0.0f; - output[3, 3] = 1.0f; - - return true; -#endif - } - - sealed protected override VFXExpression Evaluate(VFXExpression[] constParents) - { - var matrix = constParents[0].Get(); - - var result = Matrix4x4.identity; - if (!inputvertMatrix4x4_General3D(matrix, ref result)) - { - throw new InvalidOperationException("VFXExpressionInverseTRSMatrix used on a not TRS Matrix"); - } - return VFXValue.Constant(result); - } - - public override string GetCodeString(string[] parents) - { - return string.Format("VFXInverseTRSMatrix({0})", parents[0]); - } - } - class VFXExpressionExtractPositionFromMatrix : VFXExpression { public VFXExpressionExtractPositionFromMatrix() : this(VFXValue.Default) @@ -236,15 +90,6 @@ public override VFXExpressionOperation operation } } - protected sealed override VFXExpression Reduce(VFXExpression[] reducedParents) - { - var parent = reducedParents[0]; - if (parent is VFXExpressionTRSToMatrix) - return parent.parents[0]; - - return base.Reduce(reducedParents); - } - sealed protected override VFXExpression Evaluate(VFXExpression[] constParents) { var matrixReduce = constParents[0]; @@ -277,15 +122,6 @@ public override VFXExpressionOperation operation } } - protected sealed override VFXExpression Reduce(VFXExpression[] reducedParents) - { - var parent = reducedParents[0]; - if (parent is VFXExpressionTRSToMatrix) - return parent.parents[1]; - - return base.Reduce(reducedParents); - } - sealed protected override VFXExpression Evaluate(VFXExpression[] constParents) { var matrixReduce = constParents[0]; @@ -313,15 +149,6 @@ public override VFXExpressionOperation operation } } - protected sealed override VFXExpression Reduce(VFXExpression[] reducedParents) - { - var parent = reducedParents[0]; - if (parent is VFXExpressionTRSToMatrix) - return parent.parents[2]; - - return base.Reduce(reducedParents); - } - sealed protected override VFXExpression Evaluate(VFXExpression[] constParents) { var matrixReduce = constParents[0]; diff --git a/package/Editor/GraphView/Blackboard/VFXBlackboard.cs b/package/Editor/GraphView/Blackboard/VFXBlackboard.cs index 40d08aeee..65d60fb09 100755 --- a/package/Editor/GraphView/Blackboard/VFXBlackboard.cs +++ b/package/Editor/GraphView/Blackboard/VFXBlackboard.cs @@ -41,6 +41,8 @@ public VFXViewController controller { m_Controller.RegisterHandler(this); } + + m_AddButton.SetEnabled(m_Controller != null); } } } @@ -58,6 +60,8 @@ public VFXViewController controller VFXView m_View; + Button m_AddButton; + public VFXBlackboard(VFXView view) { m_View = view; @@ -82,6 +86,7 @@ public VFXBlackboard(VFXView view) focusable = true; + m_AddButton = this.Q