You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
29 lines
942 B
29 lines
942 B
using System.Linq; |
|
using UnityEngine; |
|
|
|
namespace UnityEditor.ShaderGraph |
|
{ |
|
sealed partial class GraphData : ISerializationCallbackReceiver |
|
{ |
|
public static class GraphConcretization |
|
{ |
|
public static void ConcretizeNode(AbstractMaterialNode node) |
|
{ |
|
node.Concretize(); |
|
} |
|
|
|
public static void ConcretizeProperties(GraphData graph) |
|
{ |
|
var propertyNodes = graph.GetNodes<PropertyNode>().Where(n => !graph.m_Properties.Any(p => p == n.property)).ToArray(); |
|
foreach (var pNode in propertyNodes) |
|
graph.ReplacePropertyNodeWithConcreteNodeNoValidate(pNode); |
|
} |
|
|
|
public static void ConcretizeGraph(GraphData graph) |
|
{ |
|
ConcretizeProperties(graph); |
|
GraphDataUtils.ApplyActionLeafFirst(graph, ConcretizeNode); |
|
} |
|
} |
|
} |
|
}
|
|
|