Message 1 of 2
Maya reading txt extremely slow (from script)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
So I've tried to wrote script that need to read some txt file. Just trying to open it and assign to string variable (Need to edit it next). The smallest file weights 25kb and has 670 lines. Maya just freezes every time.
//Proc for read files and give me a string
proc string ReadFile(string $FilePath) {
int $MyFileID = `fopen $FilePath "r"` ;
string $WholeFile ="";
while(!feof($MyFileID))
$WholeFile = $WholeFile + (`fgetline $MyFileID`);
}
fclose $MyFileID;
return($WholeFile);
}
string $Text = `ReadFile("D:\Test.txt")`;
print $Text;