Example #1
0
bool Exporter::exportUPB(NiNodeRef &root, INode *node)
{
   bool ok = false;
   if (!mUserPropBuffer)
      return ok;

   // Write the actual UPB sans any np_ prefixed strings
   TSTR upb;
   node->GetUserPropBuffer(upb);
   if (!upb.isNull())
   {
      string line;
      istringstream istr(string(upb), ios_base::out);
      ostringstream ostr;
      while (!istr.eof()) {
         std::getline(istr, line);
         if (!line.empty() && 0 != line.compare(0, 3, "np_"))
            ostr << line << endl;
      }
      if (!ostr.str().empty())
      {
         NiStringExtraDataRef strings = CreateNiObject<NiStringExtraData>();	
         strings->SetName("UPB");
         strings->SetData(ostr.str());
         root->AddExtraData(DynamicCast<NiExtraData>(strings));
         ok = true;
      }
   }
   return ok;
}
Example #2
0
bool Exporter::exportPrn(NiNodeRef &obj, INode *node) {
   // Export Prn Text strings for any parent bones if parent is root
	if (mSupportPrnStrings && Exporter::mNifVersionInt >= VER_10_0_1_0) {
      if (INode *parentNode = node->GetParentNode()){
         string parentName = parentNode->GetName();
         NiStringExtraDataRef strings = new NiStringExtraData();	
         strings->SetName("Prn");
         strings->SetData(parentName);
         obj->AddExtraData(DynamicCast<NiExtraData>(strings));
         return true;
      }
   }
   return false;
}