|
@@ -4,6 +4,7 @@ using PixiEditor.ChangeableDocument.Changeables.Graph.Nodes;
|
|
using PixiEditor.ChangeableDocument.Changes.NodeGraph;
|
|
using PixiEditor.ChangeableDocument.Changes.NodeGraph;
|
|
using PixiEditor.DrawingApi.Core.Shaders;
|
|
using PixiEditor.DrawingApi.Core.Shaders;
|
|
using PixiEditor.DrawingApi.Core.Shaders.Generation;
|
|
using PixiEditor.DrawingApi.Core.Shaders.Generation;
|
|
|
|
+using PixiEditor.DrawingApi.Core.Shaders.Generation.Expressions;
|
|
|
|
|
|
namespace PixiEditor.ChangeableDocument.Changeables.Graph;
|
|
namespace PixiEditor.ChangeableDocument.Changeables.Graph;
|
|
|
|
|
|
@@ -45,7 +46,8 @@ public class FuncInputProperty<T> : InputProperty<Func<FuncContext, T>>, IFuncIn
|
|
isShaderExpression = true;
|
|
isShaderExpression = true;
|
|
}
|
|
}
|
|
|
|
|
|
- ConversionTable.TryConvert(delegateToCast.DynamicInvoke(f), targetType, out var result);
|
|
|
|
|
|
+ var sourceObj = delegateToCast.DynamicInvoke(f);
|
|
|
|
+ ConversionTable.TryConvert(sourceObj, targetType, out var result);
|
|
if (isShaderExpression)
|
|
if (isShaderExpression)
|
|
{
|
|
{
|
|
var toReturn = Activator.CreateInstance(typeof(T), "");
|
|
var toReturn = Activator.CreateInstance(typeof(T), "");
|
|
@@ -53,6 +55,10 @@ public class FuncInputProperty<T> : InputProperty<Func<FuncContext, T>>, IFuncIn
|
|
{
|
|
{
|
|
((ShaderExpressionVariable)toReturn).SetConstantValue(result, ConversionTable.Convert);
|
|
((ShaderExpressionVariable)toReturn).SetConstantValue(result, ConversionTable.Convert);
|
|
}
|
|
}
|
|
|
|
+ else if (sourceObj is Expression expression)
|
|
|
|
+ {
|
|
|
|
+ ((ShaderExpressionVariable)toReturn).OverrideExpression = expression;
|
|
|
|
+ }
|
|
|
|
|
|
return (T)toReturn;
|
|
return (T)toReturn;
|
|
}
|
|
}
|