message: Support for creating inputs and outputs of all types in the Graph Editor
  This change list addresses issue where the menu for creating input and output nodes is now filled according to all typedefs in the loaded document.
  Also addresses a crash issue when deleting empty nodegraphs or group nodes.
diff: @@ -175,36 +175,39 @@ mx::DocumentPtr Graph::loadDocument(mx::FilePath filename)
  // populate nodes to add with input output group and nodegraph nodes which are not found in the stdlib
  void Graph::addExtraNodes()
  {
  + if (!_graphDoc)
  + {
  + return;
  + }
  +
  + const std::vector<std::string> groups{ "Input Nodes", "Output Nodes", "Group Nodes", "Node Graph" };
  +
  + // clear any old nodes, if we previously used tab with another graph doc
  _extraNodes.clear();
  - std::vector<std::string> groups{ "Input Nodes", "Output Nodes", "Group Nodes", "Node Graph" };
  - std::vector<std::string> types{
  - "float", "integer", "vector2", "vector3", "vector4", "color3", "color4", "string", "filename", "bool"
  - };
  - // need to clear vectors if has previously used tab without there being a document, need to use the current graph doc
  - for (std::string group : groups)
  + // get all types from the doc
  + std::vector<std::string> types;
  + std::vector<mx::TypeDefPtr> typeDefs = _graphDoc->getTypeDefs();
  + types.reserve(typeDefs.size());
  + for (auto typeDef : typeDefs)
  {
  - if (_extraNodes[group].size() > 0)
  - {
  - _extraNodes[group].clear();
  - }
  + types.push_back(typeDef->getName());
  }
  - for (std::string type : types)
  - {
  - std::string nodeName = "ND_input";
  - nodeName += type;
  - std::vector<std::string> input{ nodeName, type, "input" };
  - _extraNodes["Input Nodes"].push_back(input);
  - nodeName = "ND_output";
  - nodeName += type;
  - std::vector<std::string> output{ nodeName, type, "output" };
  - _extraNodes["Output Nodes"].push_back(output);
  + // add input and output nodes for all types
  + for (const std::string& type : types)
  + {
  + std::string nodeName = "ND_input_" + type;
  + _extraNodes["Input Nodes"].push_back({ nodeName, type, "input" });
  + nodeName = "ND_output_" + type;
  + _extraNodes["Output Nodes"].push_back({ nodeName, type, "output" });
  }
  - // group node
  +
  + // add group node
  std::vector<std::string> groupNode{ "ND_group", "", "group" };
  _extraNodes["Group Nodes"].push_back(groupNode);
  - // node graph nodes
  +
  + // add nodegraph node
  std::vector<std::string> nodeGraph{ "ND_nodegraph", "", "nodegraph" };
  _extraNodes["Node Graph"].push_back(nodeGraph);
  }
  @@ -2723,6 +2726,9 @@ void Graph::deleteNode(UiNodePtr node)
  }
  }
  }
  +
  + if (node->outputPins.size() > 0)
  + {
  // update downNode info
  std::vector<Pin> outputConnections = node->outputPins.front().getConnections();
  @@ -2777,6 +2783,7 @@ void Graph::deleteNode(UiNodePtr node)
  // not really necessary since it will be deleted
  node->removeOutputConnection(pin._pinNode->getName());
  }
  + }
  // remove from NodeGraph
  // all link information is handled in delete link which is called before this
  