public bool UpdateControllers() { bool changed = false; var nodes = model.nodes.GroupBy(t => t.id).ToDictionary(t => t.Key, t => t.First()); foreach (var removedController in m_Controllers.Where(t => !nodes.ContainsKey(t.Key)).ToArray()) { removedController.Value.OnDisable(); m_Controllers.Remove(removedController.Key); viewController.RemoveControllerFromModel(parameter, removedController.Value); changed = true; } foreach (var addedController in nodes.Where(t => !m_Controllers.ContainsKey(t.Key)).ToArray()) { VFXParameterNodeController controller = new VFXParameterNodeController(this, addedController.Value, viewController); m_Controllers[addedController.Key] = controller; viewController.AddControllerToModel(parameter, controller); controller.ForceUpdate(); changed = true; } return(changed); }
ParameterNode CopyParameterNode(int parameterIndex, int nodeIndex, VFXParameterNodeController controller) { ParameterNode n = new ParameterNode(); n.position = controller.position; n.collapsed = controller.superCollapsed; n.expandedOutput = controller.infos.expandedSlots.Select(t => t.path).ToArray(); if (parameterIndex < (1 << 18) && nodeIndex < (1 << 11)) { modelIndices[controller] = GetParameterNodeID((uint)parameterIndex, (uint)nodeIndex); } else { modelIndices[controller] = InvalidID; } return(n); }
public VFXParameterOutputDataAnchorController(VFXSlot model, VFXParameterNodeController sourceNode, bool hidden) : base(model, sourceNode, hidden) { }