// Fresh constructor public EmoteSetVariableNode() : base(EmoteSetVariableNodeFactory.TYPESTRING) { // Prepare Connections conExecute = new ExecutionConnectorViewModel(); inputValue = new ConnectorViewModel("Value", typeof(NodeDataNumeric)); inputFrameCount = new ConnectorViewModel("FrameCount", typeof(NodeDataNumeric)); inputEasing = new ConnectorViewModel("Easing", typeof(NodeDataNumeric)); this.InputExecutionConnectors.Add(conExecute); this.InputConnectors.Add(inputValue); this.InputConnectors.Add(inputFrameCount); this.InputConnectors.Add(inputEasing); // State Values value = 0f; frameCount = 0.1f; easing = 0.9f; varName = string.Empty; // Create Dialog dlgEdit = new PropertyDialog(); // Get Character Context charContext = CharacterContext.GetCharacterContext(); }
private List <string> getEmoteVarNames() { try { CharacterContext context = CharacterContext.GetCharacterContext(); uint countVars = context.GetCharacter(0).CountVariables(); return(Enumerable.Range(0, (int)countVars).Select(idx => context.GetCharacter(0).GetVariableLabelAt((uint)idx)).ToList()); } catch { } return(null); }
// Load Data Constructor public EmoteSetVariableNode(JObject data, Guid[] executeIn, Guid[] executeOut, Guid[] dataIn, Guid[] dataOut) { // Prepare Connections conExecute = new ExecutionConnectorViewModel(executeIn[0]); inputValue = new ConnectorViewModel("Value", typeof(NodeDataNumeric), dataIn[0]); if (dataIn.Length > 1) // allow loading older node graph saves { inputFrameCount = new ConnectorViewModel("FrameCount", typeof(NodeDataNumeric), dataIn[1]); inputEasing = new ConnectorViewModel("Easing", typeof(NodeDataNumeric), dataIn[2]); } else { inputFrameCount = new ConnectorViewModel("FrameCount", typeof(NodeDataNumeric)); inputEasing = new ConnectorViewModel("Easing", typeof(NodeDataNumeric)); } this.InputExecutionConnectors.Add(conExecute); this.InputConnectors.Add(inputValue); this.InputConnectors.Add(inputFrameCount); this.InputConnectors.Add(inputEasing); // Set Name Name = (string)data["name"]; // State Values value = (float)data["value"]; frameCount = (float)data["frameCount"]; easing = (float)data["easing"]; varName = (string)data["varName"]; // Create Dialog dlgEdit = new PropertyDialog(); // Get Character Context charContext = CharacterContext.GetCharacterContext(); }