Fix constant value sliders in material graphs to not be used due to shader compilations
This commit is contained in:
@@ -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()
|
||||
|
||||
@@ -22,6 +22,9 @@ namespace FlaxEditor.Surface
|
||||
{
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public override bool CanLivePreviewValueChanges => false;
|
||||
|
||||
/// <inheritdoc />
|
||||
public override string GetTypeName(ScriptType type)
|
||||
{
|
||||
|
||||
@@ -534,6 +534,11 @@ namespace FlaxEditor.Surface
|
||||
/// </summary>
|
||||
public virtual bool CanSetParameters => false;
|
||||
|
||||
/// <summary>
|
||||
/// 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.
|
||||
/// </summary>
|
||||
public virtual bool CanLivePreviewValueChanges => true;
|
||||
|
||||
/// <summary>
|
||||
/// Determines whether the specified node archetype can be used in the surface.
|
||||
/// </summary>
|
||||
|
||||
Reference in New Issue
Block a user