Last active
January 2, 2016 22:08
-
-
Save GRGSIBERIA/8367735 to your computer and use it in GitHub Desktop.
CSVファイルから頂点INDEXを読み込んで選択する
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Run()関数内の処理を記述 | |
// 外部クラスの活用などは一般形式のスクリプトコードを使用してください. | |
// プラグイン変数は IPERunArgs args を通して取得可能 | |
// コードに自動的に追加されるヘッダ/フッタはメニューから有効化/確認が可能(ヘッダは標準で有効設定) | |
// ファイルの指定 | |
var enc = System.Text.Encoding.GetEncoding("Shift_JIS"); | |
var path = Path.GetDirectoryName(Assembly.GetEntryAssembly().Location) + "\\" + @"input.csv"; | |
var strs = new List<int>(); // 一時的な文字列 | |
int[] select_indices = null; | |
// inputファイルの読み込み | |
using (var sr = new StreamReader(path, enc)) { | |
while (sr.Peek() > 0) | |
strs.Add(int.Parse(sr.ReadLine())); | |
select_indices = strs.ToArray(); | |
} | |
//MessageBox.Show(select_indices.Length.ToString()); | |
// PMDViewで頂点を選択 | |
args.Host.Connector.View.PMDView.SetSelectedVertexIndices(select_indices); | |
// PMDViewの更新,最後にこれをやらないと反映されない | |
args.Host.Connector.View.PMDView.UpdateView(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment