public override void RefreshExternalReferences() { base.RefreshExternalReferences(); if (UIUtils.CurrentShaderVersion() < 16303) { InputPort standardPort = GetInputPortByUniqueId(0); if (standardPort.IsConnected) { UIUtils.SetConnection(UniqueId, 3, standardPort.GetConnection().NodeId, standardPort.GetConnection().PortId); } } }
//public void AnaliseNode( ParentNode node, int outputTargetId, eWirePortDataType inputPortType, ref MasterNodeDataCollector dataCollector, bool ignoreLocalVar ) //{ // dataCollector.AddInstructions( node.GetValueFromOutputStr( outputTargetId, inputPortType, ref dataCollector, ignoreLocalVar ) ); //} public void CreateInstructionsForPort(InputPort port, string portName, bool addCustomDelimiters = false, string customDelimiterIn = null, string customDelimiterOut = null, bool ignoreLocalVar = false) { WireReference connection = port.GetConnection(); ParentNode node = UIUtils.GetNode(connection.NodeId); string newInstruction = node.GetValueFromOutputStr(connection.PortId, port.DataType, ref UIUtils.CurrentDataCollector, ignoreLocalVar); if (UIUtils.CurrentDataCollector.DirtySpecialLocalVariables) { UIUtils.CurrentDataCollector.AddInstructions(UIUtils.CurrentDataCollector.SpecialLocalVariables); UIUtils.CurrentDataCollector.ClearSpecialLocalVariables(); } if (UIUtils.CurrentDataCollector.ForceNormal) { UIUtils.CurrentDataCollector.AddToStartInstructions("\t\t\t" + Constants.OutputVarStr + ".Normal = float3(0,0,1);\n"); UIUtils.CurrentDataCollector.ForceNormal = false; } UIUtils.CurrentDataCollector.AddInstructions(addCustomDelimiters ? customDelimiterIn : ("\t\t\t" + portName + " = ")); UIUtils.CurrentDataCollector.AddInstructions(newInstruction); UIUtils.CurrentDataCollector.AddInstructions(addCustomDelimiters ? customDelimiterOut : ";\n"); }