protected override VFXExpression[] BuildExpression(VFXExpression[] inputExpression) { if (subgraph == null) { return(new VFXExpression[0]); } if (m_SubChildren == null) { RecreateCopy(); } // Change all the inputExpressions of the parameters. var parameters = GetParameters(t => VFXSubgraphUtility.InputPredicate(t)).OrderBy(t => t.order); var backedUpExpressions = new List <VFXExpression>(); VFXSubgraphUtility.TransferExpressionToParameters(inputExpression, parameters, backedUpExpressions); List <VFXExpression> outputExpressions = new List <VFXExpression>(); foreach (var param in GetParameters(t => VFXSubgraphUtility.OutputPredicate(t))) { outputExpressions.AddRange(param.inputSlots[0].GetExpressionSlots().Select(t => t.GetExpression())); } foreach (var param in parameters) { param.ResetOutputValueExpression(); } VFXSubgraphUtility.TransferExpressionToParameters(backedUpExpressions, parameters); return(outputExpressions.ToArray()); }
protected override VFXExpression[] BuildExpression(VFXExpression[] inputExpression) { if (m_Subgraph == null) { return(new VFXExpression[0]); } VFXGraph graph = m_Subgraph.GetResource().GetOrCreateGraph(); // Change all the inputExpressions of the parameters. var parameters = GetParameters(t => VFXSubgraphUtility.InputPredicate(t)); VFXSubgraphUtility.TransferExpressionToParameters(inputExpression, parameters); List <VFXExpression> outputExpressions = new List <VFXExpression>(); foreach (var param in GetParameters(t => VFXSubgraphUtility.OutputPredicate(t))) { outputExpressions.AddRange(param.inputSlots[0].GetVFXValueTypeSlots().Select(t => t.GetExpression())); } foreach (var param in GetParameters(t => VFXSubgraphUtility.InputPredicate(t))) { param.ResetOutputValueExpression(); } return(outputExpressions.ToArray()); }