代码 糙的一比。。实在太菜了。
使用了 csv,txt读入,windows 剪贴板api,UE4plugin。自己简单的记录下,美术需求的插件。
void FCopyMeshModule::PluginButtonClicked()
{
// Read file from the root.
IDesktopPlatform *DesktopPlatform = FDesktopPlatformModule::Get();
FString RootDir;
DesktopPlatform->GetDefaultEngineRootDir(RootDir);
TArray<FString> SelectedFiles;
DesktopPlatform->OpenFileDialog(nullptr, TEXT("Open File"), RootDir, TEXT(""), TEXT("Text file|*.txt"), EFileDialogFlags::None, SelectedFiles);
// Choose the first txt file
std::string CurrentFile(TCHAR_TO_UTF8(*SelectedFiles[0]));
// Ifstream read
ifstream readfile(CurrentFile);
// Must use "std::" about vector
std::string str;
std::vector <string> TotalString;
// Char "," used to separate
char * dou = ",";
std::vector<string>ShowStr;
// Read the entire line, stop by "\n"
while (getline(readfile, str))
{
ShowS