diff --git a/Source/Editor/Surface/Elements/FloatValue.cs b/Source/Editor/Surface/Elements/FloatValue.cs index 7674c68b9..56539e3e3 100644 --- a/Source/Editor/Surface/Elements/FloatValue.cs +++ b/Source/Editor/Surface/Elements/FloatValue.cs @@ -33,6 +33,10 @@ namespace FlaxEditor.Surface.Elements Archetype = archetype; ParentNode.ValuesChanged += OnNodeValuesChanged; + + // Disable slider if surface doesn't allow it + if (!ParentNode.Surface.CanLivePreviewValueChanges) + _slideSpeed = 0.0f; } private void OnNodeValuesChanged() diff --git a/Source/Editor/Surface/MaterialSurface.cs b/Source/Editor/Surface/MaterialSurface.cs index 08e1161d9..ba7f2e01e 100644 --- a/Source/Editor/Surface/MaterialSurface.cs +++ b/Source/Editor/Surface/MaterialSurface.cs @@ -22,6 +22,9 @@ namespace FlaxEditor.Surface { } + /// + public override bool CanLivePreviewValueChanges => false; + /// public override string GetTypeName(ScriptType type) { diff --git a/Source/Editor/Surface/VisjectSurface.cs b/Source/Editor/Surface/VisjectSurface.cs index 0185e364a..3ac702549 100644 --- a/Source/Editor/Surface/VisjectSurface.cs +++ b/Source/Editor/Surface/VisjectSurface.cs @@ -534,6 +534,11 @@ namespace FlaxEditor.Surface /// public virtual bool CanSetParameters => false; + /// + /// Gets a value indicating whether surface supports/allows live previewing graph modifications due to value sliders and color pickers. True by default but disabled for shader surfaces that generate and compile shader source at flight. + /// + public virtual bool CanLivePreviewValueChanges => true; + /// /// Determines whether the specified node archetype can be used in the surface. ///